This Python Script Daemon do the below stuff:
- Check the communication 3G
- Check and Control the Status modem
- Check the status application
- Check the status info and create a json file
- Managed Wi-Fi communication
The Documentation of each class it's inside of them The Daemon generetae the following files:
- servicecom.log
- sysinfo.json
You need first edit config.json and set the following items for the communication 3g
- APN
- user
- password
and will you need set the program to at config.json for monitoring with the full path.
First of all copy the files config.json and servicecom.py to /home/pi directory
then you will need add the time scan to daemon in the config.json
- in servicecom there: servicecom.py and config.json
- in src there: all files needed
/home/pi $
├─── servicecom
│ └─── config.json Demo.py loadcellcmd.json loadcell.json networks.json README.md scanwifi.py servicecom.py setup.py simstatus.json
You will need the follows tools:
sudo apt-get update
sudo apt-get install git
Then
sudo git clone https://github.com/arturoar3nas/raspberry-python && mv /home/pi/raspberry-python /home/pi/servicecom
Finally
sudo python3 servicecom/setup.py
If all it's fine, go to usage and enjoy!
Copy in the below directory:
/home/pi/
The next Files:
- setup.py
- servicecom.py
- config.json
- Demo.py
- loadcellcmd.json
- loadcell.json
- networks.json
- scanwifi.py
- simstatus.json
Then you will need do:
sudo python3 setup.py
Make sure to use the command with sudo. Wait to the installer and later go to the Usage step.
Servicecom requires Python v3+ to run.
sudo apt-get install python3
sudo apt install python3-gpiozero
sudo apt install python3-psutil
Servicecom requires Sakis3G.
Install the dependencies and Dependencies and start the modem.
sudo apt-get update
sudo apt-get install ppp
wget "http://raspberry-at-home.com/files/sakis3g.tar.gz"
sudo mkdir /usr/bin/modem3g
sudo chmod 777 /usr/bin/modem3g
sudo cp sakis3g.tar.gz /usr/bin/modem3g
cd /usr/bin/modem3g
sudo tar -zxvf sakis3g.tar.gz
sudo chmod +x sakis3g
sudo ./sakis3g connect
Execute the below commands:
python3 servicecom.py start
python3 servicecom.py restart
python3 servicecom.py stop
For view the process use:
sudo ps -A | grep servicecom.py
and you will see python3 process running
For view the log on real time use:
tail -f /tmp/servicecom.log