SSH command from CoDeSys


is there an existing library to execute SSH-commands from CS runtime software?
I’d like to reboot a Linux host from the Wago PLC.

I don’t think so. But you could create a script in order to do that, place it in /etc/config-tools folder, make it executable (chmod +x) and then call the script using WagoAppConfigtool library

1 Like

FbSetSshConfig and FbGetSshConfig are apparently the same libraries?
I don’t see the command being called, let’s say asking for the temperature “vcgencmd measure_temp”?

there are 2 ways to call linux commands.

WagoAppConfigTool works smart, because it creates sub task in the background and monitor PID if it is done, so it doesn’t block runtime. In this library you can call ./start_reboot script to reboot controller.

Second possibility is to use codesys SysProcess library (function SysProcessExecuteCommand2 in sublibrary SysProcess Implementation). This way you can call directly you command. But be aware, that it creates subprocess from called task, so the task stops untill it returns value. so this way is better to call from separate task with lowest priority.

1 Like