Created
June 10, 2020 04:05
-
-
Save futureshocked/26950e86f69edaadc1c8ecd14bff2e3c to your computer and use it in GitHub Desktop.
rf24_receiver.service with Twilio code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Start the rf24 listener script as a service at startup | |
| # Copy this file into /etc/systemd/system as root, for example: | |
| # sudo cp myscript.service /etc/systemd/system/rf24_receiver.service | |
| # Once this has been copied, you can attempt to start the service using the following command: | |
| # sudo systemctl start rf24_receiver.service | |
| # Stop it using following command: | |
| # sudo systemctl stop rf24_receiver.service | |
| # When you are happy that this starts and stops your app, you can have it start automatically on reboot by using this command: | |
| # sudo systemctl enable rf24_receiver.service | |
| # | |
| #The Twilio code in this script was written by Billy Hare as an extension of the Raspberry Pi Full Stack project. | |
| # With this extension, your Raspberry Pu Full Stack application will be capable | |
| # of sending and receiving text messages via the Twilio service. | |
| # More information: https://techexplorations.com/so/rpifs/ | |
| [Unit] | |
| Description=RF22 Receiver Service | |
| After=syslog.target | |
| [Service] | |
| ExecStart=/var/www/lab_app/bin/python /var/www/lab_app/rf24_receiver.py | |
| WorkingDirectory=/var/www/lab_app/ | |
| StandardOutput=inherit | |
| StandardError=inherit | |
| Restart=always | |
| User=root | |
| Environment="TWILIO_ACCOUNT_SID=<your Twilio account SID>" | |
| Environment="TWILIO_AUTH_TOKEN=<your Twilio auth token>" | |
| Environment="TWILIO_PHONE_NUMBER=<your Twilio phone number>” | |
| Environment="MY_PHONE_NUMBER=<your personal mobile phone number" | |
| [Install] | |
| WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment