Topic-icon xPhcLog, log events on the PHC module bus

Mehr
15 Jan 2019 07:19 #106 von Biland
So today I want to give you some news regarding my problems with the PHC System an xphclog.

After Harald sent me the setting of his nport (thank you Harald) I adjust the settings of my nport to the same one.
After that I connected the nport with the phc system and started xphclog but after some actions of switches the system hang up again.
Then I removed the cable for xwrc from the nport and restart the phc system. Next I started xphclog again and toggled some swichtes. But then I was very surprised. There was no logging possible. Xphclog got no signals. Then I connected the cable for xwrc during xphclog was running and toggled some switches again. Now the system worked nice – no hang up – fine logging …
Even after a restart or reconnection of the cables the xphclog works fine and the PHC system didn’t crash.
But what was the root cause for the problem? I don’t understand the problem.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
15 Jan 2019 19:00 - 15 Jan 2019 19:03 #107 von Biland
Hey once again I have a question:
On Openhab2 I have add an item like this:
Switch Light_GF_Kitchen "Küche"                 (GF_Living, Info)           { http=">[ON:GET:http://192.168.1.28:9999/icontrol.dll?ccmd=omd.1.out2.on] >[OFF:GET:http://192.168.1.28:9999/icontrol.dll?ccmd=omd.1.out2.off]", mqtt="<[mosquitto:myHouse/sta/omd.1.out.2:state:ON:1], <[mosquitto:myHouse/sta/omd.1.out.2:state:OFF:0]" }
With OH2 I can turn the light on and off. But if I swicht the light by hardware swichts or Xwrc visualisation the status won't update in OH.
I am sure that mosquitto is running well because I am using some Sonoff Wlanswitches by mosquitto too.

The log looks like this:
root@raspberrypi:/# /xwrc/xphclog/xphclogd.raspi --ini /xwrc/xphclog/xphclogd.ini

+ xPhcLogd   (Linux/RbPI) ------ v4.0.0.7, Jul  2 2018, Jo Simons (c) 2007-2018
+ =============================================================================
Press CTRL-C to quit...
2019-01-15,18:56:27,00090000,A,version=4.0.0.7,Jul  2 2018
2019-01-15,18:56:27,00090010,A,legend:
2019-01-15,18:56:27,00090011,A,  o0=out0-7,o1=out8-15
2019-01-15,18:56:27,00090012,A,  i0=in0-7,i1=in8-15
2019-01-15,18:56:27,00090013,A,  l0=out0,l1=out1,l2=out2,l3=out3 (amd/ebd/dim)
------ here I switch the lights off and on by using OH --------------
2019-01-15,18:57:00,00010210,M,omd.1.out2.off
2019-01-15,18:57:00,00010240,M,omd.1.modAck,o0=104
2019-01-15,18:57:08,00010210,M,omd.1.out2.on
2019-01-15,18:57:08,00010240,M,omd.1.modAck,o0=108
------ here I switch the lights off and on by using my xwrc "http visualisation --------------
2019-01-15,18:57:21,00010210,M,omd.1.out2.toggle
2019-01-15,18:57:21,00010240,M,omd.1.modAck,o0=104
2019-01-15,18:57:21,00010210,M,omd.0.status
2019-01-15,18:57:21,00010240,M,omd.0.modAck,o0=65
2019-01-15,18:57:23,00010210,M,omd.1.out2.toggle
2019-01-15,18:57:23,00010240,M,omd.1.modAck,o0=108
2019-01-15,18:57:23,00010210,M,omd.0.status
2019-01-15,18:57:23,00010240,M,omd.0.modAck,o0=65
------ here I switch the lights off and on by using hardware switch --------------
2019-01-15,18:57:30,00010130,M,imd.0.in3.ingt0
2019-01-15,18:57:30,00010150,M,imd.0.stmAck
2019-01-15,18:57:30,00010210,M,omd.1.out2.toggle
2019-01-15,18:57:30,00010240,M,omd.1.modAck,o0=104
2019-01-15,18:57:31,00010130,M,imd.0.in3.ingt0
2019-01-15,18:57:31,00010150,M,imd.0.stmAck
2019-01-15,18:57:31,00010210,M,omd.1.out2.toggle
2019-01-15,18:57:31,00010240,M,omd.1.modAck,o0=108
Letzte Änderung: 15 Jan 2019 19:03 von Biland.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
15 Jan 2019 19:36 #108 von simonjo
Maybe you should wait a few days or weeks to see if the lockup occurs again. Could be due to a voltage potential that slowly builds up. Or static electricity due to the dry winter conditions. I could not think of anything else at this point.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
15 Jan 2019 22:22 #109 von haribo
Hi Biland,

I'm missing the publish entries in the logfile like these:
2019-01-13,22:43:02,00010210,CPhclogd::_decodeEnhMod,omd.1.out2.toggle
2019-01-13,22:43:02,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/cmd/omd.1.out2,payload=toggle
2019-01-13,22:43:02,00010200,CPhclogd::_decodeEnhModPublish,err=0
2019-01-13,22:43:02,00010220,CPhclogd::_decodeEnhMod,mod-ack

I think mosquitto doesn't receive messages vom xhpclogd. When you send commands with OH2 the status of the items is internaly updated.

You can trace mqtt with the following command:
root@raspberrypi:~# mosquitto_sub -d -t '#'
Client mosqsub/29368-raspberry received PUBLISH (d0, q0, r0, m0, 'myHouse/cmd/omd.7.out2', ... (6 bytes))
toggle
Client mosqsub/29368-raspberry received PUBLISH (d0, q0, r0, m0, 'myHouse/evt/omd.7', ... (2 bytes))
on
Client mosqsub/29368-raspberry received PUBLISH (d0, q0, r0, m0, 'myHouse/sta/omd.7.out.2', ... (1 bytes))
1
Client mosqsub/29368-raspberry received PUBLISH (d0, q0, r0, m0, 'myHouse/cmd/dim.1', ... (6 bytes))
status

If you only see messages from Sonoff you have to check your configuration.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
16 Jan 2019 17:58 #110 von Biland
Hey Harald,
thanks for your feedback.

I try to trace mqtt and get following log:
[17:47:53] openhabian@openHABianPi:~$ mosquitto_sub -d -t '#'
Client mosqsub/2233-openHABian sending CONNECT
Client mosqsub/2233-openHABian received CONNACK
Connection Refused: not authorised.
Client mosqsub/2233-openHABian sending CONNECT
Client mosqsub/2233-openHABian received CONNACK
Connection Refused: not authorised.
Client mosqsub/2233-openHABian sending CONNECT
Client mosqsub/2233-openHABian received CONNACK
Connection Refused: not authorised.
Client mosqsub/2233-openHABian sending CONNECT
Client mosqsub/2233-openHABian received CONNACK
Connection Refused: not authorised.
^C

Here some information regarding my setup:
Raspi 1: Xwrc and xphclog / IP:192.168.1.28
xphclog.ini:
Warnung: Spoiler!


Raspi 2: openhabian / IP: 192.168.1.56
On Raspi 2 there is running openhab with MQTT Binding.
mqtt.cfg:
Warnung: Spoiler!

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
16 Jan 2019 20:25 #111 von simonjo
1) the modules list is you specify has the wrong format, it should be as below (so no ranges):

modules=jrm.4;jrm.5

2) can you start xphclogd with extra parameter: --loglevel 0xFFFFFFFF

Put the logging here so I can check what is going wrong

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
17 Jan 2019 18:24 #112 von Biland
Hi Simon,
here is a log of my system:
root@raspberrypi:~# /xwrc/xphclog/xphclogd.raspi --ini /xwrc/xphclog/xphclogd.ini --loglevel 0xFFFFFFFF

+ xPhcLogd   (Linux/RbPI) ------ v4.0.0.7, Jul  2 2018, Jo Simons (c) 2007-2018
+ =============================================================================
Press CTRL-C to quit...
2019-01-17,18:20:57,00090000,A,version=4.0.0.7,Jul  2 2018
2019-01-17,18:20:57,00090010,A,legend:
2019-01-17,18:20:57,00090011,A,  o0=out0-7,o1=out8-15
2019-01-17,18:20:57,00090012,A,  i0=in0-7,i1=in8-15
2019-01-17,18:20:57,00090013,A,  l0=out0,l1=out1,l2=out2,l3=out3 (amd/ebd/dim)
2019-01-17,18:21:17,00010210,M,omd.1.status
2019-01-17,18:21:17,00010240,M,omd.1.modAck,o0=108
2019-01-17,18:21:17,00010210,M,omd.0.status
2019-01-17,18:21:17,00010240,M,omd.0.modAck,o0=65
2019-01-17,18:21:18,00010210,M,omd.1.out6.toggle
2019-01-17,18:21:18,00010240,M,omd.1.modAck,o0=44
2019-01-17,18:21:18,00010210,M,omd.0.status
2019-01-17,18:21:18,00010240,M,omd.0.modAck,o0=65
2019-01-17,18:21:19,00010210,M,omd.1.out6.toggle
2019-01-17,18:21:19,00010240,M,omd.1.modAck,o0=108
2019-01-17,18:21:19,00010210,M,omd.0.status
2019-01-17,18:21:19,00010240,M,omd.0.modAck,o0=65
2019-01-17,18:21:31,00010130,M,imd.0.in1.outlt1
2019-01-17,18:21:31,00010150,M,imd.0.stmAck
2019-01-17,18:21:31,00010210,M,omd.1.out6.toggle
2019-01-17,18:21:31,00010240,M,omd.1.modAck,o0=44
2019-01-17,18:21:31,00010130,M,imd.0.in1.outlt1
2019-01-17,18:21:31,00010150,M,imd.0.stmAck
2019-01-17,18:21:31,00010210,M,omd.1.out6.toggle
2019-01-17,18:21:31,00010240,M,omd.1.modAck,o0=108


