Linux
This is written for debian, raspian or ubuntu. You'll have to make the usual adjustments if you're using something else.
Update your OS
First, update and upgrade your OS
sudo apt update sudo apt upgrade -y
Access to USB Serial
Add your user to the dialout group, change $USER to your user name. This allows your user to access the USB serial device.
sudo usermod -a -G dialout $USER
You'll need to logout and back in again.
Flash the companion
If you've already flashed your companion with the MeshCore firmware you can skip this step.
Make sure you flash with "Companion USB" not "Companion Bluetooth"
TODO find out how to do this on the CLI
Install needed software
Install pipx, make sure the bin dir is in the path, then install meshcore-cli
sudo apt install pipx pipx ensurepath pipx install meshcore-cli or sudo pipx install meshcore-cli --global
Logout and back in again.
Find the USB device
meshcli -l
Output probably looks like this, you'll want to use the USB one:
BLE devices: No BLE HW Serial ports: /dev/ttyS0 n/a [n/a] /dev/ttyUSB0 CP2102 USB to UART Bridge Controller - CP2102 USB to UART Bridge Controller [USB VID:PID=10C4:EA60 SER=0001 LOCATION=1-1]
Create serial based symlink
This creates /dev/meshcore0 using your devices serial number, which is much more reliable than ttyUSB0 or ttyACM0 which can change.
If you want to change to a different board, you'll have to create meshcore1 or update these values.
sudo udevadm info -a -n /dev/ttyUSB0 | vi -
Look for ATTRS{serial} and ATTRS{idVendor}:
ATTRS{idVendor}=="303a"
ATTRS{serial}=="332AC33C8CDC"
sudo vi /etc/udev/rules.d/99-meshcore.rules
put a line in similar to this:
SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", ATTRS{serial}=="332AC33C8CDC", SYMLINK+="meshcore0"
run the following:
sudo udevadm control --reload-rules sudo udevadm trigger
Start MeshCLI
meshcli -s /dev/meshcore0
Configure node
Do basic companion configuration. You should only need to do this once, unless you want to change these settings:
meshcore-cli -s /dev/meshcore0 set radio 915.800,250,11,5 meshcore-cli -s /dev/meshcore0 set name "🦷 rdm cli 0" meshcore-cli -s /dev/meshcore0 advert