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

Mehr
23 Mai 2018 21:25 #76 von haribo

xPhclogd uses a datadriven command decoder version 1, it seems that some parts of that internal data is wrong and uses data from version 2 of the decoder (improved version for an PHC-2-MQTT gateway).

Looking further in the coming days... takes some time as it was quiet some time ago :)


Hi Jo,

will there still be a chance to get an update of xPhcLog that fixes my timing problems? Otherwise I would try to build workarounds. In generally it works fine :-)

Regards Harald

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
27 Mai 2018 19:35 #77 von simonjo
Hello Harald,

I will write some extra code to replay the packets from your logging, that way I can debug my code and see where it actually goes wrong.

Will let you know in a few days.

regards, Jo

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
27 Mai 2018 20:11 #78 von haribo
Hi Jo,

that would be great. If there is anything that I could do to support please let me know.

Harald

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
04 Jun 2018 22:55 #79 von simonjo
Hi Harald,

I found the problem and fixed it, now I try to get my Raspi up and running so I can compile it... but I don't know the password anymore... so need to look in my notes for a clue...

regards, Jo

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
05 Jun 2018 20:03 #80 von haribo
Hi Jo,
that gives me hope.

I recommend a password manager :-)

I‘m looking forward ..

Thanks a lot so far
Harald

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
10 Jun 2018 22:49 #81 von simonjo
Here is version 4.0.0.6, can you please try it out.

regards, Jo
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
19 Jun 2018 19:28 #82 von haribo
Hi Jo,

I'm sorry, but I still have the same (or similar) problem.

I will try to simplify the constellation to offer a more obvious example of the malfunction.

I will keep you informed.

Harald

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
22 Jun 2018 18:12 #83 von haribo
Hi Jo,
your versions 4.0.0.4 and 4.0.0.6 have the same faulty behaviour.

I would like to give you a more obvious example – only one module is involved:
OMD.0.0 is the master, OMD.0.1 and OMD.0.2 are slaves that follow, when the state of he master changes (see phc.png).

This is the test scenario:
1. All outputs are OFF
2. Xphclogd is restarted
3. OMD.0.1 is switched to ON and a few seconds later to back to OFF to initialize everything
4. Then OMD.0.0 is switched to ON, the slaves get on commands
5. At the end two states are wrong
root@openhab2:/home/pi/xphclog# egrep 'topic|v4' 4.0.0.6.log 
2018-06-22,16:52:55,001C0000,CApp::InitLogging,xPhcLogd (Linux/RbPI), v4.0.0.6, Jun 10 2018, Jo Simons (c) 2007-2018
# switch omd.0.out1 on to initialize 
2018-06-22,16:53:18,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/cmd/omd.0.out1,payload=on
2018-06-22,16:53:18,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.0,payload=0
2018-06-22,16:53:18,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.1,payload=1
2018-06-22,16:53:18,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.2,payload=0
2018-06-22,16:53:18,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.3,payload=0
2018-06-22,16:53:18,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.4,payload=0
2018-06-22,16:53:18,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.5,payload=0
2018-06-22,16:53:18,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.6,payload=0
2018-06-22,16:53:18,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.7,payload=0
2018-06-22,16:53:18,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/evt/omd.0,payload=on
# switch omd.0.out1 off
2018-06-22,16:53:22,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/cmd/omd.0.out1,payload=off
2018-06-22,16:53:22,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.1,payload=0
2018-06-22,16:53:22,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/evt/omd.0,payload=off
# switch master on – the following states are OK
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/cmd/omd.0.out0,payload=on
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.0,payload=1
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/evt/omd.0,payload=on
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/cmd/omd.0.out1,payload=on
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.1,payload=1
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/cmd/omd.0.out2,payload=on
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.2,payload=1
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/evt/omd.0,payload=on
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.0,payload=0
# the following sates are wrong: omd.0.out.2 gets 0 and omd.0.out.6 gets 1
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.2,payload=0
2018-06-22,16:53:31,00010010,CPhclogd::_decodeEnhModPublish,topic=myHouse/sta/omd.0.out.6,payload=1

When I change the scenario and give a delay of 1 second to the second slave (see phc-delayed.png) everything works fine.
I hope this helps for further debugging.

Regards Harald

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
27 Jun 2018 12:53 #84 von simonjo
I will check it out

regards, Jo

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
28 Jun 2018 13:40 #85 von simonjo
I see the problem, it is about this packet: 4003224207

The output module receives 2 commands in rapid succession, and for that reason saves up the feedback events and sends them in 1 packet to the STM. I have never seen this one before, so a nice catch.

The point is that I used the '42' as status while it should be the '07' byte.

Looking how to fix this in a generic way...

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
02 Jul 2018 23:52 #86 von simonjo
Hallo Harald,

Pls find below version 4.0.0.7, this should fix the wrong status updates.

I still need to handle events with more than 1 event per packet, but that requires some more investigation, will do so later.


regards, Jo
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
03 Jul 2018 18:59 #87 von haribo
Hi Jo,

you did it - everything works fine!

Thank you very much for your work.

Regards and good luck for Belgium in the World Cup 2018!

Harald

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
17 Aug 2018 11:41 #88 von Jan
Hello,

I have two USB-RS485 convertors (those cheap Chinees ones). They both worked a while but now they seem to be dead. Symptoms are that STM cannot send commands any more when the converter is connected to the RS485 bus and is powered (with a USB power supply).


Since other people here also had problems with these convertors could it be that the PHC RS485bus behaves outside specification and damages them?

Kind regards,
Jan

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
17 Aug 2018 19:08 #89 von haribo
Hi Jan,

I had the same problems with a set of different adaptors. Some did not work at all and others only for some time and/or had a blocking effect on the STM. I can't say wether the STM was responsible for the damage or if they decided to die by themselves.

My solution was to buy a seperate RS232 to LAN Server (eg. Moxa NPort 5110). Since I connected my raspery to both the STM serial port and to the system bus (RS485) I chose a NPort 5210 (two serial ports, look here: www.ebay.de/itm/Moxa-NPort-5210-V2-0-unb...9:g:UooAAOSwuOpbZarK )

My system works stable for a year.

Regards Harald

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
18 Aug 2018 15:59 #90 von Jan
Hi Harald,

Thanks for the answer. I've read that you exerimented quite a lot with these adapters and that the solution with the Moxa works stable.
However the solution is rather expensive (still 70€ on Ebay, and no shipment abroad). Therefore I was wondering if others managed to read the RS485 bus with a cheaper (stable!) device.

Also, for me there is no need to send the RS232 and RS485 traffic over the IP network. My Rpi is close to the STM so 2 USB sticks connected to the RPi would be fine. A cheap USB-RS232 cable is already doing the work fine for a couple of years.

For me it’s a mistery why I can’t capture the RS485 bus with this good working cable when I connect A to pin 2 (RX) and B to pin 5 (GND). I also tried the inverse.

Br,
Jan

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Powered by Kunena Forum