Serial ports

In order to interact with our LoRa device, we need to connect it to our laptop. This involves a process of the device registering itself but this registration can change over time. We need to configure our system to stabilise this registration. This is done by assigning a fixed filesystem path for the serial port based the unique identifier of the LoRa device.

We need to give our own system user permissions to pole the serial ports (the interface which you use to communicate from your laptop to the LoRa device).

sudo usermod -aG dialout $USER
sudo reboot

We need to see the LoRa device when it connects to identify it.

sudo dmesg -w

Plug the LoRa device in and out with your USB cable. You should see a ttyXXXX value in the logs. This gives you the /dev/ttyXXXX path. This value can change when the device is plugged in, so we prefer to map a stable path based on the devices serial number (which is unique).

udevadm info -a -n /dev/ttyXXXX | grep ATTRS{serial}
sudo $EDITOR /etc/udev/rules.d/99-rnodes.rules

And then put the following in /etc/udev/rules.d/99-rnodes.rules.

SUBSYSTEM=="tty", ATTRS{serial}=="<SERIALNUMBER>", SYMLINK+="rnode_XXXX"

Then reload udev and confirm the stable path is configured.

sudo udevadm control --reload-rules
sudo udevadm trigger
rnodeconf --info /dev/rnode_XXXX