Geofencing with Fona808 - Help!

Hi everyone,

I am trying to follow this project ... dafruit-io

I have assembled the board as shown and uploaded the code without any issues. However when I open the serial monitor which should provide me with GPS data, all I get is this a line of reversed question marks

Double checked everything but can't see anything obviously wrong. Any advice would be appreciated


Please post the code here after reading the topic "How to use this Forum".
I guess You need to check a line like

to match the setting in Serial monitor.
// Geo Fencing project
// Author: Marco Schwartz
// Inspired by the code from Tony DiCola
// Released under a MIT license:

// Libraries
#include <Adafruit_SleepyDog.h>
#include <SoftwareSerial.h>
#include "Adafruit_FONA.h"

// LED pin
const int ledPin = 6;

// Latitude & longitude for distance measurement
float latitude, longitude, speed_kph, heading, altitude;

// FONA pins configuration
#define FONA_RX              2   // FONA serial RX pin (pin 2 for shield).
#define FONA_TX              3   // FONA serial TX pin (pin 3 for shield).
#define FONA_RST             4   // FONA reset pin (pin 4 for shield)

// FONA instance & configuration
SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);     // FONA software serial connection.
Adafruit_FONA fona = Adafruit_FONA(FONA_RST);                 // FONA library connection.

void setup() {

  // Initialize serial output.
  Serial.println(F("Geofencing with Adafruit IO & FONA808"));

  // Initialize the FONA module
  Serial.println(F("Initializing FONA....(may take 10 seconds)"));

  if (!fona.begin(fonaSS)) {
    halt(F("Couldn't find FONA"));

  Serial.println(F("FONA is OK"));

  // Use the watchdog to simplify retry logic and make things more robust.
  // Enable this after FONA is intialized because FONA init takes about 8-9 seconds.

  // Enable GPS.


void loop() {

  // Watchdog reset at start of loop--make sure everything below takes less than 8 seconds in normal operation!

  // Grab a GPS reading.
  float latitude, longitude, speed_kph, heading, altitude;
  bool gpsFix = fona.getGPS(&latitude, &longitude, &speed_kph, &heading, &altitude);

  Serial.print("Latitude: ");
  printFloat(latitude, 5);

  Serial.print("Longitude: ");
  printFloat(longitude, 5);

  // Wait 5 secs


// Halt function called when an error occurs.  Will print an error and stop execution while
// doing a fast blink of the LED.  If the watchdog is enabled it will reset after 8 seconds.
void halt(const __FlashStringHelper *error) {
  while (1) {
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin, HIGH);

void printFloat(float value, int places) {
  // this is used to cast digits
  int digit;
  float tens = 0.1;
  int tenscount = 0;
  int i;
  float tempfloat = value;

  // make sure we round properly. this could use pow from <math.h>, but doesn't seem worth the import
  // if this rounding step isn't here, the value  54.321 prints as 54.3209

  // calculate rounding term d:   0.5/pow(10,places)
  float d = 0.5;
  if (value < 0)
    d *= -1.0;
  // divide by ten for each decimal place
  for (i = 0; i < places; i++)
    d /= 10.0;
  // this small addition, combined with truncation will round our values properly
  tempfloat +=  d;

  // first get value tens to be the large power of ten less than value
  // tenscount isn't necessary but it would be useful if you wanted to know after this how many chars the number will take

  if (value < 0)
    tempfloat *= -1.0;
  while ((tens * 10.0) <= tempfloat) {
    tens *= 10.0;
    tenscount += 1;

  // write out the negative if needed
  if (value < 0)

  if (tenscount == 0)
    Serial.print(0, DEC);

  for (i = 0; i < tenscount; i++) {
    digit = (int) (tempfloat / tens);
    Serial.print(digit, DEC);
    tempfloat = tempfloat - ((float)digit * tens);
    tens /= 10.0;

  // if no places after decimal, stop now and return
  if (places <= 0)

  // otherwise, write the point and continue on

  // now write out each decimal place by shifting digits one by one into the ones place and writing the truncated value
  for (i = 0; i < places; i++) {
    tempfloat *= 10.0;
    digit = (int) tempfloat;
    Serial.print(digit, DEC);
    // once written, subtract off that digit
    tempfloat = tempfloat - (float) digit;

Please..... First use autoformat in the IDE, mark and Ctrl c.Then click code tag, the symbol up and left.and Ctrl v.

This is one of the messages recieved, stays like this for a few seconds and then nothing else happens

Please..... First use autoformat in the IDE, mark and Ctrl c.Then click code tag, the symbol up and left.and Ctrl v.

Apologies, now corrected

Check the baud rate setting in the IDE. It must be the same as in


Okay, that has helped to an extent and now produces actual text

Now saying Couldn't find FONA. Must be something to do with the FONA board I'm using

Thanks for your help