GPIO Configurations Tutorial

RFID API3 GPIO Configurations Tutorial

The GPI (General Purpose Input) in RFID API-3 is used for the below functionalities.

  • getNumGPIPorts,

  • enablePort,

  • isPortEnabled

  • getPortState

Same can be used in Zebra IoT Connector.

We can use Operating Modes to Enable and set the GPI.

GPI Configuration
{
    "command": "set_mode",
    "command_id": "16266718797272556",
    "payload": {
        "type": "PORTAL",
        "startTrigger": {
            "port": 1,
            "signal": "HIGH"
        },
        "stopInterval": 60
    }
}

The GPO (General Purpose Output) Programming in RFID API-3 configuration can be set be in IoT Connector.

The following Code illustrate the IoT Connector set_config REST API that must be configured on the reader to set GPO 1 whenever Radio starts and stops.

GPO Configuration
{
    "command": "set_config",
    "command_id": "16266718797272556",
    "payload": {
        "GPIO-LED": {
            "RADIO_START": [
                {
                    "type": "GPO",
                    "pin": 1,
                    "state": "HIGH"
                }
            ],
            "RADIO_STOP": [
                {
                    "type": "GPO",
                    "pin": 1,
                    "state": "LOW"
                }
            ]
        }
    }
}

To get the current details of GPI and GPO, we can use Heartbeat events in management Events.

GPI and GPO state
{
    "component": "RG",
    "data": {
        "radio_control": {...},
        "reader_gateway": {...},
        "system": {
            "GPI": {
                "1": "HIGH",
                "2": "HIGH",
                "3": "HIGH",
                "4": "HIGH"
            },
            "GPO": {
                "1": "LOW",
                "2": "LOW",
                "3": "LOW",
                "4": "LOW"
            },
            "cpu": {...},
            "flash": {...},
            "ntp": {...},
            "powerNegotiation": "DISABLED",
            "powerSource": "DC",
            "ram": {...},
            "systemtime": "2022-11-10T12:28:47.931+0000",
            "temperature": {...},
            "uptime": "1:30:55"
        },
        "userapps": []
    },
    "eventNum": 22,
    "timestamp": "2022-11-10T12:28:50.928+0000",
    "type": "heartbeat"
}