Architecture
Hardware Architecture
Hardware architecture diagram
The following diagram gives the hardware architecture required to setup LimeNurse.
Bill of materials
Trials and errors led to the following bill of materials, the list of parts on which LimeNurse has been successfully deployed. Some other configurations may also be compatible, so each part has a justification of why it was chosen, so that users can consider other options with a discerning eye.
Name |
Identification |
Image |
Justification |
|---|---|---|---|
SKU 784181 |
|
Supports USB gadget and provide an ethernet port on top of the USB C and USB A ones. |
|
ASIN B0CB3M46Y5 |
|
Not critical - Provides limelight power from an external source |
|
SKU 103677 |
|
One of the few USB splitter handling the 15W / 5V power from Pi official power supply |
|
SKU SC0623 |
|
Provide maximal power to Pi. Considered first to power both Pi and Limelight, but was not enough. Maybe not necessary for Pi alone |
|
|
Link the limelight on robot to the development stand while providing enough length for the robot to move |
||
|
Link the control hub on robot to the development stand while providing enough length for the robot to move |
Internal Communications Architecture
The following table shows the operational interfaces provided by LimeNurse
Source |
Connection |
Destination |
Comments |
|||||||
|---|---|---|---|---|---|---|---|---|---|---|
Component |
Interface |
Port |
Name |
Protocol |
Data |
Component |
Interface |
Port |
Name |
|
Developer laptop |
Ethernet |
udp |
Name resolution exchanges |
Raspberry PI |
Ethernet (eth0) |
53, 67, 68, 5353 |
Avahi name resolution exchanges |
|||
Developer laptop |
Ethernet |
http |
limelight web client |
Raspberry PI |
Ethernet (eth0) |
5801 |
limelight.eth.local |
Web client tuning and debug access |
||
Developer laptop |
Ethernet |
http + websockets |
limelight video streams |
Raspberry PI |
Ethernet (eth0) |
5802, 5800, … |
limelight.eth.local |
Video stream display |
||
Developer laptop |
Ethernet |
ssh |
Pi commands |
Raspberry PI |
Ethernet (eth0) |
22 |
limelight.eth.local |
Raspberry Pi debug access |
||
Control hub |
USB A |
http + websocket |
limelight rest API requests and responses |
Raspberry PI |
USB C |
5807, 5806 |
limelight.local |
Limelight vision result http access |
||
Raspberry Pi |
USB C (eth1) |
http |
limelight web client |
Limelight |
USB C |
5801 |
limelight.local |
Web client |
||
Raspberry Pi |
USB C (eth1) |
http + websockets |
limelight video streams |
Limelight |
USB C |
5802, 5800, … |
limelight.local |
Video stream display |
||
Raspberry Pi |
USB C (eth1) |
http + websocket |
limelight rest API requests and responses |
Raspberry PI |
USB C |
5807, 5806 |
limelight.local |
Limelight vision result http access |
The following table shows the interfaces provided by LimeNurse for deployment testing purpose
Source |
Connection |
Destination |
Comments |
|||||||
|---|---|---|---|---|---|---|---|---|---|---|
Component |
Interface |
Port |
Name |
Protocol |
Data |
Component |
Interface |
Port |
Name |
|
Developer laptop |
USB A |
udp |
Name resolution exchanges |
Raspberry PI |
USB C (usb0) |
53, 67, 68, 5353 |
Avahi name resolution exchanges |
|||
Developer laptop |
Ethernet |
http |
limelight web client |
Raspberry PI |
USB C (usb0) |
5801 |
limelight.local |
Web client tuning and debug access |
||
Developer laptop |
USB A |
http + websockets |
limelight video streams |
Raspberry PI |
USB C (usb0) |
5802, 5800, … |
limelight.local |
Video stream display |
||
Developer laptop |
USB A |
UDP |
broadcast LLPhoneHome |
Raspberry PI |
USB C (usb0) |
5809 |
limelight.local |
Limelight discovery |
||
Developer laptop |
Ethernet |
UDP |
broadcast LLPhoneHome |
Raspberry PI |
Ethernet (eth0) |
5809 |
limelight.eth.local |
Limelight discovery |
||
Developer laptop |
USB A |
http + websocket |
limelight rest API requests and responses |
Raspberry PI |
USB C (usb0) |
5807, 5806 |
limelight.local |
Limelight vision result http access |
||
Developer laptop |
Ethernet |
http + websocket |
limelight rest API requests and responses |
Raspberry PI |
Ethernet (eth0) |
5807, 5806 |
limelight.eth.local |
Limelight vision result http access |
Software Architecture
LimeNurse relies on standard linux services. It uses systemd services to ensure robustness and persistence of the deployment
Data Link Layer (2) configuration
USB gadget drivers are activated in the Pi OS to enable ethernet over USB on usb0. This is a once shot firmware configuration, persisted by the firmware persistence mechanisms.
Then the USB descriptors are configurated to mock the limelight ones and make it discoverable by the Control Hub. Descriptors setting is managed by a systemd service restarted on Pi start.
Network Layer (3) configuration
IP management services is deployed on both ethernet and USB interfaces. Ethernet and USB gateways are assigned fixed IP. IP setting is managed by a systemd service restarted on Pi start. Ethernet and USB interfaces expose a DHCP service to provide communcations with development laptop and control hub through an IP in their hosted networks. This is a once shot dnsmasq service configuration, persisted by the dnsmasq persistence mechanisms.
Gateways are assigned names. This is managed by a zeroconf based python script. The python script regularly update the dns services to make sure the name keep being resolved. The resolver script is managed by a systemd service restarted on Pi start.
Transport Layer (4) configuration
UDP and TCP unicast forwarding between interfaces are managed using firewall rules. Port 22 on eth 0 is not forwarded to provide ssh services The rules setting script is managed by a systemd service restarted on Pi start.
UDP messages are broadcasted to enable limelight discovery. They are not forwarded by iptables and are then managed by a custom Python script. The python script is robust to interface loss through limelight disconnection. It monitors interface and restore connection and transfer once the interface is back. The forwarder script is managed by a systemd service restarted on Pi start.