Skip to content

A set of Arduino Sketches for execution on a RPI Pico W involving GPS Bluetooth and Azure IoT Hub

License

Notifications You must be signed in to change notification settings

djaus2/RpiPicoWGPSandBT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
Aug 13, 2023
Aug 23, 2023
Aug 11, 2023
Aug 11, 2023
Aug 23, 2023
Aug 11, 2023
Aug 23, 2023
Aug 23, 2023
Aug 23, 2023
Aug 23, 2023
Aug 11, 2023
Aug 28, 2023

Repository files navigation

RPI Pico W GPS Bluetooth and Azure IoT Hub

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.


Update/Correction

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.


Blog Post

RPI-Pico-Arduino-AzSDK: Bluetooth and GPS Update

Hardware

Bluetooth

The RPI PicoW comes with Bluetooth. The BSP used has been updated to include that.

Arduino GPS Receiver

Projects

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.
  1. 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.

  1. read-d2c-messages-Net6
  • As per 8. but uses .NET 6.0
  • See code for connection details.

Footnote

Working on a Blazor app to display the GPS coordinates sent by 8. on a map. See djaus2/GPSMapIoTHub

About

A set of Arduino Sketches for execution on a RPI Pico W involving GPS Bluetooth and Azure IoT Hub

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published