Livewire GPIO: Unicast and Multicast

Introduction

Livewire GPIO ports can be configured with a "channel" value. This document explains what the possible "channel" values mean, and how they can be used.

There are two possible channel specifications: "multicast" and "unicast". Multicast channel specs are just Livewire channel numbers; unicast channels are formatted as "<ip address>/<port>". The two methods function very differently, and this document explains how.

Unicast GPIO

If you configure a GPIO port with a channel in the format "<ip address>/<port>" (e.g. "10.1.14.54/4") then that is using unicast GPIO. The configured unit will reach out to a remote unit at "<ip address>", fetches the pin states of the given GPI port of the remote unit, and then sets the configured port's GPO pins to that state.

For example, consider the following system:

  1. GPIO xNode unit A is at IP address 10.5.8.23

  2. GPIO xNode unit B is at IP address 10.5.8.24

  3. Unit A's GPIO port 2's channel is set to "10.5.8.24/3"

In this configuration, unit A's port 2 GPOs will automatically track unit B's port 3 GPIs.

If you want the communication to be bidirectional, then you'll need to configure GPIO unit B's GPIO port 3's channel to be "10.5.8.23/2". Then, any change on unit A's port 2 inputs will be reflected on unit B's port 3 outputs, and vice versa

Tech note: this is implemented by unit A establishing a TCP connection to unit B's LWRP server on port 93. Unit A then subscribes to unit B's port 3 GPIs; whenever it gets a report of a state change it will change its port 2 GPOs to match.

Multicast GPIO

If you configure a GPIO port with a Livewire channel number (e.g. "12003"), then that is using multicast GPIO. Multicast GPIO is used to establish a connection between an "end point" (e.g. an xNode or a PDM II) and a "console", where the end point's GPIs trigger events on the console, and the console can control the GPOs of the end point.

The key to understanding this is that there are two types of GPIO multicast messages. One type is always sent by end points and received by consoles; the other type is always sent by consoles and received by end points. This means there is no way to connect two endpoints using multicast GPIO.

Benefit of this scheme; the channel number chosen can match a Livewire audio channel (e.g. a mic input on a mic xNode). Then, when a console configures itself to listen to that mic input audio, it will automatically start controlling the associated GPO pins and monitoring the associated GPI pins. If a different console starts using that same mic, then that console will take over control/monitoring of the mic xNode's GPO/GPI pins.

For example, consider the following system:

  1. TODO

  2. TODO

  3. TODO

Tech note: this is implemented with two types of UDP packets, sent to two different ports on multicast address 239.192.255.4. Whenever an end point's configured GPI changes, it will send an INDI message to port 2055; these are received and acted on by consoles. Whenever a console wants to change something, it will send an WRNI message to port 2060. These are received and acted on by end points.