Start cayenne-ser.sh on boot


#1
  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

     [Unit]
     Description=Connect to Cayenne
     Requires=network-online.target
     After=network.target network-online.target
    
     [Service]
     ExecStart=/home/pi/cayenne/Cayenne-MQTT-Arduino/extras/scripts/cayenne-ser.sh -c /dev/
    

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


Running Cayenne-ser.sh Script on Pi Boot
#2

Thanks for sharing this @adam.


#3

Thanks for all the work you did on this @adam