Hi All
I am trying to set up a Raspi (Zero 2 W) to autostart a 4G modem. This is for a headless stand-alone application, with only a 4G connection, so I need it to autostart reliably at power-up.
Google suggests a systemd service is the way to go, I have tried setting it up, but cannot get it to work.
So far I have been using a Pimoroni Clipper 4G HAT (SIMCom A7683E), and am also trying a Waveshare SIM7600G-H 4G USB Dongle.
I have the 4G modem working, and it connects using PPP, using the following file
/etc/ppp/peers/clipper
#user “myusername@realm” (not needed according to Pimoroni)
connect “/usr/sbin/chat -v -f /etc/chatscripts/gprs -T giffgaff.com”
/dev/ttyS0
115200
noipdefault
usepeerdns
defaultroute
persist
noauth
nocrtscts
local
I can run this using sudo pon clipper and it connects, ifconfig shows a ppp0 connection, and I can ping the world via ppp0, all good so far. Ditto with sudo pppd call clipper &
Now for the systemd stuff:-
sudo nano /etc/systemd/system/ppp@clipper.service
[Unit]
Description=PPP connection to %i
After=network.target
[Service]
Type=simple
ExecStartPre=/bin/sleep 60
ExecStart=/usr/sbin/pppd call %i
Restart=always
[Install]
WantedBy=multi-user.target
(note the 60 second pre is to allow the modem etc to boot before bringing up PPP)
sudo systemctl enable ppp@clipper.service
sudo systemctl start ppp@clipper.service
sudo systemctl status ppp@clipper.service
this shows it attempting to start the service, but it doesn’t connect.
Once the service has been started (and failed), I then cannot start PPP manually, either with sudo pon clipperor sudo pppd call clipper &.
If I disable the ppp@clipper.service and reboot, I can then start PPP manually.
Am I doing this right? Any suggestions on how to diagnose it?
I am not a linux wizz, so please treat me gently. I get the basics, but am not skilled at debugging, any tips gratefully received.
Note I am SSHing over wifi to debug this, and have also tried connecting a display & keyboard direct. The Raspi is running the latest vanilla raspberry pi OS Lite (64 bit), installed using the raspi imager app, and then updated.
Many thanks, Ben