I2C Connection Issues with ESP32 MCU and Notecard WiFi

Hello,

I’m working on my first project using Notecard, and I’m having some trouble with the I2C connection between the Notecard and my microcontroller. I’m using an ESP32-WROOM and the Notecarrier XS with the Notecard WiFi (v2.1) and a Starnote. The MCU and Notecarrier are powered separately through USB power, and the two are connected through the QWIIC port on the Notecarrier, as shown below.

I’ve tested the Notecard on it’s own by following the setup guide, and it has no issues, but the problem arises when I try to send messages from the MCU. Or rather, when the MCU tries to receive messages from the Notecard. The MCU is capable of sending a message to the Notecard, and that message is sent on to Notehub, but the MCU starts throwing errors in the serial log about not being able to receive from the Notecard:

[ERROR] serial-over-i2c|rx: unexpected protocol byte count {io}{i2c}
[WARN] i2c: reattempting to read Notecard response
[ERROR] serial-over-i2c|rx: unexpected protocol byte count {io}{i2c}
[WARN] i2c: reattempting to read Notecard response

These errors will repeat over and over, and sometimes the MCU will even resend the message to the Notecard. I have searched this forum for similar issues and have tried the solution from a similar problem of adding 10k pullup resistors to the SDA and SCL lines, but the result did not change. It may be worth noting that I have in rare cases seen the MCU send a few of these errors when first powering on, before sending a request and receiving the response just fine, but this is rare.

Also, for reference, the code I am using is shown below. If it’s important, my firmware and arduino libraries are up to date.

#include <Notecard.h>

#define usbSerial Serial

Notecard notecard;

void setup() {
  delay(2500);
  usbSerial.begin(115200);
  
  notecard.begin();
  notecard.setDebugOutputStream(usbSerial);

  delay(2500);

  J *req = notecard.newRequest("hub.sync");
  if (req != NULL) {
    notecard.sendRequest(req);
  }
}

void loop() {

}

I removed all of the sensors and other parts of the project and simplified the code as much as possible so I could isolate this issue. As I mentioned above, I’m able to send data to Notehub, so I’ve been able to upload sensor data despite this issue, but I can only do so once since the MCU will get stuck looping on these errors.

Any help would be appreciated.

1 Like

eddy_w,

Just wondering on the I2C lines you have pull-ups?

Warm Regards,
Rob Oudendijk