Configuring mobile connectivity
Setting up & running Sakis3G
-
Update and upgrade:
sudo apt-get update & sudo apt-get upgrade
-
Installing dependencies and- Sakis3g client:
sudo apt-get install ppp
wget "http://raspberry-at-home.com/files/sakis3g.tar.gz"
sudo mkdir /usr/bin/modem3g
sudo chmod +x /usr/bin/modem3g
sudo cp sakis3g.tar.gz /usr/bin/modem3g
cd /usr/bin/modem3g -
Run the client interactively:
sudo /usr/bin/modem3g/sakis3g connect --interactive
-
Get default settings for your modem:
lsusb
-
Paste default settings in a file:
sudo nano /etc/sakis3g.conf
Config file example:
USBDRIVER="option"
USBINTERFACE="0"
APN="internet"
MODEM="12d1:155e"
Running as service script:
- Make two service files:
sudo nano /etc/systemd/system/modem-connection.service
sudo nano /etc/systemd/system/ChargePi.service
- Paste into modem-connection.service file:
[Unit]
Description=Modem connection service
[Service]
Type=simple
ExecStart=/usr/bin/modem3g/sakis3g --sudo connect
Restart=on-failure
RestartSec=5
KillMode=process
[Install]
WantedBy=multi-user.target
- Paste into ChargePi.service file:
[Unit]
Description=ChargePi client
After=network.target modem-connection.service
[Service]
Type=simple
ExecStart=go build /<path_to_dir>/ChargePi-go/ && ./ChargePi-go
Restart=on-failure
KillSignal=SIGTERM
[Install]
WantedBy=multi-user.target
Go should be installed and the binary should be added to PATH variable.
Repeat next steps for both files:
- Give permissions and add services to systemd:
sudo chmod 640 /etc/systemd/system/modem-connection.service
systemctl status modem-connection.service
sudo systemctl daemon-reload
sudo systemctl enable modem-connection.service
sudo systemctl start modem-connection.service