GPS - 4 - Troubleshooting and hints / tips

Troubleshooting

When the hardware is all connected, there are several processes in action and it is useful to break the operation into individual processes and use different sketches to troubleshoot each section if there are problems. Note that some sketches referred to in the build process on page 2 may also be helpful in troubleshooting.

Note that the test sketches that follow, are similar to those in the Arduino software excapt in most cases we are using different pins eg LCD uses different pins, SD uses pin 10 for chip select rather than pin 4, GPS uses the analog pins 0 and 1 for softwareserial. Our GPS module also talks serial at 9600 baud rather than the default 4800 baud.

If you use any of the Arduino sketches, make sure you check that the pins used are the correct ones for our hardware setup. Also, all our sketches are set to use 57600 baud on the serial port.

Aassuming you have a working Arduino as a starting point (use the blink sketch to test), the sections can be broken down as follows.

Test sketches: basic_tests.zip

1) Arduino to LCD
To test the hardware and wiring are functioning run our modified LCD sketch: 

- HelloWorld_LCD_test
This should show “Hello World” on the top line and the bottom line should show a count of seconds elapsed since reset.
* If the display is completely black, check the backlight connections.
* If the backlight appears to be on, check that the contrast trimpot is able to change contrast – wind it slowly left and right. At some point the words should appear - too far and all the LCD pixels may light up.
* If odd characters appear, check the wiring of the data lines.

2) Arduino to SD module

NOTE - the SD library expects to see a card in FAT16 or FAT 32 format.

    To test hardware and SD card try the following sketches:
    - CardInfo_SD_test
* This sketch should check the SD card and report back various information including the size and formatting of the card (it should be FAT16), plus a list of any files and folders on the card.
Note that it sends this information to the serial port, so open the serial monitor at 57600 baud.

If the card fails, you may need to do some troubleshooting around the error given. Also, try another SD card if you have one.

    - ReadWrite_SD_test
* This will attempt to write a file (test.txt) and some text into it, then read it again.
Again, it sends data to the serial port at 57600 baud.
   

3) Arduino to GPS module
    To test if data is coming from the GPS module run the following:
    - Simple_test_GPS_test
* This sketch will attempt to read data from the GPS module using the software serial library, and write it to the serial port (57600 baud).
It should start with “Simple TinyGPS Library …” (this is hard coded in the sketch, so doesn’t test anything).  Next, these should be a data stream adding lines every second. Don’t worry too much about the data yet, as long as there are about 7 lines and they start with ‘$GPGGA’ or ‘$GPGSA’ or similar.

If you get these, then the GPS module has power and is talking to the Arduino fine. A final line will have ‘LAT=*** LON=*** SAT=*** ….’
If you see this line, and the stars are acutally numbers, then the GPS module has connected to satellites and has a fix, and this is positional data.

If you only see the ‘LAT=*** LON=*** SAT=*** ….’ Line, repeating every second and with zeros in place of the stars, then the GPS module either doesn’t have power or the data line is not connected correctly (this line is generated by the sketch on its own and doesn’t rely on the GPS module working).

If you see the ‘$GPGGA’ lines but ‘LAT=*** LON=*** SAT=*** ….’ has zeros, the GPS module is communicating but doesn’t have a fix yet. If this continues for more than 10 minutes, re-position the module – it gets best signals when pointing up at the sky and outside.

If the LED never comes on, the module is not able to see satellites and get a fix. If you have tested the GPS module as per page 1 and you have seen it getting a fix, then you need to find out why it doesn't get one now. Some GSP modules are more sensitive that others, so make sure your module is able to 'see' the sky clearly with no obstructions. It can take up to five minutes to get an initial fix, so make sure you wait long enough.

4) Processing sketch

The Processing sketch should create/update the JSON data file.
It relies on knowing the comm port that the arduino hardware is connected to so make sure you know this and have changed the Processing sketch where the comm port number is required.
If you are seeing a map but no route on it, make sure the JSON file (arduino_data.js) is in the sketch folder, and open it to be sure there is some coordinate data in it.
If the file doesn't exist or there is no data in it, open the serial monitor of the Arduino software and go through the upload process again and see if data is being output. Then use the Processing window to see that data is being read.
If no data is being sent, check that the SD card has a file called datalog.txt on it and that it has data in it.


5)Google Map page

If there is no map, make sure your computer is online!
If there is a map but no route showing, check the JSON file has coordinate data in it.  The map is designed so that it should show an area that corresponds to your coordinate set. If this file has become corrupted, it could be setting the map up differently to where the coordinates are centred. Try deleting all the data in the file and uploading to it again.

Note that you have to reload the map page if you make changes (or upload data again) to the coordinate file.

Zircon - This is a contributing Drupal Theme
WeebPal