Open tdwesten opened 4 years ago
Hi Thomas,
Based on your "cu" command I see you are using a baud rate of 9600, which is not in the config so it won't auto discover your smart meter.
Can you try adding
{
"port": "/dev/ttyUSB0",
"baudRate": 9600,
"parity": "none",
"dataBits": 7,
"stopBits": 1
}
to the "serialPort" array in /config/config.json file?
Hi Ruud, Thanks for your response. After adding the smartmeter to the config.json i got this response;
[2020-05-11T18:41:26.115Z] Available serial ports with possible configurations:
[
{
"port": "/dev/ttyAMA0",
"baudRate": 115200,
"parity": "none",
"dataBits": 8,
"stopBits": 1
},
{
"port": "/dev/ttyAMA0",
"baudRate": 115200,
"parity": "even",
"dataBits": 7,
"stopBits": 1
},
{
"port": "/dev/ttyAMA0",
"baudRate": 9600,
"parity": "none",
"dataBits": 7,
"stopBits": 1
},
{
"port": "/dev/ttyUSB0",
"baudRate": 115200,
"parity": "none",
"dataBits": 8,
"stopBits": 1
},
{
"port": "/dev/ttyUSB0",
"baudRate": 115200,
"parity": "even",
"dataBits": 7,
"stopBits": 1
},
{
"port": "/dev/ttyUSB0",
"baudRate": 9600,
"parity": "none",
"dataBits": 7,
"stopBits": 1
}
]
[2020-05-11T18:41:26.133Z] Trying to connect to Smart Meter via port: /dev/ttyAMA0 (BaudRate: 115200, Parity: none, Databits: 8Stopbits: 1)
[2020-05-11T18:41:26.211Z] Smart Meter not found yet, trying another port / configuration...
[2020-05-11T18:41:26.215Z] Trying to connect to Smart Meter via port: /dev/ttyAMA0 (BaudRate: 115200, Parity: even, Databits: 7Stopbits: 1)
[2020-05-11T18:41:26.229Z] Smart Meter not found yet, trying another port / configuration...
[2020-05-11T18:41:26.231Z] Trying to connect to Smart Meter via port: /dev/ttyAMA0 (BaudRate: 9600, Parity: none, Databits: 7Stopbits: 1)
[2020-05-11T18:41:26.237Z] Smart Meter not found yet, trying another port / configuration...
[2020-05-11T18:41:26.239Z] Trying to connect to Smart Meter via port: /dev/ttyUSB0 (BaudRate: 115200, Parity: none, Databits: 8Stopbits: 1)
[2020-05-11T18:41:26.265Z] Serial connection established
[2020-05-11T18:41:56.257Z] Smart Meter not found yet, trying another port / configuration...
[2020-05-11T18:41:56.260Z] Trying to connect to Smart Meter via port: /dev/ttyUSB0 (BaudRate: 115200, Parity: even, Databits: 7Stopbits: 1)
[2020-05-11T18:41:56.276Z] Smart Meter not found yet, trying another port / configuration...
[2020-05-11T18:41:56.279Z] Trying to connect to Smart Meter via port: /dev/ttyUSB0 (BaudRate: 9600, Parity: none, Databits: 7Stopbits: 1)
Could not find a Smart Meter
Still no luck..
Hi Thomas,
Hmm strange, I guess your smart meter has a different combination of BaudRate, Parity, DataBits and StopBits, that is not in the config list. When I look at your output via "cu" I see it DSMR2.2 version meter. That was one of the first generations of Smart Meters. I'm still working on improving support for that older version, but it's very difficult to find any good docs or details about those ones.
Someone else already created a nice overview of different meters with their serial port configs: http://domoticx.com/p1-poort-slimme-meter-hardware/
Can you check what meter brand and type you have? Hopefully that helps in finding the correct serial port config.
And if you find it, try adding it as the first item in the array, so it starts with that one first :)
Hi Thomas,
I've just finished version 2.0 in which I removed the auto-discover option since more people were having issue with that and it only adds complexity. And I've added some more stuff in version 2.0 :)
Can you try that version and let me know if it works?
Regards,
Ruud
Hi Ruud, Thanks for building this package!
I have a problem finding our smartmeter. When I use your example code this is the output;
When I use
ls -l /dev/ttyUSB*
i got this, I think this mean there is a USB connected;crw-rw---- 1 root dialout 188, 0 May 9 14:07 /dev/ttyUSB0
And when I connect via
cu -l /dev/ttyUSB0 -s 9600 --parity=none
i can "read" the smartmeter;I hope this makes sense ;) and hopefully you have any tips how to fix this.