Hi. Not as I can not figure out with I2C.
Found another way to obtain data via I2C.
Performed everything according to the instructions: https://github.com/hendrychjan/valt-rpi.
Now I see in the console:
PI @ Raspberrypi: ~ $ Python3 Sensor.py
Temperature: 27.42578125 Β° C
How can I see this line from the console in Codesys?
Thanks.
I do not quite understand, the temperature is visible in the browser or not?
I launched everything as I wrote, but I did not see the result. What am I doing wrong?
Hi. Not as I can not figure out with I2C.
Found another way to obtain data via I2C.
Performed everything according to the instructions:
https://github.com/hendrychjan/valt-rpi.
Now I see in the console:
PI @ Raspberrypi: ~ $ Python3 Sensor.py
Temperature: 27.42578125 Β° C
How can I see this line from the console in Codesys?
Thanks.
You could use a udp datagram.
$ Python3 Sensor.py >/dev/udp/127.0.0.1/9187
Read datagrams on port 9187 localhost from CODESYS.
Datagram should contain "Temperature: 27.42578125 Β°C"
It require permission to write datagram.
Another solution could be modify Sensor.py to send directly a datagram.
If "27.42578125" is on a string named valueString you can add this to script:
Last edit: mondinmr 2021-10-14
Thanks, I'll try!
But when you start the script somehow you need to call automatically how to do it?
You could schedule the script. Take a look to /etc/crontab.
I do not quite understand, the temperature is visible in the browser or not?
I launched everything as I wrote, but I did not see the result. What am I doing wrong?