Scheduled http POST commands

Hello, I need to be able to do a https post every minute on the state of the inputs 3&4. I can do it when the state of the inputs change using the I/O Juggler, but I need to send a https post on the current state as well every minute.

I’m using the TRB140 and RUT300 devices.

Anyone got any ideas - do I need to use CRONTAB somehow?



There are multiple ways to achieve this.

First option would be to use Modbus. Enable modbus slave service on the device, use Modbus master to read Modbus data (PIN status) from itself, and send it to your device using data to server over HTTP. More information, including register numbers, are available here.

The other option would be to use crontabs as you have mentioned. There are examples of some other scripts on this forum, so you can look at that. However, here’s a command you can consider (adjust for your needs):

# Take status of digital input1 and POST it to
curl -X POST -d "$(ubus call ioman.gpio.din1 status)"

Kind Regards,

This topic was automatically closed after 16 days. New replies are no longer allowed.