1

In the Netherlands the energy providers are rolling out smart meters which allow you measure your energy usage in your house. There's a cable that you need to buy (this one) but you should be able to plug it into the raspberry and read from it.

There's one small problem. When I try to read the USB, I get nothing back. This yields nothing now:

head -27 /dev/ttyUSB0

When I run that the bash script just hangs there. It is strange because it was running yesterday just fine. It would return a blob of text just like:

/ISK5\2M550E-1012

1-3:0.2.8(50)
0-0:1.0.0(181005125307S)
0-0:96.1.1(4530303433303037313335303636383138)
1-0:1.8.1(000005.811*kWh)
1-0:1.8.2(000014.353*kWh)
1-0:2.8.1(000000.000*kWh)
1-0:2.8.2(000000.000*kWh)
0-0:96.14.0(0002)
1-0:1.7.0(00.227*kW)
1-0:2.7.0(00.000*kW)
0-0:96.7.21(00011)
0-0:96.7.9(00003)
1-0:99.97.0()
1-0:32.32.0(00000)
1-0:32.36.0(00002)
0-0:96.13.0()
1-0:32.7.0(236.1*V)
1-0:31.7.0(001*A)
1-0:21.7.0(00.227*kW)
1-0:22.7.0(00.000*kW)
0-1:24.1.0(003)
0-1:96.1.0(4730303339303031383136373038353138)
0-1:24.2.1(181005125001S)(00003.957*m3)
!E278

I've reinstalled the raspberry from scratch but to no avail. I've also replaced the cable but to no avail.

  • What are the permissions of /dev/ttyUSB0? Do the logged in user have to be in a specific group? Watching permanent with sudo cat /dev/ttyUSB0 and power cycle the smart meter does not give anything, not even some glitches? – Ingo Oct 7 '18 at 10:38
  • even with that sudo command added i see nothing. – cantdutchthis Oct 8 '18 at 15:58
  • after ls -lhat i see crw-rw---- 1 root dialout 188, 0 Oct 6 15:12 /dev/ttyUSB0 – cantdutchthis Oct 8 '18 at 15:59
  • but i am logged in as root, so i think that that shouldn't be it. – cantdutchthis Oct 8 '18 at 16:00
  • Never login as root for normal work on unix systems. Login as normal user, e.g. user pi, add this user to group dialout (sudo adduser pi dialout), logout and login and check again. – Ingo Oct 8 '18 at 21:50
0

USB RS232 converters are often hogged by the USB modem facilities. That's why they are in the dialout group after all. Check if you have a modem manager or similar software running, and stop it. It's a race for the ressource, that's why it sometimes work and sometimes not.

If you want to run both a modem manager (e.g. for an USB connected LTE modem) and your meter, you have to avoid the modem software recognize your smart meter as a modem. I usually do it by creating an UDEV rule for the vendor:device USB id of the "special" converter and have it appear as /dev/myspecialdevice instead of /dev/ttyUSB*.

  • Sounds interesting. I am very much new to rpi. How can I check if a modem manager is running (or turn it off)? – cantdutchthis Oct 27 '18 at 19:58
  • It's may be process called literally ModemManager. Use ps aux or top to identify it and kill it. If your own program runs nicely, you have the culprit. If you don't need it, simply deinstall. – Janka Oct 27 '18 at 20:02
  • I cannot find such a service that is running either via ps aux, top or systemctl – cantdutchthis Oct 27 '18 at 20:09
  • Try sudo fuser /dev/ttyUSB0 then. – Janka Oct 27 '18 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.