First try Pico + MicroPython + CarrierB + NotecardWifi

First attempt at using Blues. I followed the online tutorials and got the notecard/wifi setup and talking to notehub. But can’t seem to get the Pico connected to the Notecard.

I am using:

  • Raspberry Pi Pico H
  • CarrierB
  • Notecard WiFi

CarrierB is connected to the Pico like so:
GND → GND
VBAT → 3V3
SCL → GP3
SDA → GP2

If I run the myp_example.py code with:
product_uid = “com.gmail.quietlife4me2:mwue”
use_uart = False

I get the following output:

Opening port…
Opening Notecard…
Resetting Notecard I2C communications.
Serial-over-I2C error: reported data length (2) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Serial-over-I2C error: reported data length (0) differs from actual data length (2).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Using transaction timeout of 30 seconds.
{“mode”:“continuous”,“body”:{“os_family”:“Raspberry Pi Pico with RP2040”,“req_interface”:“i2c”,“os_name”:“micropython”,“os_platform”:“rp2”,“agent”:“note-python”,“os_version”:“3.4.0; MicroPython v1.23.0 on 2024-06-02”,“req_port”:0},“product”:“com.gmail.quietlife4me2:mwue”,“req”:“hub.set”,“crc”:“0000:a5d56fc0”}
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Resetting Notecard I2C communications.
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Serial-over-I2C error: reported data length (47) differs from actual data length (0).
Notecard not responding to newline during reset.
Retrying reset…
Traceback (most recent call last):
File “”, line 86, in
File “”, line 67, in run_example
File “”, line 29, in configure_notecard
File “notecard/notecard.py”, line 321, in Transaction
File “notecard/notecard.py”, line 824, in Reset
Exception: Failed to reset Notecard.

i2c.scan returns:

i2c devices found: 1
I2C hexadecimal address: 0x17

I switch the wiring to UART and now the example works…what the heck.

Opening port…
Opening Notecard…
Resetting Notecard serial communications.
Using transaction timeout of 30 seconds.
{“mode”:“continuous”,“body”:{“os_family”:“Raspberry Pi Pico with RP2040”,“req_interface”:“serial”,“os_name”:“micropython”,“os_platform”:“rp2”,“agent”:“note-python”,“os_version”:“3.4.0; MicroPython v1.24.1 on 2024-11-29”,“req_port”:“UART(1, baudrate=9600, bits=8, parity=None, stop=1, tx=4, rx=5, txbuf=256, rxbuf=256, timeout=3000, timeout_char=100, invert=None, irq=0)”},“product”:“com.gmail.quietlife4me2:mwue”,“req”:“hub.set”,“crc”:“0000:2db1a51b”}
Response has error field indicating I/O error: {‘err’: ‘CRC error in request {crc} {io} {io}’}
{‘crc’: ‘0000:A3A6BF43’}
Using transaction timeout of 30 seconds.
{“req”:“card.temp”,“crc”:“0001:ce0d7edd”}
{‘crc’: ‘0001:E2F7589A’, ‘value’: 25.125, ‘calibration’: -1}
Using transaction timeout of 30 seconds.
{“req”:“card.voltage”,“crc”:“0002:d020fd9e”}
{‘minutes’: 1, ‘crc’: ‘0002:45975882’, ‘mode’: ‘normal’, ‘value’: 3.33}
Using transaction timeout of 30 seconds.
{“body”:{“voltage”:3.33,“temp”:25.125},“sync”:true,“req”:“note.add”,“crc”:“0003:098be7f9”}
{‘crc’: ‘0003:3EE67BF0’, ‘total’: 2}
Example complete.

Hi @quietlife4me2 ,

I’m looking into this for you, it sounds like something might be broken with the I2C implementation. Let me check this out and get back to you!

Thanks,
Alex

Hi @quietlife4me2,

I was able to reproduce something that I think is similar to your issue; sometimes the hardware I2C on the pico can lock up when an address isn’t found (see Raspberry Pi’s note on page 17). I wasn’t able to communicate with the Notecard until I reset the rpi pico. The mpy_example.py works for me out of the box when setting use_uart=False and connecting the SCL to GP7 and SDA to GP6 (for I2C1).

Let me know if you’ve been able to resolve this,

Thanks,
Alex

1 Like

I’ll test tonight when I’m back at the bench. Thanks!

Any particular reason to prefer I2C over UART?

No particular reason, both are fully supported. One consideration is that I2C is an extensible bus (you can add additional sensors/peripherals to it) but if you use UART then you’ve consumed one of the 2 available UART interfaces on the Pico!

With your pointer I figured out exactly what the problem was. And you are correct. I did the following just now…

  • Plug in the PICO with wires connected to I2C
  • Run mpy_example.py “out of the box” with UART set to True [Incorrect setting]
  • See the error messages
  • Switch use_uart to False
  • Run it again
    ^ I done screwed up at this point.
  • I get the same errors as above.

I didn’t “reset” the PICO. Once I “reset” the PICO it worked fine. It’s like the PICO has some kind of “memory” that it just does not want to get rid of easily. Even after you tell it to run a different program.

2 Likes