Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/build/
*/build/
*/*/build/
*/*/*/build/
/.vscode/
/QGNSSS/
/Examples/Console/
Expand Down
128 changes: 128 additions & 0 deletions check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#!/bin/bash
#
# check.sh
# Script to verify example builds
########################################################################
set -e
#set -o verbose
#set -o xtrace

cd examples/1.\ Basics/Device.Info
make clean
make
make clean

cd ../Position.Velocity.Time
make clean
make
make clean

cd ../../2.\ Configuration/Commands
make clean
make
make clean

cd ../Constellations
make clean
make
make clean

cd ../ElevationCNR
make clean
make
make clean

cd ../RTK.Fix.Timeout
make clean
make
make clean

cd ../SetFixInterval
make clean
make
make clean

cd ../../3.\ Satellites/Satellites
make clean
make
make clean

cd ../../4.\ Messages/Msg.Enable
make clean
make
make clean

cd ../Msg.Subscribe
make clean
make
make clean

cd ../../5.\ Features/Odometer
make clean
make
make clean

cd ../PPS
make clean
make
make clean

cd ../../6.\ Accuracy\ and\ Protection/Position.Errors
make clean
make
make clean

cd ../Protection
make clean
make
make clean

cd ../../7.\ Rover\,\ Base\,\ Survey/Set.Base.Rover.Mode
make clean
make
make clean

cd ../Survey.Fixed.Mode
make clean
make
make clean

cd ../Survey.Fixed.Mode.LLA
make clean
make
make clean

cd ../Survey.In.Mode
make clean
make
make clean

cd ../../8.\ Resets/Reset.Device
make clean
make
make clean

cd ../Stop.Start.Engine
make clean
make
make clean

cd ../../9.\ NTRIP/NTRIP.Client
make clean
make
make clean

cd ../NTRIP.Server
make clean
make
make clean

cd ../NTRIP.Server.Survey.In
make clean
make
make clean

cd ../../10.\ PPP HAS Corrections/HAS_E6_Example

# Return to origin directory
cd ../../..
93 changes: 87 additions & 6 deletions examples/1. Basics/Device.Info/Device.Info.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,55 @@

#include <SparkFun_LG290P_GNSS.h> // Click here to get the library: http://librarymanager/All#SparkFun_LG290P

int gnss_baud = 460800;

// Adjust these values according to your configuration
//------------------------------------------------------------------------------
// https://www.sparkfun.com/sparkfun-gnss-flex-phat.html
#ifdef ESP32_RPI_FLEX

// ESP32 WROOM with 40-pin Raspberry Pi GPIO connector
// https://copperhilltech.com/esp32-development-board-with-raspberry-pi-gpio/

// UART1_TX (IO15) --> RPi GPIO Connector 10 (GPIO15/TXD) --> Raspberry Pi Flex Hat J4-19 (RXD1) --> Flex connector J3-19 (RXD1) --> LG290P 21 (RXD)
//int pin_UART1_TX = 15;

// UART1_RX (IO14) <-- RPi GPIO Connector 8 (GPIO14/RXD) <-- Raspberry Pi Flex Hat J4-15 (TXD1) <-- Flex connector J3-15 (TXD1) <-- LG290P 20 (TXD1)
//int pin_UART1_RX = 14;

// UART1_TX (IO5/CE0) --> RPi GPIO Connector 24 (GPIO8/CE0) --> Raspberry Pi Flex Hat J4-12 (RXD2) --> Flex connector J3-12 (RXD2) --> LG290P 7 (RXD)
int pin_UART1_TX = 5;

// UART1_RX (IO19/MISO) <-- RPi GPIO Connector 21 (GPIO9/MISO) <-- Raspberry Pi Flex Hat J4-10 (TXD2) <-- Flex connector J3-10 (TXD2) <-- LG290P 6 (TXD1)
int pin_UART1_RX = 19;

// Reset ___ _____ _____
// No connection --> Raspberry Pi Flex Hat J4-16 (RST) --> Flex connector J3-16 (RESET)--> LG290P 8 (Reset)
int pin_RESET = -1;

const char * platform = "ESPBERRY & SparkFun GNSS Flex pHAT";

#else // ESP32_RPI_FLEX
#ifdef POSTCARD

// https://www.sparkfun.com/sparkfun-rtk-postcard.html
int pin_UART1_TX = 21;
int pin_UART1_RX = 22;
int pin_RESET = 33;
const char * platform = "SparkFun RTK Postcard";

#else // POSTCARD

// ???
int pin_UART1_TX = 14;
int pin_UART1_RX = 13;
int gnss_baud = 460800;
int pin_RESET = -1;
const char * platform = "???";

#endif // POSTCARD
#endif // ESP32_RPI_FLEX

//------------------------------------------------------------------------------

LG290P myGNSS;
HardwareSerial SerialGNSS(1); // Use UART1 on the ESP32
Expand All @@ -33,15 +78,25 @@ void setup()
delay(250);
Serial.println();
Serial.println("SparkFun LG290P Device Info example");
Serial.println("Initializing device...");

// Issue the reset
if (pin_RESET != -1)
{
Serial.println("Resetting the LG290P");
pinMode(pin_RESET, OUTPUT);
digitalWrite(pin_RESET, 0);
delay(100);
digitalWrite(pin_RESET, 1);
}

// We must start the serial port before using it in the library
// Increase buffer size to handle high baud rate streams
Serial.printf("Initializing %s ...\r\n", platform);
SerialGNSS.setRxBufferSize(1024);
SerialGNSS.begin(gnss_baud, SERIAL_8N1, pin_UART1_RX, pin_UART1_TX);

// myGNSS.enableDebugging(Serial); // Print all debug to Serial
if (myGNSS.begin(SerialGNSS) == false) // Give the serial port over to the library
if (myGNSS.begin(SerialGNSS, "SFE_LG290P_GNSS_Library", output) == false) // Give the serial port over to the library
{
Serial.println("LG290P failed to respond. Check ports and baud rates. Freezing...");
while (true);
Expand All @@ -52,8 +107,8 @@ void setup()
Serial.print("Constellations: ");
if (myGNSS.getConstellations(gpsEnabled, glonassEnabled, galileoEnabled, bdsEnabled, qzssEnabled, navicEnabled))
{
Serial.printf("GPS: %s, GLONASS: %s, Galileo: %s, Beidou: %s, QZSS: %s, NavIC: %s\r\n",
gpsEnabled ? "Yes" : "No", glonassEnabled ? "Yes" : "No", galileoEnabled ? "Yes" : "No",
Serial.printf("GPS: %s, GLONASS: %s, Galileo: %s, Beidou: %s, QZSS: %s, NavIC: %s\r\n",
gpsEnabled ? "Yes" : "No", glonassEnabled ? "Yes" : "No", galileoEnabled ? "Yes" : "No",
bdsEnabled ? "Yes" : "No", qzssEnabled ? "Yes" : "No", navicEnabled ? "Yes" : "No");
}
else
Expand Down Expand Up @@ -125,3 +180,29 @@ void setup()
void loop()
{
}

//----------------------------------------
// Output a buffer of data
//
// Inputs:
// buffer: Address of a buffer of data to output
// length: Number of bytes of data to output
//----------------------------------------
void output(uint8_t * buffer, size_t length)
{
size_t bytesWritten;

if (Serial)
{
while (length)
{
// Wait until space is available in the FIFO
while (Serial.availableForWrite() == 0);

// Output the character
bytesWritten = Serial.write(buffer, length);
buffer += bytesWritten;
length -= bytesWritten;
}
}
}
Loading