-
Notifications
You must be signed in to change notification settings - Fork 4
Raspberry Pi
The Raspberry Pi is an excellent target for running long-running LX installation without needing a full desktop or laptop machine to be permanently installed and maintained.
To run headless, it is recommended to develop your project using the LXStudio-IDE project template. The main(String[] args)
method of the LXStudioApp
class includes parameters to take a --headless
command-line flag. If this flag is passed with a subsequent argument providing a path to a valid .lxp
project file, the file will be loaded and run with no UI, using all of the options previously saved in the project file.
If you are operating on a network where it is possible that some of your ethernet cables or LED controllers may be sporadically be unavailable, it should be noted that some of the default network settings on Raspberry Pi may result in high latency if output queues become saturated due to ARP lookup failures, interfering even with packets being sent to valid addresses. This behavior is noticeably different from that of desktop MacOS/Windows, both of which tolerate a stream of UDP packets to unresolvable addresses more gracefully.
You may wish to edit the following kernel parameters to change these settings persistently.
As the root
user or via sudo
, edit the file /etc/sysconf.d/local.conf
. You may need to create this file if it does not already exist. If running on Stretch, this file may instead be found at /etc/sysctl.conf
.
Add or edit the following line, which will set the maximum number of bytes that will be queued with unresolved destination addresses:
net.ipv4.neigh.eth0.unres_qlen_bytes = 4096
This applies the setting to the ethernet interface. You may eth0
with the desired network interface.
To affect all interfaces
net.ipv4.neigh.default.unres_qlen_bytes = 4096
Note that this may be less optimal for a higher-latency interface like WiFi, but could be useful if using an USB ethernet adapter, for example.
To validate after boot these have taken effect:
cat /proc/sys/net/ipv4/neigh/eth0/unres_qlen
cat /proc/sys/net/ipv4/neigh/eth0/unres_qlen_bytes
The first command should print a low number like 2
. The second command should show 4096
.
These lower values prevent a large number of packets (e.g. streaming ArtNet data) being sent to an unresolvable address from saturating the operating system's output buffers. However, note that this may also mean that when an IP address change happens, or when a lot of TCP connections are attempted in parallel to a machine on the same physical network, packets will be dropped until the ARP exchange happens.
More detailed documentation on these parameters is available at: https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
Many thanks to Brian Bulkowski for diagnosing these issues with the default Raspberry Pi configuration and researching this solution.
© 2020 LX Studio — Heron Arts LLC