FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
447 views 3 comments
by anonymous
Hello,
I need to control I/O pins in RUT955 via JSON-RPC. I logged into router and received token. I also seen some uci, ubus command for SSH connection. But I can't build proper json command for JSON-RPC communication. I would really appreciate help.

Regards Konrad

1 Answer

+1 vote
by anonymous

Hello,

Below are some of the bodies to manipulate RUT955 inputs/outputs:

  • Open relay:

{

    "jsonrpc":"2.0", "id":1, "method":"call", "params":

    [

        "b86d91d8591fb5e5de7a5e11dad51a2a", "ioman.relay.relay0", "update",

        {

           "state":"open"

        }

    ]

}

  • Check state of 4pin digital input:

{

    "jsonrpc":"2.0", "id":1, "method":"call", "params":

    [

        "b86d91d8591fb5e5de7a5e11dad51a2a", "ioman.gpio.din1", "status",

        {

        }

    ]

}

  • Invert 4pin digital input 

{

    "jsonrpc":"2.0", "id":1, "method":"call", "params":

    [

        "b86d91d8591fb5e5de7a5e11dad51a2a", "ioman.gpio.din1", "update",

        {

            "invert_input": true

        }

    ]

}

  • Change power socket output state:

{

    "jsonrpc":"2.0", "id":1, "method":"call", "params":

    [

        "b86d91d8591fb5e5de7a5e11dad51a2a", "ioman.gpio.dout1", "update",

        {

            "value": "1"

        }

    ]

}

  • Change isolated output state:

{

    "jsonrpc":"2.0", "id":1, "method":"call", "params":

    [

        "b86d91d8591fb5e5de7a5e11dad51a2a", "ioman.gpio.dout2", "update",

        {

            "value": "0"

        }

    ]

}

Best regards,

Best answer
by anonymous
Hi. What calls do I need to use for get the status of the Isolated Input and the Analog Input?

Thanks
by anonymous

Found the Table

ioman.gpio.din1    - 4PIN input
ioman.gpio.dout1   - 4PIN output
ioman.gpio.din2    - Digital input (only for passive sensors)
ioman.gpio.dout2   - Galvanically isolated open collector output
ioman.relay.relay0 - Digital relay output
ioman.gpio.iio     - Digital galvanically isolated input 
ioman.adc.adc0     - Analog input
ioman.acl.acl0     - Analog Current loop
by anonymous

You write:
"Below are some of the bodies to manipulate RUT955 inputs/outputs:

Where in the configuration are those bodies put  ?
Is that on the server side ?
 in the widget config ?
I imagine something like the on/off state  being connected to these bodies sending JSON messages which
is like a remote iplementation of "ubus call" ?