chester4444 / esp-multical21

ESP8266/ESP32 decrypts wireless MBus frames from a Multical21 water meter
GNU General Public License v3.0
89 stars 33 forks source link

need help #10

Closed rettroo closed 11 months ago

rettroo commented 1 year ago

hi,

i have now the hardware and also all data (AES Key, WIFI and so on) but no clue how to compile this one together... Anyone here who can support me?

chester4444 commented 12 months ago

good place to start: Getting Started with PlatformIO

rettroo commented 12 months ago

@chester4444 after investing hours of searching... just your provided video and i get mqtt data...

but thats the only one... i do not receive any data from my multical.

i am not sure what i should do with pin GD0? should i connect that to nothing or to D2 or to D4?

// Attach CC1101 pins to ESP8266 SPI pins
// VCC   => 3V3
// GND   => GND
// CSN   => D8
// MOSI  => D7
// MISO  => D6
// SCK   => D5
// GD0   => D2  A valid interrupt pin for your platform (defined below this)
// GD2   => not connected 
  #define CC1101_GDO0         D2   // GDO0 input interrupt pin
  #define PIN_LED_BUILTIN     D4
chester4444 commented 12 months ago

should i connect that to nothing or to D2 or to D4?

GDO0 goes to D2

#define DEBUG 0 if you change this to 1 you get more logging info, good luck

rettroo commented 12 months ago

After connecting GDO0 with D2 and set DEBUG to 1 i only get following message from mqtt:

23.11.2023, 15:19:19/watermeter/ipaddr10.0.1.229 23.11.2023, 15:19:19/watermeter/onlineTrue

nothing more... no data from multical or something else.

where can i see the logging to find out what is still needed?

Danke Chester!

chester4444 commented 12 months ago

nothing more... no data from multical or something else.

Ok, first you should check if any data is received at all.

Multical21 sends a packet every 16 seconds, uncomment these printfs to see if there are any packets received.

https://github.com/chester4444/esp-multical21/blob/b076743f544bb2a55108afe9febdb6e9f65013bd/src/WaterMeter.cpp#L240 https://github.com/chester4444/esp-multical21/blob/b076743f544bb2a55108afe9febdb6e9f65013bd/src/WaterMeter.cpp#L251

if you see an output, then packets are coming in. The function check() is called and the meter-ID is validated. If the meter-ID isnt matching, the received packet is ignored (so you are handling only your data and not the neighbours one).

have you set your meter-ID and encryption key? #define W_ENCRYPTION_KEY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 #define W_SERIAL_NUMBER 0x12, 0x34, 0x56, 0x78

i put these defines in credentials.h - replace these numbers with yours - double check for typos.

uncomment any printf's in the code you like, put some more in, to see whats going on.

btw: i used this project only as a proof of concept (i use the core parts of this code in my smarthome solution)

rettroo commented 12 months ago

should i get this output to mqtt?

i commented out the 2 lines but there is an issue

[{ "resource": "/c:/wmneu/src/WaterMeter.cpp", "owner": "cpp", "severity": 8, "message": "'lfield' was not declared in this scope; did you mean 'yield'?", "startLineNumber": 251, "startColumn": 27, "endLineNumber": 251, "endColumn": 27 }] and [{ "resource": "/C:/wmneu/src/WaterMeter.cpp", "owner": "C/C++: IntelliSense", "code": "20", "severity": 8, "message": "identifier \"lfield\" is undefined", "source": "C/C++", "startLineNumber": 251, "startColumn": 27, "endLineNumber": 251, "endColumn": 33 }]

i changed lfield to yield but still no more output..

chester4444 commented 12 months ago

change lfield to length (sorry, lfield isnt declared)

rettroo commented 12 months ago

hmm.. same issue

[{ "resource": "/c:/wmneu/src/WaterMeter.cpp", "owner": "cpp", "severity": 8, "message": "'length' was not declared in this scope", "startLineNumber": 251, "startColumn": 27, "endLineNumber": 251, "endColumn": 27 }]

chester4444 commented 12 months ago

ah, i see - last try: use payloadLength

chester4444 commented 11 months ago

Enjoy