Octave cloud GUI - how to add two or more devices to /io/config

I can’t find a JSON description for /io/config

For example - I’d like to add UART1 to my current /io/config path

    {
    "devs": [
        {
        "conf": [
            {
                "drv": "push-pull",
                "edge": "none",
                "name": "EXP_GPIO1",
                "pull": "down",
                "res": "EXP_GPIO1",
                "type": "DO"
            }
        ],
        "type": "basic"
        }
    ]}

The UART configuration I’d like to add to the above /io/config JSON

    {
   "devs":[
      {
         "conf":[
            {
               "baud":"9600",
               "bits":"8",
               "flow":"N",
               "own":"usp",
               "pair":"N",
               "std":"232",
               "stop":"1",
               "type":"UART1",
               "wire":"2"
            }
         ],
         "type":"serial"
      }
   ]}

How do I combine the two “devs” ?

Hi John,

As far as I know, we haven’t published the schema for /io/config and the structure may even be updated in the future. If USP is not showing up as an option in the UI under the Services menu, you can setup ORP and modify the result under Resources -> /io/config:

Here is an example:

{
  "devs": [
    {
      "conf": [
        {
          "baud": "9600",
          "bits": 8,
          "flow": "N",
          "own": "usp",
          "pair": "N",
          "routing": "IOT0",
          "std": "232",
          "stop": "1",
          "type": "UART1",
          "wire": "2"
        }
      ],
      "type": "serial"
    },
    {
      "conf": [
        {
          "drv": "push-pull",
          "edge": "none",
          "name": "EXP_GPIO1",
          "pull": "down",
          "res": "EXP_GPIO1",
          "type": "DO"
        }
      ],
      "type": "basic"
    }
  ]
}

Here is the top-level schema, as it is now. Please don’t count on this never changing:

{
  "devs": [               // Array of devices by type
    {                     // Configurations for all serial devices
      "type": "serial"
      "conf": [           // Array of serial device configurations
          {               // Serial device 1
            ...
          },
          ...
          {               // Serial device N
            ...
          }
        ],
      },
      {                   // Configurations for all GPIO and ADCs
        "type": "basic"
        "conf": [         // Array of GPIO and ADC configurations
          {               // GPIO/ADC 1
            ...
          },
          ...
          {               // GPIO/ADC M
            ...
          }
        ],
      },
    ]
 }
1 Like