I2C errors when using Mojo

I’ve been using a Mojo on my dev setup for a week or so. At first it worked perfectly fine, but now I’m getting constant i2c errors when requesting “card.power”. The other commands seem to work fine.
I’m using an esp32 running espidf v5.4, note-c v2.3.1, and note firmware 8.1.3.17044 on a Notecarrier F v1.3
Any idea’s what the issue could be? I’m polling the mojo every ~7 minutes or so. Is there a minimum time between card.power requests ?

Hi @stopper4298 ,

We are happy to welcome you to the Blues forum!

Are you powering your device on a bench top power supply, USB, or a battery?

I’ll try to reproduce your issue, while I wait for you to get back to me.

Cheers,
Zak

Thanks for your quick reply!
I’m using it with a battery plugged in, and I have the feather plugged into the computer via usb. I have noticed that the battery voltage reading is not changing at all. I’d at least expect the voltage to drop very slowly

Okay, I think understand your setup enough to attempt a repro.

To further refine my understanding, can you answer these questions?

  • Are you using the Adafruit ESP32 Huzzah Feather, or something different?
  • Which type of Notecard are you using?
  • Do you have any other peripherals plugged into the I2C than the MoJo?

I’ll reproduce it first thing in the morning and I’ll get back to you with my findings.

Best,
Zak

  • Are you using the Adafruit ESP32 Huzzah Feather, or something different?

Correct, ESP32 Huzzah Feather v1

  • Which type of Notecard are you using?

Notecard v2.1 black - NOTE-WBNAW, cellular + wifi

  • Do you have any other peripherals plugged into the I2C than the MoJo?

Feather, Notecard, Mojo are the only peripherals on the I2C line. They’re using the default i2c address.

Other info:

I’m using the N_ATTN pin connected to a digital pin on the feather setup with an interrupt, and a few LEDs also controlled by the feather. BLE is enabled on the ESP32. Battery is a 5000mah lipo.

Notecard is in continuous mode with sync set to true.

I2C setup is:

    i2c_master_bus_config_t i2c_mst_config = {
        .i2c_port = I2C_NUM_0,
        .sda_io_num = I2C_MASTER_SDA_IO,
        .scl_io_num = I2C_MASTER_SCL_IO,
        .clk_source = I2C_CLK_SRC_DEFAULT,
        .glitch_ignore_cnt = 7,
        .intr_priority = 0,
        .trans_queue_depth = 0, // only used for asynchronous transactions
        .flags{
            .enable_internal_pullup = false,
            .allow_pd = false, // disallow i2c bus to be disabled for power savings
        }};
    ESP_ERROR_CHECK(i2c_new_master_bus(&i2c_mst_config, &bus_handle));

    i2c_device_config_t dev_cfg = {
        .dev_addr_length = I2C_ADDR_BIT_LEN_7,
        .device_address = NOTE_I2C_ADDR_DEFAULT,
        .scl_speed_hz = 100000,
        .scl_wait_us = 0, // uses register default
        .flags{
            .disable_ack_check = false,
        }};
    ESP_ERROR_CHECK(i2c_master_bus_add_device(bus_handle, &dev_cfg, &dev_handle));

I2C messages are working except for the card.power, which gives me this:

D (2803184) -Notecard-: [INFO] 
D (2803184) -Notecard-: {"req":"card.power","crc":"00F1:4DC601CB"}
D (2803184) -Notecard-: 

E (2803224) i2c.master: s_i2c_synchronous_transaction(918): I2C transaction failed
E (2803224) i2c.master: i2c_master_multi_buffer_transmit(1180): I2C transaction failed
1 Like

@stopper4298 ,

I’ve reproduced your issue :raising_hands:.

Now, I’m onto the slower diagnosing stage.

I’m making progress, but don’t have an answer for you yet.

I just didn’t want to leave you hanging.

Cheers,
Zak

Awesome, really glad to know that I’m not crazy :grin:
Thanks a bunch for your help and the update!

Update going into the weekend.

This has turned into a Heisen-bug! :upside_down_face:

I have been able to faithfully reproduce the issue for 24 hours, and now that I have all the testing equipment hooked to the board, it’s perfectly behaved.

I will keep hammering on this. I was really hoping to have an answer for you going into the weekend.

Best,
Zak

Thanks for the update Zak! Typical it disappears as soon as it’s investigated - nothing is ever easy, is it?

1 Like

Hey @stopper4298,

I am having difficulty reproducing the issue. The board has been acting perfectly for two days now.

Can you send me a picture of your prototype hardware, so I can make sure I have as close a setup as possible?

Thanks,
Zak

Sure, will do tomorrow.
If you remove the testing equipment does the issue return?

Sorry for the delay and please excuse the wire nest.

  • The Mojo is connected to the notecarrier-f via the outermost qwiic port
  • N_ATTN is connected to one of the feathers GPIO pins
  • I have a on-off switch connected to N_EN and GND
  • The rest of the wires are LEDs hooked to the feather
  • I use the feather’s USB port for programming and power
  • The battery is hidden under the notecarrier board

As an aside, I’d definitely appreciate more GND pins on future carrier boards :sweat_smile:

1 Like

Hi @stopper4298

We haven’t forgotten about you!

We have been trying to reproduce the issue. I have been working with other folks in the company, and we are unable to reproduce the issue.

Can we send you a new Notecarrier-F and ESP32 Feather, to see if you can reproduce it for us?

If you can, then we would like for you to send it back to us for forensic analysis. If you are unable to make the new Notecarrier-F repro, then would you be able to send us the board that is reproducing the issue?

We would really like to get to the bottom of the issue.

Best,
Zak