diff --git a/foxbuntu/project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-ubuntu/etc/rc.local b/foxbuntu/project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-ubuntu/etc/rc.local index e46130f..ee67b13 100755 --- a/foxbuntu/project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-ubuntu/etc/rc.local +++ b/foxbuntu/project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-ubuntu/etc/rc.local @@ -20,6 +20,16 @@ echo 'ds1307 0x68' | sudo tee /sys/class/i2c-adapter/i2c-3/new_device > /dev/nul # activating USER LED echo 34 > /sys/class/gpio/export && echo out > /sys/class/gpio/gpio34/direction & +#run once to set meshtastic nodeid to derivative of CPU serial number (unique to this board). Check at boot in case of upgrade overwriting this. +if ! grep -q "^ExecStart=.*--hwid" /usr/lib/systemd/system/meshtasticd.service; then + cp /root/.portduino/default/prefs/config.proto /tmp/config.proto.bak + sed -i "/^ExecStart=/ s:$: --hwid $((0x$(awk '/Serial/ {print $3}' /proc/cpuinfo) & 0xFFFFFFFF)):" /usr/lib/systemd/system/meshtasticd.service + echo "Using Luckfox CPU S/N to generate nodeid for Meshtastic." + systemctl daemon-reload + systemctl enable meshtasticd + systemctl start meshtasticd +fi + ( if ip addr show wlan0 | grep -q 'inet '; then echo "Wifi (wlan0) is online."; @@ -69,16 +79,6 @@ fi # run USB automount and config tool /usr/local/bin/usbconfig.sh -#run once to set meshtastic nodeid to derivative of CPU serial number (unique to this board). Check at boot in case of upgrade overwriting this. -if ! grep -q "^ExecStart=.*--hwid" /usr/lib/systemd/system/meshtasticd.service; then - cp /root/.portduino/default/prefs/config.proto /tmp/config.proto.bak - sed -i "/^ExecStart=/ s:$: -e --hwid $((0x$(awk '/Serial/ {print $3}' /proc/cpuinfo) & 0xFFFFFFFF)):" /usr/lib/systemd/system/meshtasticd.service - echo "Using Luckfox CPU S/N to generate nodeid for Meshtastic." - systemctl daemon-reload - systemctl enable meshtasticd - systemctl start meshtasticd -fi - # boot complete ( echo "Disabling ACT LED..."