Driver for Adafruit GSM FONA module
Posted: Thu Jan 22, 2015 12:43 pm
This topic is to discuss development of a uPy driver for the Adafruit FONA module, using the SIM800L GSM chip. See http://www.adafruit.com/products/1963.
I have managed so far to send an SMS from the pyboard using this module. Here are some notes how to do it:
1. Insert SIM card, connect charged Lipo battery. Note: the battery can be charged over USB using the provided micro USB port, but it draws about 500mA so needs a dedicated USB port.
2. Connections from FONA to pyboard: GND to GND, Vio to 3V3, RX to X1, TX to X2 (or you can use a different UART bus on the pyboard, here we use UART(4)).
3. Get a uPy REPL prompt.
4. Make UART object:
ua = pyb.UART(4, 115200, timeout_char=1, read_buf_len=1000)
5. Check that everything works by sending ATI command:
ua.write('ATI\r\n')
ua.read(100)
--> you should get a string saying the version number
6. Check that you're connected to a network:
ua.write('AT+COPS?\r\n')
ua.read(100)
--> you should get a string with the network name
7. Send an SMS:
ua.write('AT+CMGS="+447xxxxxxxxx"\r\nHello from pyboard!\x1a')
ua.read(100)
--> this will send the message "Hello from pyboard"! to the given cell number. The "\x1a" is ctrl-Z and signals end of message.
I have managed so far to send an SMS from the pyboard using this module. Here are some notes how to do it:
1. Insert SIM card, connect charged Lipo battery. Note: the battery can be charged over USB using the provided micro USB port, but it draws about 500mA so needs a dedicated USB port.
2. Connections from FONA to pyboard: GND to GND, Vio to 3V3, RX to X1, TX to X2 (or you can use a different UART bus on the pyboard, here we use UART(4)).
3. Get a uPy REPL prompt.
4. Make UART object:
ua = pyb.UART(4, 115200, timeout_char=1, read_buf_len=1000)
5. Check that everything works by sending ATI command:
ua.write('ATI\r\n')
ua.read(100)
--> you should get a string saying the version number
6. Check that you're connected to a network:
ua.write('AT+COPS?\r\n')
ua.read(100)
--> you should get a string with the network name
7. Send an SMS:
ua.write('AT+CMGS="+447xxxxxxxxx"\r\nHello from pyboard!\x1a')
ua.read(100)
--> this will send the message "Hello from pyboard"! to the given cell number. The "\x1a" is ctrl-Z and signals end of message.