P1 visible in hardware, but no devices....

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
bnwgraaf
Posts: 28
Joined: Monday 26 December 2016 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

P1 visible in hardware, but no devices....

Post by bnwgraaf »

Hello,

For about a year, I had an Raspberry Pi B+ with Domoticz and it was logging my Electricity and Gas consumption through the P1 connection on my "smart meter" (Brand Kaifa).
It was working very well and I believe it runs a wheezy image with Domoticz.

No I would like to set up a Raspberry Pi Zero for this purpose.

I clean installed Raspbian Jessie and Domoticz.
I followed these ones:

for configuration and static IP, and update OS:
https://www.domoticz.com/wiki/Initial_R ... y_Pi_Setup

Extra packages and update firmware:
https://www.domoticz.com/wiki/Preparing ... r_Domoticz

Installing Domoticz:
https://www.domoticz.com/wiki/Installin ... spberry_PI

I installed this one:

Code: Select all

sudo apt-get install cu minicom
And if I run the next line:

Code: Select all

cu -l /dev/ttyAMA0 -s 115200 --parity=none
I got this:

Code: Select all

pi@raspberrypi:~ $ cu -l /dev/ttyAMA0 -s 115200 --parity=none
cu: open (/dev/ttyAMA0): Permission denied
cu: /dev/ttyAMA0: Line in use
If I run these lines:

Code: Select all

sudo chmod a+rw /dev/ttyAMA0
cu -l /dev/ttyAMA0 -s 115200 --parity=none
I get:
Connected.
/KFM5KAIFA-METER

