Compare commits
2 Commits
4bc05091be
...
e82d75a4d6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e82d75a4d6 | ||
|
|
dc27e5f139 |
@@ -13,10 +13,18 @@ Script that starts at the boot of the RPI (with cron)
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
import serial
|
import serial
|
||||||
|
import RPi.GPIO as GPIO
|
||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
#GPIO
|
||||||
|
SARA_power_GPIO = 16
|
||||||
|
SARA_ON_GPIO = 20
|
||||||
|
|
||||||
|
GPIO.setmode(GPIO.BCM) # Use BCM numbering
|
||||||
|
GPIO.setup(SARA_power_GPIO, GPIO.OUT) # Set GPIO17 as an output
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
# database connection
|
# database connection
|
||||||
@@ -195,6 +203,10 @@ def read_complete_response(serial_connection, timeout=2, end_of_response_timeout
|
|||||||
try:
|
try:
|
||||||
print('<h3>Start reboot python script</h3>')
|
print('<h3>Start reboot python script</h3>')
|
||||||
|
|
||||||
|
#First we need to power on the module (if connected to mosfet via gpio16)
|
||||||
|
GPIO.output(SARA_power_GPIO, GPIO.HIGH)
|
||||||
|
time.sleep(5)
|
||||||
|
|
||||||
#check modem status
|
#check modem status
|
||||||
#Attention:
|
#Attention:
|
||||||
# SARA R4 response: Manufacturer: u-blox Model: SARA-R410M-02B
|
# SARA R4 response: Manufacturer: u-blox Model: SARA-R410M-02B
|
||||||
|
|||||||
Reference in New Issue
Block a user