Closed TaoMao109 closed 10 months ago
Hi,
With the meter head that I got I must position it a little above those "small bumps" for it it to read anything. See the attached photo in the repository.
I have now tested using the metertool app and I can verify that I am able to read the meter (through my phone)
Perhaps the RPI is not sending the command through the right com port?
That could be, do you see the green led on the meter head blinking when sending a command with your phone? And does that also happen with the pi?
Yes, I can see the led indicator blinking, only when I plug the IR reader through my phone, but not through my RPI. I checked by disconnecting and reconnecting the usb and it is indeed ttyUSB0.
Restarting/rerunning the script will force to send a message to the meter, did you try that already?
I tried rebooting the RPI and running python3 daemon.py, however I still see from the log in the the [] message...
Okay, I have eventually figured it out. Turns out that the Ir reader should not be touching the small bumps as you said. What was strange is that when I used the app on my phone it was reading the outputs, but with RPI not. Case closed!
Hello, I am currently working on implementing mqtt on my kamstrup 402. So far, mqtt sends the messages correctly, however they are all blank ( [] ).
I saw on the log that there are "CRC error" messages:
[2023-12-22 19:56:55 daemon.py run: 77 - INFO - Waiting 1 minute(s) for the next meter readout] [2023-12-22 19:57:55 kamstrup_meter.py open: 118 - DEBUG - Opened serial port] [2023-12-22 19:57:55 kamstrup_meter.py readparameter: 204 - WARNING - Message is invalid] [2023-12-22 19:57:56 kamstrup_meter.py recv: 188 - ERROR - CRC error] [2023-12-22 19:57:56 kamstrup_meter.py readparameter: 198 - WARNING - No response from meter] [2023-12-22 19:57:56 kamstrup_meter.py readparameter: 204 - WARNING - Message is invalid] [2023-12-22 19:57:56 kamstrup_meter.py recv: 188 - ERROR - CRC error] [2023-12-22 19:57:56 kamstrup_meter.py readparameter: 198 - WARNING - No response from meter] [2023-12-22 19:57:56 kamstrup_meter.py readparameter: 204 - WARNING - Message is invalid] [2023-12-22 19:57:56 kamstrup_meter.py close: 126 - DEBUG - Closed serial port] [2023-12-22 19:57:56 mqtt_handler.py publish: 46 - INFO - Publishing 'kamstrup/values' '{}' to ---.---.---.---] [2023-12-22 19:57:56 daemon.py run: 77 - INFO - Waiting 1 minute(s) for the next meter readout]
I can tell that the IR reader is correctly placed on the position, as there are two small bumps that keep it in place.
Does anyone know what the CRC error is? As far as I can tell, my serial port is ttyUSB0 (confirmed it via dmseg).
Any help is greatly appreciated! 😄