Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved CI checks, added extra info in README #5

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
459efd0
Fixed sign conversion error
midasgossye Feb 10, 2021
ce02b7b
fixed bug with testing array
midasgossye Feb 10, 2021
9fd49d0
Added keywords and updated library properties
midasgossye Feb 11, 2021
a62d710
Removed duplicate readme file
midasgossye Feb 11, 2021
11028d3
fixed syntax colouring
midasgossye Feb 11, 2021
c43bf7c
Put images in extras folder (per Arduino library spec)
midasgossye Feb 11, 2021
5583047
Added github action library build check
midasgossye Feb 11, 2021
954674c
Fixed typo in action script
midasgossye Feb 11, 2021
d92a1dc
Added install script for library
midasgossye Feb 11, 2021
d0e0347
Added enable unsafe install flag
midasgossye Feb 11, 2021
b4c5cce
fixed typo
midasgossye Feb 11, 2021
3967b5b
set allow unsafe install variable
midasgossye Feb 11, 2021
8493d5d
added copy step
midasgossye Feb 11, 2021
c0b39a9
added recursive folder
midasgossye Feb 11, 2021
53cd3da
Removed non-avr
midasgossye Feb 11, 2021
5bd3490
Trying out different CI routine
midasgossye Feb 11, 2021
0c34128
don't set expect unittests
midasgossye Feb 11, 2021
df3693b
Changed CI platforms
midasgossye Feb 11, 2021
d2999b5
Fixed file name typo
midasgossye Feb 11, 2021
2ac3b69
updated badge
midasgossye Feb 11, 2021
56904ea
Added picture of module
midasgossye Feb 11, 2021
5697a57
Added datasheet link
midasgossye Feb 15, 2021
1441cad
Added nano every to compatible boards
midasgossye Feb 15, 2021
ef0efb9
Added arduino nano every
midasgossye Feb 15, 2021
8085644
Fixed typo
midasgossye Feb 15, 2021
c6a5083
fixed formatting error
midasgossye Feb 15, 2021
d9b6abb
Added * to architectures
midasgossye Feb 15, 2021
95374e9
Fixed typo
midasgossye Feb 15, 2021
07242e8
Added arduino library badge
midasgossye Feb 18, 2021
690ea67
Fixed compatibility issues with leonardo and micro boards
midasgossye Mar 10, 2021
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
26 changes: 26 additions & 0 deletions .arduino-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
packages:
arduino:megaavr:
url: https://downloads.arduino.cc/packages/package_index.json

platforms:

nano_every:
board: arduino:megaavr:nona4809
package: arduino:megaavr
gcc:
features:
defines:
- MILLIS_USE_TIMERB3
- NO_EXTERNAL_I2C_PULLUP
- AVR_NANO_4809_328MODE
warnings:
flags:

compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
- uno
- leonardo
- mega2560
- cplayClassic
- nano_every
47 changes: 47 additions & 0 deletions .github/workflows/Arduino_CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Arduino_CI

on: [pull_request,push]

jobs:
arduino_ci:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: Arduino-CI/[email protected] # or latest, or a pinned version
env:
# Not all libraries are in the root directory of a repository.
# Specifying the path of the library here (relative to the root
# of the repository) will adjust that.
#
# The default is the current directory
#
USE_SUBDIR: .

# Not all libraries include examples or unit tests. The default
# behavior of arduino_ci is to assume that "if the files don't
# exist, then they were not MEANT to exist". In other words,
# if you were to accidentally delete all your tests or example
# sketches, then the CI runner would by default assume that was
# intended and return a passing result.
#
# If you'd rather have the test runner fail the test in the
# absence of either tests or examples, uncommenting either of
# the following variables to 'true' (as appropriate) will
# enforce that.
#
EXPECT_EXAMPLES: true

# Although dependencies will be installed automatically via the
# library manager, your library under test may require an
# unofficial version of a dependency. In those cases, the custom
# libraries must be insalled prior to the test execution; those
# installation commands should be placed in a shell script (that
# will be executed by /bin/sh) stored in your library.
#
# Then, set this variable to the path to that file (relative to
# the root of your repository). The script will be run from
# within the Arduino libraries directory; you should NOT attempt
# to find that directory nor change to it from within the script.
#
# CUSTOM_INIT_SCRIPT: install_dependencies.sh
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# Whadda WPI430/VMA430 - GPS MODULE U-BLOX NEO-7M
# Whadda WPI430/VMA430 - GPS MODULE U-BLOX NEO-7M ![Arduino_CI](https://github.com/Whaddadraft/VMA430_GPS_Module/workflows/Arduino_CI/badge.svg) [![arduino-library-badge](https://www.ardu-badge.com/badge/WPI430-VMA430%20GPS.svg?)](https://www.ardu-badge.com/WPI430-VMA430%20GPS)

