A set of Arduino Sketches for execution on a RPI Pico W building up to and including sending GPS location data over Bluetooth in BT Classic mode. Also send GPS data to an Azure IoT Hub.
The calculation of Latitude and Longitude from NMEA data has been corrected ina a number of projects as per my blog post :GPS: NMEA 101.
RPI-Pico-Arduino-AzSDK: Bluetooth and GPS Update
The RPI PicoW comes with Bluetooth. The BSP used has been updated to include that.
- The repository for the Pico W Arduino BSP: earlephilhower-arduino-pico on Github
- Installation instructions
- Bluetooth documentation for the BSP
- Arduino Compatible GPS Receiver Module Jaycar (Australia) CAT.NO: XC3710
- https://www.jaycar.com.au/arduino-compatible-gps-receiver-module/p/XC3710
- nblox NEO-7M Module BAUD is 9600
1.USART1 Echo
- Echo text from Serial terminal (uppercased) back to it after first passing it through USART1 in loopback mode.
2.Basic GPS
- Read and echo NMEA sentences to Serial terminal
3.InteractiveGPS
- Can send commands to device from Serial terminal:
- s: Start
- p: Stop
- n: No filter on messages
- n: Filter all (none displayed)
- a: Display GPGGA - Global Positioning System Fix Data
- l: Display GPGLL - Geographic Position, Latitude / Longitude
- v: Display GPGSV - Satellites in view
4.LocationGPS
- Filter all messages except GPGGA
- Get latitude, longitude and height
- Note that string processing of NMEA messages is explicit rather than using existing libraries.
- Commands:
-
- s: start
- p: stop
- n display none
- d: Display GPGGA string
- l: Display as location tupple
- t: Display as json telemetry
- Has been modified for Sketch 7.
- Parsing of NMEA in "reusable" function.
5.BTSerialUppercase
- Receive text over Bluetooth and echo it back after upper-casing it.
- Is the Android IDE SerialBT BTSerialUppercase example
- Added echo to IDE Terminal of the characters being passed, unadulterated.
- Note: Bluetooth Classic, not BLE.
- Found the Android phone app Serial Bluetooth Terminal was easier to pair than desktop.
6.BluetoothGPS
- Send Location data over Bluetooth to paired host.
- As per 4 but data and commands over Bluetooth (Merger of 4. and 5.)
- Receives commands over BT as per BTSerialUppercase and interprets them as per LocationGPS.
- That is, sends Location data back over BT when available as per LocationGPS (to SerialBT instead of Serial)
- Note: Bluetooth Classic, not BLE.
7.Azure_IoT_Hub_GPS
- Send GPS location data, generated as per LocationGPS, as Telemetry to an Azure IoT Hub.
- Minus interactive commands.
- Filter all messages except GPGGA Get latitude, longitude and height
- From LocationGPS uses json location option.
- That is, all creation of the telemetry string explicitly uses string processing rather than GPS and json classes.
- Now works.
- read-d2c-messages
- .NET Console app to monitor messages sent to IoT Hub by 7.
- Uses .NET Core 3.1
- See code for connection details.
Nb: Was found that in Azure IoT Explorer, needed to paste same connection string as the Custom Endpoint for the device. Built-in [Yes] option did not work.
- read-d2c-messages-Net6
- As per 8. but uses .NET 6.0
- See code for connection details.
Working on a Blazor app to display the GPS coordinates sent by 8. on a map. See djaus2/GPSMapIoTHub