1-3:0.2.8(42)
0-0:1.0.0(170114221820W)
0-0:96.1.1(4530303235303030303334343832353135)
1-0:1.8.1(001469.949*kWh)
1-0:1.8.2(001344.092*kWh)
1-0:2.8.1(000000.000*kWh)
1-0:2.8.2(000000.000*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(00.434*kW)
1-0:2.7.0(00.000*kW)
0-0:96.7.21(00007)
0-0:96.7.9(00004)
1-0:99.97.0(1)(0-0:96.7.19)(000101000001W)(2147483647*s)
1-0:32.32.0(00000)
1-0:32.36.0(00000)
0-0:96.13.1()
0-0:96.13.0()
1-0:31.7.0(002*A)
1-0:21.7.0(00.430*kW)
1-0:22.7.0(00.000*kW)
0-1:24.1.0(003)
0-1:96.1.0(4730303139333430323334373431383135)
0-1:24.2.1(170114220000W)(01163.212*m3)
!AE1A
/KFM5KAIFA-METER
After about 10 seconds, it stops.


So I get values.

Now I go to Domoticz through the IP address and added th P1 meter with following settings:
P1 Smart Meter USB
Data Timeout disabled
port: /dev/ttyAMA0
baudrate: 115200
CRC message checked.

These values are exactly the same as on my RPI B+, with functioning P1 logging.
I even use the same cable between my RPI and my P1 port.

But unfortunatelly, I do not see any devices, no electicity, no gas....
And as said, the command:

Code: Select all

cu -l /dev/ttyAMA0 -s 115200 --parity=none
works, but only for about ten seconds.

Can somebody please help me! I tried a lot of things and have read a lot of forum threads.
The big difference with my working RPI, is now RPI Zero, instead of RPI B+ and Jessie OS instead of Wheezy.

I have read through the manual, but with no success....what am I missing??
I am a noob with linux/raspberry, but I am no computer noob and I did manage it last time with almost no problem, except for now......
bnwgraaf
Posts: 28
Joined: Monday 26 December 2016 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 visible in hardware, but no devices....

Post by bnwgraaf »

Okay, after this code:

Code: Select all

sudo systemctl stop [email protected]
I was able to add the devices, but they seem to stop after reboot....

I found this in the log:

Code: Select all

2017-01-14 22:53:26.104 Domoticz V3.5877 (c)2012-2016 GizMoCuz
2017-01-14 22:53:26.108 Build Hash: 15b013c, Date: 2016-11-10 16:44:33
2017-01-14 22:53:26.108 System: Raspberry Pi
2017-01-14 22:53:26.108 Startup Path: /home/pi/domoticz/
2017-01-14 22:53:26.537 Sunrise: 08:41:00 SunSet:16:56:00
2017-01-14 22:53:26.537 EventSystem: reset all events...
2017-01-14 22:53:26.586 Active notification subsystems: (0/12)
2017-01-14 22:53:26.611 WebServer(HTTP) started on address: :: with port 8081
2017-01-14 22:53:26.638 WebServer(SSL) started on address: :: with port 444
2017-01-14 22:53:26.643 Proxymanager started.
2017-01-14 22:53:26.651 Starting shared server on: :::6144
2017-01-14 22:53:26.653 RxQueue: queue worker started...
2017-01-14 22:53:26.653 TCPServer: shared server started...
2017-01-14 22:53:28.654 P1 Smart Meter: Using serial port: /dev/ttyAMA0
2017-01-14 22:53:28.658 EventSystem: reset all events...
2017-01-14 22:53:28.659 EventSystem: reset all device statuses...
2017-01-14 22:53:28.661 EventSystem: Started
2017-01-14 22:53:47.249 Incoming connection from: 192.168.2.7
2017-01-14 22:54:23.940 Error: Serial Port closed!... Error: End of file
I finally run these two lines:

Code: Select all

sudo systemctl stop [email protected]
sudo systemctl disable [email protected]
Now, when entering this lines:

Code: Select all

sudo chmod a+rw /dev/ttyAMA0
cu -l /dev/ttyAMA0 -s 115200 --parity=none
Values keep coming in, for some time and then I get:

Code: Select all

cu: Got hangup signal
Disconnected.
Only within Domoticz it is not updating at all and the log gave me the "Error: Serial Port closed!... Error: End of file" error...

Oh, and after a reboot of the RPI, I get this:

Code: Select all

pi@raspberrypi:~ $ cu -l /dev/ttyAMA0 -s 115200 --parity=none
cu: open (/dev/ttyAMA0): Permission denied
cu: /dev/ttyAMA0: Line in use
pi@raspberrypi:~ $
Only if I enter this:

Code: Select all

sudo chmod a+rw /dev/ttyAMA0
cu -l /dev/ttyAMA0 -s 115200 --parity=none
The values keep comping for some time again (about 10 seconds)....only no update at all within Domoticz....

So I think I am getting near......does somebody have the final solution?
bnwgraaf
Posts: 28
Joined: Monday 26 December 2016 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 visible in hardware, but no devices....

Post by bnwgraaf »

Ok, some new testing....

If I enter this:

Code: Select all

cu -l /dev/ttyAMA0 -s 115200 --parity=none
I get this:

Code: Select all

cu: open (/dev/ttyAMA0): Permission denied
cu: /dev/ttyAMA0: Line in use
If I enter this:

Code: Select all

sudo chmod a+rw /dev/ttyAMA0
cu -l /dev/ttyAMA0 -s 115200 --parity=none
I get my P1 values for about 10 seconds

If I enter this:

Code: Select all

sudo systemctl stop [email protected]
sudo chmod a+rw /dev/ttyAMA0
cu -l /dev/ttyAMA0 -s 115200 --parity=none
The values keep coming, but the values in Domoticz are not updated...

After a reboot I have to use this code again:

Code: Select all

sudo systemctl stop [email protected]
If I enter this code:

Code: Select all

sudo systemctl disable [email protected]
I still need following code,to avoid aborting after 10 seconds:

Code: Select all

sudo systemctl stop [email protected]
And even then, the values in Domoticz are not updated.....

So I need something to get some permanent updating the readings and I need something to get Domoticz updating the values.
bnwgraaf
Posts: 28
Joined: Monday 26 December 2016 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 visible in hardware, but no devices....

Post by bnwgraaf »

I don't know how, but it suddenly works....but as a test I rebooted the Rasberry, and Domoticz stopped giving P1 values....
So some setting is not persistent....

Somebody any idea?
renerene
Posts: 351
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: P1 visible in hardware, but no devices....

Post by renerene »

maybe the permisson denied issue can be solved using this post
bnwgraaf
Posts: 28
Joined: Monday 26 December 2016 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 visible in hardware, but no devices....

Post by bnwgraaf »

Thank you for your reply.

I am almost there.

In the thread you mentioned, these lines helped:

Code: Select all

sudo systemctl stop [email protected]
sudo systemctl disable [email protected]
But after reboot I need to run them again.
But I also have to change baudrate to the wrong number and change it back.

After that it is working!

So, two questions:
1 Can I add these lines to some startup file:

Code: Select all

sudo systemctl stop [email protected]
sudo systemctl disable [email protected]
2 Why do I have to change baudrate and change it back, to get Domoticz reading the p1 values?
bnwgraaf
Posts: 28
Joined: Monday 26 December 2016 19:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 visible in hardware, but no devices....

Post by bnwgraaf »

SOLVED!
Solved by adding those two lines to:
/etc/rc.local

Domoticz survives a reboot now!

Tnx for the help.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest