- Beiträge: 148
- Dank erhalten: 55
xPhcLog, log events on the PHC module bus
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
xPhcLog can use an RS232-to-USB convertor, an RS232-to-IP or RS485-to-IP module connected to your module bus.
The RS232-to-IP/RS485-to-IP modules should be set up to send UDP packets to your Raspi's IP address and port on which xPhcLog is listening. Make sure it sends each byte without any delays or buffering.
When using an RS232-to-IP convertor, connect it's ground input to the PHC module bus 'A' wire, and it's RX input to the PHC module bus 'B' wire.
Run "./xphclog.raspi -?" to get help on using this tool.
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
Enhanced mode could be used to extract realtime module status and feed it into OpenHAB.
Attached zip file includes a sample ini-file + Windows (xphclog.exe) and Raspi (xphclog.raspi) versions.
./xphclog.raspi -? gives you help info, the sample ini-file contains even some more info.
Take a look at the --modules option to specify the modules in your system, that way you get correct logging.
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
Would it be helpful if xphclog could publish the actual status of inputs/outputs to a broker. OpenHab can then use this information with it's mqtt binding.
You can reply in German, I can read it, but writing is more difficult...
mvg, Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Andreas
-
- Offline
- Platinum Mitglied
-
- Beiträge: 274
- Dank erhalten: 56
I'm using MQTT to connect my PHCGateway (something similar to your xphclog) to OpenHAB which is working very good.
I think, MQTT is a very good mechansim for communicationg between different components of OpenHAB. The biggest advantage is that you don't need to implement a specific binding for OpenHAB.
Currently I'm working on an Arduino scetch which is collecting a lot of sensor data (temperature, barometric pressure, humidity, ...) and which is sending them via MQTT to OpenHAB.
Andreas
PHC STM V2, EMD,AMD,JRM und DIM-Module, Wind, Regen und Sonnen-Sensor, Visualisierung mit OpenHAB
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
At work we are looking at building a Wireless Sensor Network that connects to a gateway on a Raspi to collect the data and send it to openhab using MQTT... on that same Raspi. 1 colleague already gave a small demo few weeks ago, looking good, but work in progress.
What does your PHCGateway actually do and how does it interface to a PHC system?
Do you have any quick start info for making an openhab binding? that might be interesting to do.
mvg, Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- ansgar75
-
- Offline
- Premium Mitglied
-
- Stay hungry, stay foolish! - Steve Jobs
- Beiträge: 111
- Dank erhalten: 14
Thank you for distributing your tools.
Can I use a ComPort-Server and connect it to the front RS232-interface of my STM-V2 module? Or do I need to contact it like you have desribed in the first post?
I have another question about the correct setup of the last part in the 'xphclog.ini' file:
What do I need to put into line 45 exactly?
I don't really understand the syntax of this line.
Thank you
Ansgar
Peha PHC V3 seit 2017 (vorher V2 seit 2009) im Neubau - MCC - JRM - EMD - AMD - DIM - UIM - FUI - Module
IP-Symcon Smarthome Software auf Intel NUC mit Ubuntu 20.04LTS (Einbindung von PHC tlw. über Webinterface der V3)
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
1) For xPhcLog to work it must be connected to the module bus, this is RS485 and connects the modules and the STM. The RS232 port in the front of the STM is another bus called the external bus, it connects the STM to a PC. These are 2 different things.
You will need to connect your comport server to the modules bus as described.
2) About line 45 in xphclog.ini...
PHC modules are divided into classes (0...5) and each class is assigned a range of module addresses, class 0=0-31, class 1=32-63, class 2=64-95, etc... Per class, multiple module types are allowed, for example class 2 has module types omd and jrm.
Module types of the same class may send packets in different formats. And sometimes multiple module types of the same class send the same format. So it becomes difficult for xPhcLog to determine exactly what is being sent across the module bus, some help is needed.
Therefor xPhcLog has a list that maps the module address to a module type, so it knows how to decode a message to/from that module. Per class there is a default module type which is used if you don't specify line 45.
If your PHC system has different module types installed, then you need to specify this in line 45.
Example: you have 4 output modules (omd.0-3) and 2 jrm modules (jrm.4-5), then a line with: 'modules=jrm.4;jrm.5' is enough, since the default module type for class 2=omd
So the rule is simple: if you have modules installed that are different from the default per class, then specify these in line 45.
regards, Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- ansgar75
-
- Offline
- Premium Mitglied
-
- Stay hungry, stay foolish! - Steve Jobs
- Beiträge: 111
- Dank erhalten: 14
thank you very much.
I was a little bit confused :blink:. But now I think that's clear

Ansgar
Peha PHC V3 seit 2017 (vorher V2 seit 2009) im Neubau - MCC - JRM - EMD - AMD - DIM - UIM - FUI - Module
IP-Symcon Smarthome Software auf Intel NUC mit Ubuntu 20.04LTS (Einbindung von PHC tlw. über Webinterface der V3)
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
Here is the latest version 4.0.0.4 of xPhcLogd, in the zip file included are: Windows version (xphclogd.exe), Linux x86 version (xphclogd.x86) and Raspi version (xphclogd.raspi).
What is new?
- small fixes in the decoding due to additional tests (thx P.)
- enhanced logging mode
- optional reporting to MQTT broker
- use of ini file supported
- separate logging files
-> application: xphclogd_yyyymmdd_hhmmss.log
-> modulebus reporting: xphclogd_report_yyyymmdd_hhmmss.log
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- piet
- Offline
- Junior Mitglied
-
- Beiträge: 13
- Dank erhalten: 2
thanks a lot for the updated version of xPHCLog

Piet
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- haribo
- Offline
- Senior Mitglied
-
- Beiträge: 68
- Dank erhalten: 12
it would be grateful to get some help to get xPhcLog work.
I did the following:
- I connected an USB2RS232-Converter to the control module as described in your sample ini file: serial port ground (Pin5) to +A and RX (Pin2) to -B
Code:root@raspberrypi:/home/pi/xphclog# lsusb Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port root@raspberrypi:/home/pi/xphclog# ls -l /dev/ttyUSB0 crw-rw---T 1 root dialout 188, 0 Nov 29 19:43 /dev/ttyUSB0
- I startet xphclog.raspi --ini xphclog.ini
- I did a tail -f on the log file xphclog_xx.log
- I toggled some lights
- All I see is the following: 2016-11-29,19:32:24,001C0000,CApp::InitLogging,xPhcLog (Linux/RbPI), v1.0.5.3, Aug 17 2015, Jo Simons (c) 2007-2015
This is my ini file:
I varied a lot with tho modules param and i switched Pins 2/3 of the serial connection several times.
Nothing happens.
Have I connected the right bus?
Is it right to use an RS232-converter (instead of a RS485 one)?
What else could went wrong?
Thanks a lot for your help.
Regards Harald
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
I would like you to do this:
1) upgrade to version 4.0.0.4 attached here. Just unzip the zip file to a temp directory and copy xphclogd.raspi to the directory you are using now. Give xphclogd.raspi execute rights (chmod +x xphclogd.raspi)
2) start xphclogd with an extra parm --loglevel 0xFFFFFFFF
Send me the logfile
regards, Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- haribo
- Offline
- Senior Mitglied
-
- Beiträge: 68
- Dank erhalten: 12
thanks a lot for your support.
I followed your instructions:
After starting xphclogd I toggled a lot of lights in order to create traffic
on the module bus. But there is nothing indicating traffic in the log file.
Obviously there is no traffic or I'm not able to catch it.
I did the following:
- I separated the proper working USB2RS232-Converter-based serial connection from the RPI to the RS232-Port of the control module
- I plugged the DSUB9-Connector into a DSUB9 female connector with two wires
(Pin2 RX and Pin5 GND), that are connected to the RS485-Connector of the
control module (Pin2->B, Pin5->A) - in addition I tested with Pin3->B, Pin5-A (NULL-MODEM?)
Any idea?
I won't give up

Regards, Harald
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
I don't see any port being opened...
You need to start xphclogd as follows:
xphclog.raspi --ini xphclog.ini --loglevel 0xFFFFFFFF
This will show us more
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- haribo
- Offline
- Senior Mitglied
-
- Beiträge: 68
- Dank erhalten: 12
I just realized that my attachments were not present (due to the file extention .log).
I renamed them to .txt and attached them right now (see my previous post).
This should show you more.
Regards, Harald
Bitte Anmelden oder Registrieren um der Konversation beizutreten.