I want to automate the launch of the lora packet forwarder.
Do you know how I can do ?
I use the pkt fwd of semtech : https://github.com/Lora-net/packet_forwarder
And I must manually start them with :
cd /root/packet_forwarder/lora_pkt_fwd/
./lora_pkt_fwd
All is working from the node to my database, juste need to autostart the pkt fwd.
Sorry, I’m on Raspberrypi (raspbian / debian).
I found it’s possible to use systemctl to make a service but it seem to not working. Probably I’m wrong somewhere…
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/home/pi/packet_forwarder/lora_pkt_fwd/lora_pkt_fwd &
exit 0
Thanks for the example, it works !
I just need to understand how I can execute a script if the service fail to start. Sometime I need to execute a script which reset the LoRa module, if don’t do this, service can’t start…
EDIT : I just see on your github they have a start script which take care about this reset pin. Haven’t this on the repo I used. I will look this way.