subscribe to our Youtube
14082 questions
16727 answers
27453 comments
53732 members
Hello,
On CLI,, you can enter/sbin/gpio.sh get DIN1 :)
AND cat /sys/class/hwmon/hwmon0/device/in0_input for Analog Input
Found here : https://wiki.teltonika-networks.com/view/RUT955_Input/Output#Status_and_control_from_command_line
If you want another method, maybe you can use Modbus TCP Master and Modbus Data Sender to generate Http Post request with configurable period. Define Modbus TCP Master > Slave with RUT955 IP, ID1 and register 135 for DIN1, 141 for Analog 1.
And Modbus Data Sender could send it to your application
BR
Oh wow, thank you. Somehow I missed the JSON RPC - I have never used it. Seems that it is exactly what I need. Thou there is issue with turning on the relay on the device. Perhaps there is some issue in my POST? It turns on the relay, but seems to timeout with response. I get result code 7 after it times out.
{ "jsonrpc": "2.0", "id": 1, "method": "call", "params": [ "**************************", "file", "exec", { "command":"/sbin/gpio.sh", "params": [ "set", "DOUT2" ] } ] }
{
"jsonrpc": "2.0", "id": 1, "method": "call", "params":
[
"**************************", "file", "exec",
"command":"/sbin/gpio.sh",
"params":
"set",
"DOUT2"
]
}
As described on documentation, try to replace set DOUT1 by invert.
You can turn it ON (Active (Low level)) by setting its value to 1:
[email protected]:~# gpio.sh invert DOUT1 [email protected]:~# gpio.sh get DOUT1 1
I guess the problem is that gpio.sh doesn't return any stdout when setting a value so jsonrpc waits for it?
When calling INVERT or SET on DOUT2 it waits for 10 seconds and then returns (it does trigger the relay immediately):