Closed rettroo closed 11 months ago
good place to start: Getting Started with PlatformIO
@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
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
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!
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)
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..
change lfield to length (sorry, lfield isnt declared)
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 }]
ah, i see - last try: use payloadLength
Enjoy
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?