![Whadda WPI430/VMA430 - GPS MODULE](https://www.velleman.eu/images/products/29/vma430.jpg)

This repository contains the library and example code to work with our Whadda WPI430/VMA430 GPS MODULE with the U-BLOX NEO-7M chipset. It can configure the module to send out UBX data packets, and is able to decode the time and location data.

You can pick up a Whadda WPI430/VMA430 GPS module here: [whadda.com/product/gps-module-u-blox-neo-7m-for-arduino-vma430](https://whadda.com/product/gps-module-u-blox-neo-7m-for-arduino-vma430/)

## Background info

Most GPS modules output so called NMEA sentences that can be interpretted by a variety of programs. The Whadda WPI430 GPS module is also able to send data in the form of UBX packets, a custom protocol designed by U-Blox (the manufacturer of the GPS chipset on the module).
UBX packets use a more compact data encoding algorithm which makes it faster to decode the corresponding data on low-resource computers/microcontrollers such as the AVR based Arduino's.

This library only uses the UBX packets to decode the data.

For more information, check the U-Blox Neo-7M datasheet [here](https://www.u-blox.com/sites/default/files/products/documents/NEO-7_DataSheet_%28UBX-13003830%29.pdf).


## Installation

1. Download the most recent version of the Arduino library by clicking the ```Download ZIP``` option in the Code menu:

![](./images/download.jpg)
![](./extras/images/download.jpg)

2. Open the Arduino IDE, click on Sketch > Include Library > Add .ZIP Library...

![](./images/add_library.jpg)
![](./extras/images/add_library.jpg)

3. Open the .ZIP file you just downloaded, a message should appear in the Arduino IDE: "Library added to your libraries. Check "include library" menu."

Expand All @@ -31,10 +37,16 @@ Wire up the GPS module to an Arduino compatible board as shown below:
|----------|-------------|
|VCC|5V|
|GND|GND|
|TXD|D3|
|RXD|D2|
|TXD|D11|
|RXD|D10|

![](./extras/images/wiring_diagram.png)

**Note:** The library uses a SoftwareSerial port to communicate with the GPS module. The default pin layout should be compatible with Arduino Uno, Mega, Leonardo, and Micro compatible boards. Other Arduino models may have different restrictions on the pins that can be used for this purpose. Check the limitations section of the SoftwareSerial Arduino site page (https://www.arduino.cc/en/Reference/softwareSerial) to find out which pins can be used on your particular Arduino board model. You can change the pins that are used by the library by altering the following line of code:

![](./images/wiring_diagram.png)
```Cpp
SoftwareSerial ss(11, 10); // RX, TX
```

### Programming

Expand All @@ -45,4 +57,4 @@ Wire up the GPS module to an Arduino compatible board as shown below:
The example program will first set-up the GPS-module by setting it's communication protocols. It will enable the module to send out UBX messages next to the standard NMEA messages that it normally outputs.
The program will then decode these UBX messages, and show the parsed output. The data that is sent out includes location data (latitude & longitude) and UTC time (hours, minutes & seconds).

**NOTE**: The GPS module's built-in antenna is only designed to work **outdoors**. You will probably not get valid time and location data if you test this example indoors. You might be able to get reception after a few minutes if you put the GPS antenna close to a window, pointed towards the sky.
**NOTE**: The GPS module's built-in antenna is only designed to work **outdoors**. You will probably not get valid time and location data if you test this example indoors. You might be able to get reception after a few minutes if you put the GPS antenna close to a window, pointed towards the sky.
1 change: 0 additions & 1 deletion README.txt

This file was deleted.

2 changes: 1 addition & 1 deletion examples/Show_time_location/Show_time_location.ino
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <VMA430_GPS.h> // Include the GPS module library
#include <SoftwareSerial.h> // Include the software serial library

SoftwareSerial ss(3, 2); // RX, TX
SoftwareSerial ss(11, 10); // RX, TX
VMA430_GPS gps(&ss); // Pass the softwareserial connection info the the GPS module library

void setup()
Expand Down
File renamed without changes
File renamed without changes
Binary file added extras/images/wiring_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/wiring_diagram.png
Binary file not shown.
15 changes: 15 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Syntax Coloring Map For VMA430_GPS library

# Datatypes (KEYWORD1)
VMA430_GPS KEYWORD1

# Methods and Functions (KEYWORD2)
begin KEYWORD2
setUBXNav KEYWORD2
getUBX_packet KEYWORD2
parse_ubx_data KEYWORD2

# Instances (KEYWORD2)
utc_time KEYWORD3

# Constants (LITERAL1)
11 changes: 6 additions & 5 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name=WPI430/VMA430 GPS
name=WPI430-VMA430 GPS
version=2.0.0
author=Velleman nv
maintainer=Velleman nv
sentence=Velleman WPI430/VMA430 GPS module library
paragraph=Velleman VMA430 GPS MODULE U-BLOX NEO-7M
author=Velleman nv <[email protected]>
maintainer=Velleman nv <[email protected]>
sentence=Velleman WPI430-VMA430 GPS module library
paragraph=decodes and parses location and time data
category=Sensors
url=https://github.com/Velleman/VMA430_GPS_Module
architectures=*
includes=VMA430_GPS.h
39 changes: 26 additions & 13 deletions src/VMA430_GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ bool VMA430_GPS::parse_nav_pos(void)
{
bool successfull_parsing = false;

uint64_t temp_lon = 0, temp_lat = 0;
int32_t temp_lon = 0, temp_lat = 0;
double longitude = 0.0;
double latitude = 0.0;
uint32_t temp_val = 0;
Expand All @@ -547,20 +547,10 @@ bool VMA430_GPS::parse_nav_pos(void)
return false;
}

for(int j = 0; j<4; j++)
{
temp_val = msg_data[4+j];
temp_lon |= (temp_val << 8*j);
}
//temp_lon = (msg_data[8]) | (msg_data[9] << 8) | (uint32_t)(msg_data[10] << 16) | (uint32_t)(msg_data[11] << 24);
temp_lon = extractSignedLong(4, msg_data);
longitude = (double)temp_lon*0.0000001;

for(int j = 0; j<4; j++)
{
temp_val = msg_data[8+j];
temp_lat |= (temp_val << 8*j);
}
//temp_lon = (msg_data[8]) | (msg_data[9] << 8) | (uint32_t)(msg_data[10] << 16) | (uint32_t)(msg_data[11] << 24);
temp_lat = extractSignedLong(8, msg_data);
latitude = (double)temp_lat*0.0000001;

location.latitude = latitude;
Expand Down Expand Up @@ -626,6 +616,29 @@ byte VMA430_GPS::getUBX_ACK(byte *msgID)
}
}

uint32_t VMA430_GPS::extractLong(uint8_t spotToStart, byte* msg_data)
{
uint32_t val = 0;
val |= (uint32_t)msg_data[spotToStart + 0] << 8 * 0;
val |= (uint32_t)msg_data[spotToStart + 1] << 8 * 1;
val |= (uint32_t)msg_data[spotToStart + 2] << 8 * 2;
val |= (uint32_t)msg_data[spotToStart + 3] << 8 * 3;
return (val);
}

//Just so there is no ambiguity about whether a uint32_t will cast to a int32_t correctly...
int32_t VMA430_GPS::extractSignedLong(uint8_t spotToStart, byte* msg_data)
{
union // Use a union to convert from uint32_t to int32_t
{
uint32_t unsignedLong;
int32_t signedLong;
} unsignedSigned;

unsignedSigned.unsignedLong = extractLong(spotToStart, msg_data);
return (unsignedSigned.signedLong);
}

void VMA430_GPS::calcChecksum(byte *checksumPayload, byte payloadSize)
{
byte CK_A = 0, CK_B = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/VMA430_GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ class VMA430_GPS {
bool parse_nav_pos(void);

byte getUBX_ACK(byte *);
uint32_t extractLong(uint8_t, byte*);
int32_t extractSignedLong(uint8_t, byte*);

long portRate;
Stream *stream = NULL;
Expand Down