I2C struggle when transmitting data using Notecarrier F 1.3 with wifi+cell notecard

Hello,

I am reaching out because I have built a system using a Notecarrier F and it is not performing as expected. I have connected several sensors to the Notecarrier using its QWIIC connection port. The sensors are plugged into an I2C bus which is plugged into the Notecarriers QWIIC port. In my.The Notecarrier + ESP32 Feather poll the sensors and then transmit the data using the notecard.

This has worked until recently, I added a new I2C GNSS module (SparkFun GNSS Receiver Breakout - MAX-M10S). The system can polls all of the sensors at about 1Hz until I start transmitting data from the Notecarrier. Specifically, the GNSS module struggles to update its coordinates while I am transmitting data with the Notecarrier. It repeats the same coordinates until the data transmission to the Blues IoT Cloud from the Notecarrier stops.

I originally setup the notecard with:

’ {

J \*req = notecard.newRequest("hub.set");

if (req != NULL) {

JAddStringToObject(req, “product”, productUID);

JAddStringToObject(req, “mode”, “continuous”);

NoteRequest(req);

}

}’

I transmit data in my main loop with:

’ J *req = notecard.newRequest(“note.add”);

if (req == NULL) {

error += "Failed to create note.add; ";

return;

}

JAddBoolToObject(req, “sync”, true);

J *body = JCreateObject();

if (body) {

JAddNumberToObject(body, “temperature”, temperature);

JAddNumberToObject(body, “conductivity”, conductivity);

JAddNumberToObject(body, “salinity”, salinity);

JAddNumberToObject(body, “pressure”, pressure);

JAddNumberToObject(body, “altitude”, altitude);

JAddNumberToObject(body, “longitude”, lon);

JAddNumberToObject(body, “latitude”, lat);

JAddNumberToObject(body, “tempPress”, tempPress);

JAddNumberToObject(body, “depth”, depthMeters);

JAddNumberToObject(body, “depthConfidence”, pingConfidence);

JAddStringToObject(body, “Timestamp”, timestamp.c_str());

JAddStringToObject(body, “deviceType”, deviceType);

JAddStringToObject(body, “waterState”, deviceType);

JAddStringToObject(body, “error”, error.c_str());

JAddItemToObject(req, “body”, body);

}

NoteRequest(req);

}’

Would someone be able to help me troubleshoot this problem? Thank you for all of your help!

Hi @antiexpert,

Using an external GPS with a Notecard is only supported via AUX UART. So unplug it from the Notecarrier’s QWIIC port and wire it instead to TX/RX according to our instructions in this blog post: Using an External GPS/GNSS Module with the Notecard.

Thanks,
Rob

Hi Rob,

I appreciate the quick response. The main reason why I am choosing to use an external GPS module rather than the native GPS support on the notecard is because I found the Notecard GPS update rate to be somewhere around 1 update a minute and I had this rate confirmed with the Blues support team. My external module on the other hand is capable of providing a fresh GPS point once every second

To your knowledge, should connecting to the the Notecarrier have any effect on the GPS update rate? Also, the AUX UART is a separate connection than the if I were to use the F_TX and F_RX pints right? Is there any additional setup needed to use the AUX UART pins (i.e. one of the switches on the back of the notecarrier)?

I will try to answer these questions myself in the time being but if you can still provide your knowledge it would be super helpful!

Thanks,
Will

I would also be curious to know why a GPS module does not work over I2C? I thought it would appear like a blackbox simply providing values over the I2C line but for what reason do GPS modules specifically not work with the notecarrier over I2C?

Apologies for the spam, but just to add onto my question regarding the GPS update rate: I found this in the guide you shared in the list of commands for using and external GPS

This this “seconds” parameter what defines the rate of GPS update? If so, is it possible to have this as often as 1 second (so “seconds”: 1)

Update: I am am attemping to use the external GPS connected over the AUX UART pins. The AUX switch underneath the notecarrier is switched to normal to allow the AUX pins to be used. This is my code:

#include <Arduino.h>

#include <Wire.h>

#include <Notecard.h>

Notecard notecard;

void sendSetupRequests()

{

// {“req”:“hub.set”,“mode”:“continuous”,“outbound”:1,“inbound”:240}

J *req = NoteNewRequest(“hub.set”);

if (req != nullptr) {

JAddStringToObject(req, “mode”, “continuous”);

JAddNumberToObject(req, “outbound”, 1);

JAddNumberToObject(req, “inbound”, 240);

if (!NoteRequest(req)) {

Serial.println(“hub.set failed”);

}

}

// {“req”:“card.aux.serial”,“mode”:“gps”}

req = NoteNewRequest(“card.aux.serial”);

if (req != nullptr) {

JAddStringToObject(req, “mode”, “gps”);

if (!NoteRequest(req)) {

Serial.println(“card.aux.serial failed”);

}

}

// {“req”:“card.location.mode”,“mode”:“periodic”,“seconds”:1}

req = NoteNewRequest(“card.location.mode”);

if (req != nullptr) {

JAddStringToObject(req, “mode”, “periodic”);

JAddNumberToObject(req, “seconds”, 1);

if (!NoteRequest(req)) {

Serial.println(“card.location.mode failed”);

}

}

// {“req”:“card.location.track”,“start”:true}

req = NoteNewRequest(“card.location.track”);

if (req != nullptr) {

JAddBoolToObject(req, “start”, true);

if (!NoteRequest(req)) {

Serial.println(“card.location.track failed”);

}

}

}

void printLocation()

{

J *req = NoteNewRequest(“card.location”);

if (req == nullptr) {

Serial.println(“Failed to create card.location request”);

return;

}

J *rsp = NoteRequestResponse(req);

if (rsp == nullptr) {

Serial.println(“card.location request failed”);

return;

}

double latitude = JGetNumber(rsp, “lat”);

double longitude = JGetNumber(rsp, “lon”);

int locationTime = JGetInt(rsp, “time”);

const char *status = JGetString(rsp, “status”);

Serial.print("Latitude: ");

Serial.println(latitude, 7);

Serial.print("Longitude: ");

Serial.println(longitude, 7);

Serial.print("Time: ");

Serial.println(locationTime);

Serial.print("Status: ");

Serial.println(

status != nullptr && strlen(status) > 0

  ? status

  : "(no status)"

);

Serial.println();

NoteDeleteResponse(rsp);

}

void setup()

{

Serial.begin(115200);

delay(2000);

Serial.println(“Starting Notecard external GPS test”);

Wire.begin();

Wire.setClock(100000);

notecard.begin();

// Uncomment to display raw Notecard requests and responses.

// notecard.setDebugOutputStream(Serial);

sendSetupRequests();

Serial.println(“Setup complete”);

Serial.println();

}

void loop()

{

printLocation();

delay(1000);

}

I get the following result repeatedly:

Latitude: 49.2616725

Longitude: -123.2471680

Time: 1780075552

Status: GPS waiting to start {gps-starting} {gps-active}

The GPS has not updated but the module is connected to a working antenna and is blinking. I am assuming this GPS coordinate it gives me was just the last GPS coordinate the system had and was not actually data from the GPS module. Everything is wired correctly. Any ideas why I would not be getting any update?