Page 1 of 1

modbus + autostart

Posted: 06 Sep 2019, 12:41
by bartandras
Hi,

I am considering using revpi for the next project. I need to communicate with 3 modbus slave units and one modbus master unit with tcp. I need to calculate values for the master from the slave values. Is a core or core3 good for this?

Also I have found info about the virtual devices, etc., how to write code, etc. But how can I autostart my program after booting in?

Thanks.
Best,
András

Re: modbus + autostart

Posted: 12 Sep 2019, 16:39
by dirk
Hi András, yes you can use a RevPi Core 3 module for your project. If you need a Hardware Watchdog then you have to use a Connect Module.
Have a look at the Tutorials for ModbusTCP Master and ModbusTCP Slave.
You may use Python3 with RevPiModIO2 library which works like a charm. There is much example code online i.e. Here.
A quick and easy way to autostart your program is to put one line into "/etc/rc.local". I.e. "python3 /path/to/myprogram"
The pros do this with "systemd".