Solar-powered GPS tracker that displays user's track, saving it to kml file on sd card. Running on Adafruit Feather M0 Adalogger.
Updated: 2018.10.03 Current track is named "TRK0000.TXT". Current map is named "GPSTEST.TXT".
Upon board initialization, directories are created for year/month/day; e.g., September 1st, 2018 is 2018/09/01/. Within the day directory, each board initialization creates an indexed folder; e.g., "00000001/". Within this folder are indexed logs:
- "BATTERY.TXT" : a log of timestamped battery voltage (csv)
- "LOGFILE.TXT" : a log in case board crashes; what would be console output when board is connected to Arduino IDE is logged here.
Only locations visible on-screen are drawn. Concentric circles indicate distance from current location (at center).
Solar-powered GPS tracker that displays user's track, saving it to kml file on sd card.
- draws other kml tracks on sd card (different color than curr track)
[ ] can scroll touchscreen by 'dragging' (WON'T DO: Adafruit TFT display draws too slowly for this!)- can zoom in/out (display units change from feet to miles when zoomed out sufficiently)
- concentric circles centered on user location denoting distances
- SD card not required for displaying battery and GPS data
- LEDs for solar state: charging and done (refer here. look for "https://learn.adafruit.com/usb-dc-and-solar-lipoly-charger/using-the-charger")
COMPARE TO:
- hook up materials.
- follow steps here: https://learn.adafruit.com/adafruit-feather-m0-basic-proto/setup
- Tools > Boards Manager:
- Arduino SAMD Boards
- Adafruit SAMD Boards
- copy Adafruit_GPS to Documents/Arduino/libraries/
- Tools > Manage Libraries >
- Adafruit HX8357
- Adafruit STMPE610
- Adafruit GFX
- RTClib by Adafruit
- delete:
- App
- Documents/Arduino
- Documents/Arduino15 (why is this not always existing? it needs to be deleted...)
- print current gps coord on screen
- poll gps every n seconds & write to csv: p0,p1,p2,...
- read from SD & display most recent locations
- can insert / remover SD card while board is running without a crash
- write & read from kml file instead of csv
Adafruit Feather M0 Adalogger has "256KB of FLASH + 32KB of RAM". kml files often exceed 32KB. Test reading a large file like this 715KB one.
KML will be stored on the SD card. You probably want to read the file in small chunks, keeping only points whose lat, lng coords translate to pixels that are visible on the display. This may not efficiently support map scrolling, as the entire kml would need to be re-processed only to use most of the same points as before.
Maybe another file on the SD card is a list of coords sorted such that those closest to the current GPS position are first. When a current location is obtained, all list elements increase by one position? This assumes you're moving slow enough to not jump many points, right?
Or maybe your track on the SD card remains CSV and powering off or pressing a button formats it as KML, or maybe offload this to a python script run on the user's computer; this would be easier to parameterize.
- translate gps coords to screen pos (user's current location is screen center)
- filter current track gps coords to only points that are visible on screen
- draw circle for all visible gps points
- draw lines connecting all visible gps points