0

With the goal of sending API Post requests over 2G from a raspberry pi based device, I set up an Adafruit FONA 808 as a tethered device by following their great tutorial.

However, with the SIM808, I should be able to access the GPS to turn on/off and get coordinates, which would be super useful! Anyone know how this can be done? I haven't really seen much on the web unfortunately, and am more of a software and hardware person!

Edit: I am attempting to communicate with the GPS using pyserial:

import serial
con = serial.Serial('/dev/ttyAMA0', baud = 115200, timeout = 10)

I believe to turn on the GPS, you send the AT command: AT+CGPSPWR

con.write(b'AT+CGPSPWR\r')

which then doesn't ever complete/freezes. Any thoughts?

2

'O' is simply how you activate thew GPS in the FONA sample Arduino sketch from Adafruit.

If you're using GPS (or any of the other FONA functions) on the Raspberry Pi, you need to handle the actual AT commands.

So to turn on the GPS you'd do something like-

send "AT+CGPSPWR?" and parse the reply to see if GPS is already on.

then send"AT+CGPSPWR=1" to turn on GPS.

After that you can poll the location with "AT+CGPSINF?"

Adafruit has documentation on the FONA 800 AT command set here- http://www.adafruit.com/datasheets/sim800_series_at_command_manual_v1.01.pdf and specifics on the GPS AT command set here - http://www.adafruit.com/datasheets/SIM808_GPS_Application_Note_V1.00.pdf

  • Thanks for the docs. Using the serial library, I still don't get it to work unfortunately (added code above). – David Hagan Jun 27 '15 at 16:16
  • The issue was I had a ppp connection open that was preventing me from accessing the serial port to send AT commands. – David Hagan Jul 7 '15 at 13:47
0

This has been a while but for anyone else needs; i have ported Arduino Adafruit sim 800 - sim808 library to linux. This is a C++ implementation unlike the nature of queation. But still may be use. It has a menu for all the commands necessary to drive the device.

I have used USB - UART interface but you can easily rewrite Serial interface library with raspi's.

You can find it at: https://bitbucket.org/ifaruk/adafruit_fona_808_linux

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.