Start on boot

  1. Disable IPv6.

     sudo nano /boot/cmdline.txt

    At the end of the line add ipv6.disable=1

  2. Enable networkd and networkd-wait-online services.

     sudo systemctl enable systemd-networkd.service
     sudo systemctl enable systemd-networkd-wait-online.service
  3. Create the udev rule.

     sudo nano /etc/udev/rules.d/95-cayenne_connection.rules

    Add the line

     KERNEL=="ttyACM0", ENV{SYSTEMD_WANTS}="cayenne_connection.service"

    Change KERNEL=="ttyACM0" to your serial port if needed.

  4. Create the service file

     sudo nano /etc/systemd/system/cayenne_connection.service

    Add the following

     Description=Connect to Cayenne
     ExecStart=/home/pi/cayenne/Cayenne-MQTT-Arduino/extras/scripts/ -c /dev/

    Change ExecStart=/home/pi/cayenne/Cayenne-MQTT-Arduino/extras/scripts/ to the path of your script

Running Script on Pi Boot

Thanks for sharing this @adam.


Thanks for all the work you did on this @adam