I would like to use Nano 33 IOT in the project. I need to use IOT to see GPS data and alarms. It is a boat project - Anchor Alarm. With warning on my phone.
Nano 33 IOT have, I think, different serial ports and IDE board manager "Nano 33 IOT" is not supported by VMA430_GPS.h
Any suggestions to use VMA430_GPS.h with Nano 33 IOT?? Or find another solution with this Whadda WPI430 GPS MODULE U-BLOX NEO-7M?
#include <VMA430_GPS.h> // Include the GPS module library
#include <SoftwareSerial.h> // Include the software serial library
// Display DOWN
#include <Adafruit_GFX.h> // include Adafruit graphics library
#include <Adafruit_ILI9341.h> // include Adafruit ILI9341 TFT library
#define TFT_CS 8 // TFT CS pin is connected to arduino pin 8
#define TFT_RST 9 // TFT RST pin is connected to arduino pin 9
#define TFT_DC 10 // TFT DC pin is connected to arduino pin 10
// initialize ILI9341 TFT library
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
// Display UP
// RX fra GPS forbindes til pin 2 - TX fra GPS forbindes til pin 3 - ALTSĂ… OMVENDT AF HVAD MAN SKULLE TRO
SoftwareSerial ss(3, 2); // RX, TX
The problem is that RX and TX is different om the Nano 33 IOT.
You're leaving out at least one important line of code, the call to the constructor.
VMA430_GPS has two constructors, one for SoftwareSerial and one for HardwareSerial; use the latter. I'm not familiar with the Nano33 IoT but I think that the below will do instead of whatever we can't see.
Why even try to use SoftwareSerial with the Nano 33 IOT when it has a hardware UART (serial port) named Serial1 on pins 0 and 1 that is independent of the USB serial connection unlike the UNO ?
#include <VMA430_GPS.h> // Include the GPS module library
#include <SoftwareSerial.h> // Include the software serial library
// Display DOWN
#include <Adafruit_GFX.h> // include Adafruit graphics library
#include <Adafruit_ILI9341.h> // include Adafruit ILI9341 TFT library
#define TFT_CS 8 // TFT CS pin is connected to arduino pin 8
#define TFT_RST 9 // TFT RST pin is connected to arduino pin 9
#define TFT_DC 10 // TFT DC pin is connected to arduino pin 10
// initialize ILI9341 TFT library
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
// Display UP
// RX fra GPS forbindes til pin 2 - TX fra GPS forbindes til pin 3 - ALTSĂ… OMVENDT AF HVAD MAN SKULLE TRO
SoftwareSerial ss(3, 2); // RX, TX
VMA430_GPS gps(&ss); // Pass the softwareserial connection info the the GPS module library
You mean to replace my line with the one below.
And then move the wire from the GPS pin 2 RX and pin 3 TX on the UNO to
WARNING: library WPI430-VMA430_GPS claims to run on avr architecture(s) and may be incompatible with your current board which runs on samd architecture(s).
Seems like the VMA430_GPS don't like samd architecture.
Maybe I need another library driver. But I can't find it anywhere.
If any one have found a VMA430_GPS library for SAM D21 familie architecture, please let me know
The board's main processor is a low power Arm® Cortex®-M0 32-bit SAMD21. The WiFi and Bluetooth® connectivity is performed with a module from u-blox, the NINA-W10, a low power chipset operating in the 2.4GHz range. On top of those, secure communication is ensured through the Microchip® ECC608 crypto chip. Besides that, you can find a 6 axis IMU, what makes this board perfect for simple vibration alarm systems, pedometers, relative positioning of robots, etc.
Some library authors have the philosophy of "I'm only going to specify the architectures I test for" even when there is nothing architecture-specific in their code. So I also think it is worth trying it out.
The ideal is that the low level architecture specific code is wrapped in the standardized Arduino APIs by the core, and then libraries and sketches that use that API exclusively are portable to any board
The Arduino Nano 33 IoT is based on the SAMD21 microcontroller. The SAMD21 doesn't have an implementation of the SoftwareSerial library, because it's possible to create additional hardware Serial ports from the microcontroller's spare Serial Communication (SERCOM) modules, that can be configured as either Serial, SPI or I2C ports:
The easiest approach would be to replace the SoftwareSerial object "ss" with Serial1, in your GPS library and use the Nano 33 IoT's standard hardware TX and RX pins. If you're using more than one Serial port then follow the instructions in the Adafruit tutorial above to create additional ones.
Arduino.h is not the right place to make changes. It should always be possible to make things work from the sketch or library. At least for the problem you have.
Have you tried the suggestion in reply #11?
Like:
VMA430_GPS gps(&Serial1); // Pass the hardware serial connection info the the GPS module library
pep_Helium_AnkerAlarm_v5_2.2-IOT:40:17: error: 'Serial1' was not declared in this scope
VMA430_GPS gps(&Serial1);
^~~~~~~
/Users/peregholm/Documents/Arduino/pep_Helium_AnkerAlarm_v5_2.2-IOT/pep_Helium_AnkerAlarm_v5_2.2-IOT.ino:40:17: note: suggested alternative: 'Serial'
VMA430_GPS gps(&Serial1);
^~~~~~~
Serial
exit status 1
'Serial1' was not declared in this scope
I managed to get the VMA430_GPS example to compile for the Nano 33 IoT.
The issue is that the SAMD21 Arduino core code implements the SerialX (C++) objects as a class called Uart, while the AVR core code implements them as a class called HardwareSerial.
The first step is to do what @anon57585045 suggested and pass the address of Serial1 as an argument to the VMA430_GPS constructor, in the example code:
#include <VMA430_GPS.h> // Include the GPS module library
//#include <SoftwareSerial.h> // Include the software serial library
//SoftwareSerial ss(3, 2); // RX, TX
VMA430_GPS gps(&Serial1); // Pass the softwareserial connection info the the GPS module library
The next step is to modify the VMA430_GPS.h and VMA430_GPS.cpp files replacing the constructor's HardwareSerial* parameter with Uart*: