P1 meter suddenly stopped working

Moderator: leecollings

balosa
Posts: 21
Joined: Sunday 17 May 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

P1 meter suddenly stopped working

Post by balosa »

Hi all,

I've got a strange problem, at 13-04-2024 01:53:16 the P1 meter suddenly stopper working, I am not receiving data from the meter anymore, there were no changes or other problems during that time that I know of.

Is there a way to pinpoint the problem, I want to know if it's a hardware problem (cable/connector/USB stick) or a software problem (domoticz, pi)

- I checked the cable, everything seems fine
- I tried another USB port on the PI => didn't work
- I restarted the PI => didn't work
- I shutdown the PI and restarted => didn't work
- updated the PI and domoticz (to v2024.4) => didn't work
- log doesn't show any problems
- I loaded an older database version when the P1 meter still worked => didn't work
- I removed the P1 meter in domoticz and re-installed it => didn't work

Hope to hear some suggestions.

Thanks in advance.
P1meter_1.jpg
P1meter_1.jpg (380.28 KiB) Viewed 1511 times
User avatar
HansieNL
Posts: 960
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 meter suddenly stopped working

Post by HansieNL »

I've set the Data Timeout to 1 minute. If there's no data received for a minute the P1 hardware will be restarted.
Maybe you can enable this option and see if this fix your problem.
Blah blah blah
balosa
Posts: 21
Joined: Sunday 17 May 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: P1 meter suddenly stopped working

Post by balosa »

Thanks for your response, I tried it but didn't work, not receiving any data.
P1meter_2.jpg
P1meter_2.jpg (97.86 KiB) Viewed 1501 times
willemd
Posts: 628
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: P1 meter suddenly stopped working

Post by willemd »

The display of the P1 meter itself still shows data?

Did you turn all debugging on?
balosa
Posts: 21
Joined: Sunday 17 May 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: P1 meter suddenly stopped working

Post by balosa »

yes the P1 meter is showing data, and yes all debugging is on
willemd
Posts: 628
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: P1 meter suddenly stopped working

Post by willemd »

Maybe there is a way to check communication on /dev/ttyUSB0 directly, without domoticz, to narrow it down further?
User avatar
waltervl
Posts: 5374
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter suddenly stopped working

Post by waltervl »

To check if data is coming to Domoticz stop Domoticz, start reading the USB port, check data and after checking start Domoticz again.

Code: Select all

sudo service domoticz stop
sudo cu -l /dev/ttyUSB0 -s 115200
sudo service domoticz start 
In the second step you should see readible data/telegrams coming in. Change the USB port according the setting you have in Domoticz hardware.

See also https://www.domoticz.com/wiki/Dutch_DSM ... th_P1_port
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
balosa
Posts: 21
Joined: Sunday 17 May 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: P1 meter suddenly stopped working

Post by balosa »

the sudo cu command is not found it says ;

command -> "sudo cu -l /dev/ttyUSB0 -s 115200"
response -> "sudo: cu: opdracht niet gevonden"
User avatar
waltervl
Posts: 5374
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter suddenly stopped working

Post by waltervl »

Then you can try one of these alternatives or install cu.
https://www.cyberciti.biz/hardware/5-li ... l-console/
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 525
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: P1 meter suddenly stopped working

Post by HvdW »

I'm having trouble with P1 meter readings lately as well.
My setup is P1 on USB0 and RFXtfx433 on USB1
I installed PersistentUSBdevices as well and set both up as /dev/ttyUSB-P1 and /dev/ttyUSB-RFX433

Every now and then there's no input on Power and Gas and switches don't react.
Then I change eiter to USB1 and USB0 or to /dev/ttyUSB-P1 and /dev/ttyUSB-RFX433 and everything is working as expected.
There are no errors in the log.

This behaviour is random and happening about once in 2, 3 weeks (I think)
Bugs bug me.
User avatar
waltervl
Posts: 5374
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter suddenly stopped working

Post by waltervl »

Perhaps you have /dev/serial/by-id devices on your system (on recent OS)? You better use those as that should prevent switching serial devices by the OS.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 525
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: P1 meter suddenly stopped working

Post by HvdW »

waltervl wrote: Monday 15 April 2024 23:28 Perhaps you have /dev/serial/by-id devices on your system (on recent OS)? You better use those as that should prevent switching serial devices by the OS.
Maybe I do not understand exactly what you mean.
Anyway this is what I have.
RPI4 2G running Bullseye.

Code: Select all

#RFXtrx433
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A1XECZN7", SYMLINK+="ttyUSB-RFX433"
# P1 converter
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="P1Z4BCV9", SYMLINK+="ttyUSB-P1"
# S0 pulse meter
SUBSYSTEM=="tty", ATTRS{idVendor}=="2109", ATTRS{idProduct}=="3431", SYMLINK+="ttyUSB-S0-Pulse"
If something should be stated otherwise, please explain.
Bugs bug me.
User avatar
waltervl
Posts: 5374
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter suddenly stopped working

Post by waltervl »

If you do an

Code: Select all

ls -l /dev/serial/by-id
you should see all your connected USB devices by ID. These will not change even if you put the device in another USB Port. So similar to creating Persistant devices manually. This is standard Linux functionality now. This is also mentioned in the wiki page header for persistent devices you already referred too.

But you are hijacking a topic of somebody else now....

@balosa how is the directly debugging of the serial line to P1 meter going?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
balosa
Posts: 21
Joined: Sunday 17 May 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: P1 meter suddenly stopped working

Post by balosa »

managed to install cu (sudo apt-get install cu)

see screenshot for the message, it says the Line is in use
P1meter_3.jpg
P1meter_3.jpg (13.27 KiB) Viewed 1345 times
User avatar
waltervl
Posts: 5374
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter suddenly stopped working

Post by waltervl »

Did you stop Domoticz before trying cu? Else Domoticz is using the device.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
balosa
Posts: 21
Joined: Sunday 17 May 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: P1 meter suddenly stopped working

Post by balosa »

yes i did

pi@raspberrypi:~ $ sudo service domoticz stop
pi@raspberrypi:~ $ sudo cu -l /dev/ttyUSB0 -s 9600
cu: open (/dev/ttyUSB0): Permission denied
cu: /dev/ttyUSB0: Line in use
User avatar
waltervl
Posts: 5374
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter suddenly stopped working

Post by waltervl »

You can try to not use sudo.
If still it is not working you probably have to root cause of the issue: Domoticz has no access anymore to the USB port.

Was there an update on your system? Also google on ttyUSB permission denied in relation with your Operating system to see how to solve it.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
balosa
Posts: 21
Joined: Sunday 17 May 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: P1 meter suddenly stopped working

Post by balosa »

ok thank you for your suggestion, I will try some things tomorrow, I will post any progress here
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: P1 meter suddenly stopped working

Post by gizmocuz »

And as Walter mentioned before, when you have multiple USB devices connected to the system, use the serial-by-id device as the USB devices could be swapped internally (ttyUSB0 with ttyUSB1) when the machine is rebooted.

You also did not mention what hardware you are using.
Quality outlives Quantity!
balosa
Posts: 21
Joined: Sunday 17 May 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: P1 meter suddenly stopped working

Post by balosa »

sorry about that, i use a raspberry Pi 3+
only things connected are a Sonoff 433 Mhz bridge, P1 meter (cable), and a USB drive with the software

can you pinpoint me to the direction how i could use the serial-by-id
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest