Coder Social home page Coder Social logo

Comments (15)

matthijsvisser avatar matthijsvisser commented on June 7, 2024

from kamstrup-402-mqtt.

madradrakie avatar madradrakie commented on June 7, 2024

hi matthijs. before i activate the script i press the button on the meter. i assume the 401 is working the same as the 402. i have tried for an hour to find the sweet spot but still no luck. it is also very hard to determine if the IR leds of the head are alligned perfectly

from kamstrup-402-mqtt.

matthijsvisser avatar matthijsvisser commented on June 7, 2024

You can try the official software from kamstrup to verify if the meter will respond to those commands

See https://www.kamstrup.com/nl-nl/warmteoplossingen/slimme-warmtemeters/meter-software

from kamstrup-402-mqtt.

matthijsvisser avatar matthijsvisser commented on June 7, 2024

from kamstrup-402-mqtt.

madradrakie avatar madradrakie commented on June 7, 2024

i have tried the official software but my meter, the kamstrup 401 is not listed. It starts with the 402. I'am really curious if someone has managed to get it working because thereis a sensor eye present on the 401.

from kamstrup-402-mqtt.

matthijsberk avatar matthijsberk commented on June 7, 2024

I did have the same problem, but after reading the manual I found out that the communication is different between a M402 and M401. At the moment I can read the values from the meter (m401), but I'm still looking into the possibility to send it via Mqtt (no great coder myself). Maybe you can adapt (USB port) and try this bit of code if your IR is placed correctly and is working?:

`
import serial
from time import sleep

mc401 = serial.Serial(port='/dev/ttyUSB1', bytesize=serial.SEVENBITS, parity=serial.PARITY_EVEN, stopbits=serial.STOPBITS_ONE, timeout=2)

mc401.baudrate = 300
mc401.write(bytes("/#1", 'UTF-8'))
mc401.flush()
sleep(1)
mc401.baudrate = 1200
mc401.flushInput()
data = mc401.read(87).split()
try:
print(data[0], data[1], data[3], data[4], data[5], data[6], data[7])
except IndexError:
pass
`

The main problem that I encountered is that you must send a signal at 300 baudrate, but you can only receive at 1200 baudrate. I have used the signal /#1 as this gives back energy, volume, temp1, temp2, tempdiff.

from kamstrup-402-mqtt.

madradrakie avatar madradrakie commented on June 7, 2024

hello matthijs. Nico to read that you got it working. Can you tell me what you mean by adapt and at which place i should place the code? The IR reader is connected with a raspberry pi. I am still learning everyday :-)

from kamstrup-402-mqtt.

laithsaid avatar laithsaid commented on June 7, 2024

I have same issue with MutliCAL 602. It should be using same protocol "KMP" but it is just echoing the same values I'm sending to it. Any idea?
It works fine with kamstrup official tools, but they are windows tools so I cannot use them :(

from kamstrup-402-mqtt.

matthijsvisser avatar matthijsvisser commented on June 7, 2024

Hi,

I don't have the 602, so unfortunately I cant help you with that. But here are my thoughts:

If you receive the exact same message as the code sends, than its possible that you having issues with reflections. Which IR head are you using? You can try to put some paper between the IR head and the meter to diffuse the light a little. Or try some more positions with the meter head. When I was testing the code, I experienced that the official tooling was able to handles more 'noise' than my code.

from kamstrup-402-mqtt.

laithsaid avatar laithsaid commented on June 7, 2024

from kamstrup-402-mqtt.

Obelix74Git avatar Obelix74Git commented on June 7, 2024

I have a similar problem.

We have a Kamstrup MultiCAL 66C. According to the specifications, it works with:
300 baud req /300 baud reply, 1 start bit, 7 data bits, equal parity, 2 stop bits.

How can I change this because if I change this in kamstrup_meter.py to
baud rate = 300,
parity = serial.PARITY_EVEN,
bytesize = serial.SEVENBITS,

I get this error within 4 seconds :

Traceback (most recent call last):
File "/tmp/test/kamstrup-402-mqtt/daemon.py", line 92, in
main()
File "/tmp/test/kamstrup-402-mqtt/daemon.py", line 89, in main
daemon.run()
File "/tmp/test/kamstrup-402-mqtt/daemon.py", line 81, in run
values ​​= self.heat_meter.run()
File "/tmp/test/kamstrup-402-mqtt/kamstrup_meter.py", line 114, in run
value = self.readparameter(int(str(kamstrup_402_params[parameter]), 0))
File "/tmp/test/kamstrup-402-mqtt/kamstrup_meter.py", line 205, in read parameter
elif ((receivedMessage[0] != 0x3f) or
IndexError: byte array index out of range

What do I need to change to make the communication work properly?

from kamstrup-402-mqtt.

matthijsvisser avatar matthijsvisser commented on June 7, 2024

It looks like you don't receive any data from the meter since the received Message array is empty.

from kamstrup-402-mqtt.

matthijsvisser avatar matthijsvisser commented on June 7, 2024

from kamstrup-402-mqtt.

alekslyse avatar alekslyse commented on June 7, 2024

Did you guys get this working? I have a 401, and put the meter over the reader at the bottom right. It seems to be seated properly, and tried all kinds of positions, but no reading. I also clicked the enter/play button on the reader.

For info I am using this reader, as it was suggested by someone. It should be working I think? https://www.aliexpress.com/item/1005003509520122.html

from kamstrup-402-mqtt.

madradrakie avatar madradrakie commented on June 7, 2024

Did you guys get this working? I have a 401, and put the meter over the reader at the bottom right. It seems to be seated properly, and tried all kinds of positions, but no reading. I also clicked the enter/play button on the reader.

For info I am using this reader, as it was suggested by someone. It should be working I think? https://www.aliexpress.com/item/1005003509520122.html

Hello Alekslyse. I got it working with for the 401 meter. I used the following code:
https://github.com/matthijsberk/M401-irreader
See for more information:
matthijsberk/M401-irreader#2

from kamstrup-402-mqtt.

Related Issues (15)

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.