I’m playing around with the hologram Nova cellular USB kit and I’m trying to create an automatic connection using the /etc/rc.local file. Hologram uses it's own way of connecting to a ppp0 network connection and the way to enable or start a connection is through:
sudo hologram network connect
This command runs on the command line without any problem. However it doesn’t seem to ever run on boot up.
For those of you who aren’t familiar with the Nova Hologram you can follow this link
In order to get a ppp0 connection.
So I have tried a rc.local edit just simply adding the command and it just doesn't seem to run... I have also tried running a crontab command (same command after reboot) in order to run. However it just doesn’t seem to run at all...
After running crontab under admin priviledges:
(sudo crontab e-)
I type at the end of the file:
@reboot sudo hologram network connect
Nothing seems to happen when I reboot or power on Raspberry pi.
Anyway, any help would be greatly appreciated!
Thank you kindly
Edit: After creating the unit service for systemd, as suggested by @Ingo Here is the following log result:
Ok Here's the output from the termination error:
pi@BerryPi2:~ $ sudo systemctl status holConn.service
● holConn.service - Hologram Service
Loaded: loaded (/etc/systemd/system/holConn.service; enabled; vendor
preset: enabled)
Active: inactive (dead) since Fri 2019-07-05 00:41:26 EDT; 14s ago
Process: 1249 ExecStart=/usr/local/bin/hologram network connect
(code=exited, status=0/SUCCESS)
Main PID: 1249 (code=exited, status=0/SUCCESS)
Jul 05 00:41:20 BerryPi2 pppd[1256]: Connect: ppp0 <--> /dev/ttyACM0
Jul 05 00:41:24 BerryPi2 pppd[1256]: local IP address xx.xx.x.x # -> note I masked the real IP and DNS addresses
Jul 05 00:41:24 BerryPi2 pppd[1256]: remote IP address xx.xx.x.x
Jul 05 00:41:24 BerryPi2 pppd[1256]: primary DNS address xx.xx.xxx.xxx
Jul 05 00:41:24 BerryPi2 pppd[1256]: secondary DNS address xx.xx.xxx.xxx
Jul 05 00:41:26 BerryPi2 hologram[1249]: PPP session started
Jul 05 00:41:26 BerryPi2 pppd[1256]: Terminating on signal 15
Jul 05 00:41:26 BerryPi2 pppd[1256]: Connect time 0.1 minutes.
Jul 05 00:41:26 BerryPi2 pppd[1256]: Sent 0 bytes, received 0 bytes.
Jul 05 00:41:26 BerryPi2 pppd[1256]: Connection terminated.
2nd Edit:
After the updates to the unit file, including the oneshot and other options suggested by @Ingo, the service stays active but shows status as exited.
pi@BerryPi2:~ $ sudo systemctl status holConn.service
● holConn.service - Hologram Service
Loaded: loaded (/etc/systemd/system/holConn.service; enabled; vendor
preset: enabled)
Active: active (exited) since Fri 2019-07-05 11:55:42 EDT; 2min 19s ago
Process: 507 ExecStart=/usr/local/bin/hologram network connect
(code=exited, status=0/SUCCESS)
Main PID: 507 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/holConn.service
Jul 05 11:55:39 BerryPi2 systemd[1]: Starting Hologram Service...
Jul 05 11:55:42 BerryPi2 sudo[624]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/modprobe option
Jul 05 11:55:42 BerryPi2 sudo[624]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jul 05 11:55:42 BerryPi2 sudo[624]: pam_unix(sudo:session): session closed for user root
Jul 05 11:55:42 BerryPi2 hologram[507]: ERROR: Modem not detected
Jul 05 11:55:42 BerryPi2 systemd[1]: Started Hologram Service.
I'm guessing we have to modify the After option to wait for both network and usb modem to be recognized? is there such an option? I tried putting the idle.target because I read it was basically when the Pi is ready and everything has loaded... but I'm most likely wrong.
hologram
to connect toNova
by ppp. Can you confirm this?