xPhcLog, log events on the PHC module bus
- haribo
- Offline
- Senior Boarder
- Beiträge: 68
- Dank erhalten: 12
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.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
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.
- haribo
- Offline
- Senior Boarder
- Beiträge: 68
- Dank erhalten: 12
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.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
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.
- haribo
- Offline
- Senior Boarder
- Beiträge: 68
- Dank erhalten: 12
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.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
regards, Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- haribo
- Offline
- Senior Boarder
- Beiträge: 68
- Dank erhalten: 12
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.
- haribo
- Offline
- Senior Boarder
- Beiträge: 68
- Dank erhalten: 12
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.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
regards, Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
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.
- simonjo
- Autor
- Offline
- Gold Boarder
- Beiträge: 148
- Dank erhalten: 55
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
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- haribo
- Offline
- Senior Boarder
- Beiträge: 68
- Dank erhalten: 12
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.
- Jan
- Offline
- Junior Boarder
- Beiträge: 17
- Dank erhalten: 2
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.
- haribo
- Offline
- Senior Boarder
- Beiträge: 68
- Dank erhalten: 12
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.
- Jan
- Offline
- Junior Boarder
- Beiträge: 17
- Dank erhalten: 2
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.
- Aktuelle Seite:
- Startseite
- Forum
- PHC-Forum
- Visualisierung
- xPhcLog, log events on the PHC module bus