And a log of my MQTT Binding of the Raspberry with Openhab:

[18:23:27] openhabian@openHABianPi:~$ mosquitto_sub -d -t '#'
Client mosqsub/15882-openHABia sending CONNECT
Client mosqsub/15882-openHABia received CONNACK
Connection Refused: not authorised.
Client mosqsub/15882-openHABia sending CONNECT
Client mosqsub/15882-openHABia received CONNACK
Connection Refused: not authorised.
Client mosqsub/15882-openHABia sending CONNECT
Client mosqsub/15882-openHABia received CONNACK
Connection Refused: not authorised.
Client mosqsub/15882-openHABia sending CONNECT
Client mosqsub/15882-openHABia received CONNACK
Connection Refused: not authorised.
^C

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
17 Jan 2019 18:58 #113 von Biland
Hey new update:
After uninstall an new installation of mqtt the status update of ligths in my OH works fine! Thanks a lot for your support!

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
24 Jan 2019 17:46 #114 von Biland
Hey I have a last question.
How can I adjust that xphclog will start automatical after rebooting my raspi?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
24 Jan 2019 18:00 #115 von haribo
Hi,

look at

raspberry.tips/raspberrypi-einsteiger/ra...rogrammen-einrichten

and attached sample file (remove extension .txt).

Harald
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
13 Apr 2020 17:42 - 13 Apr 2020 17:46 #116 von Biland
Hi Simon,
Long time go since I was active here. First I want to wish you happy eastern.

I hope that you or somebody can help me... on my Raspberry i have Update Openhab to Version 2.5 this means that the mqtt structure is a little bit different.

My Sonoffs are working find. Also i am able to switch on and off the lights of my PHC system by HTTP. But the status dont update by xphclog and mqtt. hope that you can help me....

Here are my settings:

Warnung: Spoiler!



Here are my items:
Warnung: Spoiler!


and an Item of Sonoff:
Warnung: Spoiler!

and the Thing for the Sonoff:
Warnung: Spoiler!
Letzte Änderung: 13 Apr 2020 17:46 von Biland.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
14 Apr 2020 08:23 #117 von Jan
Hi Biland,

What MQTT binding of OpenHAB are you using?

I also tried to convert my setup to the new MQTT binding structure but didn't succeed. The asymmetrical structure of the command (>http and <mqtt) doesn't seem to fit in the new concept.

Therefore I installed the legacy binding MQTT (1.x) and kept the old structure and this works fine, also with OH 2.5. But I'm afraid that this old binding will not be kept/supported forever. So if somebody knows how to convert the PHC steering to the new MQTT structure I would be thankful.

Also, I don't know if you can use the old and new binding together.

Br,
Jan

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
14 Apr 2020 09:20 #118 von Biland
Hello Jan,
I hope you had a nice Easter.

After a few tries, I got it working.
Here my *.items / *.things (MQTT Binding 2.5.1):
Warnung: Spoiler!


Warnung: Spoiler!

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
16 Apr 2020 10:55 #119 von Jan
Hi Biland,

Thank you very much for the example, with that I started to convert my OH2 setup to latest MQTT version.

I successfully created Type 'switch' channels but didn't succeed with the Type 'contact' channels (works only when I create them as a Type 'string'). Do you have an example for that?

Kind regards,
Jan

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
24 Dez 2020 19:16 #120 von BNBN
Hi everybody,

I've tried to use xphclogd and was finally (after one week) successfull. This were my two pitfalls:

I use a Moxa nport 5210 for xwrc (port1) and for xphclogd (port2) I use the setup of Harald (thx for the input). The wiring was a bit tricky. This works for me: xwrc is connected to the upper right part of the STM 940 and port 2 is connected to the SPV lower left part. I only have connected the RX cable to the B connection as my XWRC on port 1 already has a GND connection.

The next part is the software setup. The locaddr is the ip address of the raspberry where xphclogd is running not the nport ip address. After that the software starts and logs the data from the phc system.

BR
Bjoern

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Powered by Kunena Forum