Giter Site home page Giter Site logo

Comments (6)

bilbolodz avatar bilbolodz commented on July 29, 2024 1

I've thought rather about "special FHEM mode". To use your software with FHEM you have to put message in format "b6e4401[rest removed]\n" (Just that string without any additional dates, semicolons etc) into pipe file. Full recipe is:

  1. Install FHEM ;-)
  2. mkfifo /opt/fhem/CUL_fifo
  3. chown fhem:dialout /opt/fhem/CUL_fifo
  4. Create "dummy CUL device (via telnet or WWW):

defmod cul_emu CUL /opt/fhem/CUL_fifo@directio 3539
attr cul_emu dummy 1
attr cul_emu rfmode WMBus_T

  1. Pipe WMBus telegram into fifo file (that's why I'm asking for special FHEM mode).
  2. FHEM should automatically create WMBUS devices. At first time FHEM starts complaing about missing crystallographic perl modules so you will have to full fill all dependencies for WMBUS module but if you know anything about linux it's very easy.
  3. Messages could be encrypted in that case you have to define AES key (in my case hopefully it's "standard" 0000..... code

from rtl-wmbus.

xaelsouth avatar xaelsouth commented on July 29, 2024
diff --git a/t1_c1_packet_decoder.h b/t1_c1_packet_decoder.h
index ba320f1..2dc77a1 100644
--- a/t1_c1_packet_decoder.h
+++ b/t1_c1_packet_decoder.h
@@ -554,13 +554,13 @@ static void t1_c1_packet_decoder(unsigned bit, unsigned rssi)
                 rssi,
                 get_serial(t1_c1_packet_decoder_work.packet));
 
-#if 0
-        fprintf(stdout, "0x");
+#if 1
+        fprintf(stdout, "b");
         for (size_t l = 0; l < t1_c1_packet_decoder_work.L; l++) fprintf(stdout, "%02x", t1_c1_packet_decoder_work.packet[l]);
         fprintf(stdout, ";");
 #endif
 
-#if 1
+#if 0
         t1_c1_packet_decoder_work.L = cook_pkt(t1_c1_packet_decoder_work.packet, t1_c1_packet_decoder_work.L);
         fprintf(stdout, "0x");
         for (size_t l = 0; l < t1_c1_packet_decoder_work.L; l++) fprintf(stdout, "%02x", t1_c1_packet_decoder_work.packet[l]);

from rtl-wmbus.

xaelsouth avatar xaelsouth commented on July 29, 2024

BTW, i am interested in how you have done decoding WMBus telegrams with fhem software. Could you provide a recipe?

from rtl-wmbus.

xaelsouth avatar xaelsouth commented on July 29, 2024
diff --git a/t1_c1_packet_decoder.h b/t1_c1_packet_decoder.h
index ba320f1..146ce47 100644
--- a/t1_c1_packet_decoder.h
+++ b/t1_c1_packet_decoder.h
@@ -546,6 +546,7 @@ static void t1_c1_packet_decoder(unsigned bit, unsigned rssi)
     {
         t1_c1_packet_decoder_work.crc_ok = check_calc_crc_wmbus(t1_c1_packet_decoder_work.packet, t1_c1_packet_decoder_work.L) ? 1 : 0;
 
+#if 0
         fprintf(stdout, "%s;%u;%u;%s;%u;%u;%08X;", t1_c1_packet_decoder_work.c1_packet ? "C1": "T1",
                 t1_c1_packet_decoder_work.crc_ok,
                 t1_c1_packet_decoder_work.err_3outof^1,
@@ -553,14 +554,14 @@ static void t1_c1_packet_decoder(unsigned bit, unsigned rssi)
                 t1_c1_packet_decoder_work.packet_rssi,
                 rssi,
                 get_serial(t1_c1_packet_decoder_work.packet));
+#endif
 
-#if 0
-        fprintf(stdout, "0x");
+#if 1
+        fprintf(stdout, "b");
         for (size_t l = 0; l < t1_c1_packet_decoder_work.L; l++) fprintf(stdout, "%02x", t1_c1_packet_decoder_work.packet[l]);
-        fprintf(stdout, ";");
 #endif
 
-#if 1
+#if 0
         t1_c1_packet_decoder_work.L = cook_pkt(t1_c1_packet_decoder_work.packet, t1_c1_packet_decoder_work.L);
         fprintf(stdout, "0x");
         for (size_t l = 0; l < t1_c1_packet_decoder_work.L; l++) fprintf(stdout, "%02x", t1_c1_packet_decoder_work.packet[l]);

from rtl-wmbus.

xaelsouth avatar xaelsouth commented on July 29, 2024

See new patch above. Apply the patch, make and then test if it fits your needs with

  • cat samples2.bin | build/rtl_wmbus 2>/dev/null

The output should be:
b294468502300207172f03840a0009f21000000a07d220200010000005b94000000000000000004000302030200002b75
b6644242382007064640e0baa721221008492261704300050059de7c9967230894d0d5e5aab82e4d9eefe39d0b338a3c8f936c0db728d6786698b5c0b4b88e516b988611072a991fd1fbfd2a5b8bee9f9c6bf73da0ce56ae94e2cf7c75b250bfd8ed0f2ec1b810b9c5f3adc3f7cfa326857c98da060

I can't test it with FHEM, because samples2.bin contains Techem smoke detector for which FHEM module does not exist. The second line is from W-Mbus converter sitting on heat meter.

Let me know, if the patch from above will help you (or not).

from rtl-wmbus.

bilbolodz avatar bilbolodz commented on July 29, 2024

It's working. Now I'm waiting for more messages from meter.

from rtl-wmbus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.