Working on a project using the Raspberry Pi 5 and the Notecard WiFi Chip. I’m using this small python3 code:
import notecard, smbus2
bus = smbus2.SMBus(1)
card = notecard.OpenI2C(bus, 0x17, 0)
rsp = card.Transaction({"req":"card.version})
print(rsp)
Running this gives me an “Exception: Failed to reset Notecard” and the error says it is coming from “notecard.OpenI2C(bus, 0x17, 0)”. Is there already a forum that I just didn’t see that talks about this?
Also for more background information:
I have confirmed that there is power going to the chip, when doing “i2cdetect -y 1” I can see that port 0x17 is being used. And the pins being used are GPIO 2 + 3 (pins 3 + 5).
For the libraries, I’m using smbus version 0.5.0 and note-python version 2.1.1
Any help would be much appreciated.
Hey @smullbw,
And welcome to the Blues community! Sorry you ran into issues here.
I’d recommend going through our Pi sensor tutorial if you haven’t already, as it walks through the steps necessary to establish an I2C connection.
The I2C code you have there differs a bit from what we have in our standard tutorial, which looks more like this:
import notecard
from periphery import I2C
port = I2C("/dev/i2c-1")
card = notecard.OpenI2C(port, 0, 0)
I’d give that a shot and let me know if you’re still getting the same error.
TJ
hey @tjvantoll thanks for the link to the page. I gave that a try and I’m still getting the same error.
This is my exact code(minus the product id):
import json
import notecard
import notecard_pseudo_sensor
from periphery import I2C
import time
productUID = "my_product_id"
port = I2C("/dev/i2c-1")
card = notecard.OpenI2C(port, 0, 0)
req = {"req": "hub.set"}
req["product"] = productUID
req["mode"] = "continuous"
print(json.dumps(req))
rsp = card.Transaction(req)
print(rsp)
and I am still getting “Exception: Failed to reset Notecard.” and the traceback showing it originated from the notecard.OpenI2C(port, 0, 0)
I went through and did the configuring pi settings too.
i2cdetect -y 1 is still showing up at 0x17, all the switches on the notecarrier are also turned off.
Hmmm, that code definitely looks fine.
A couple other questions:
- Are you using a Notecarrier Pi to connect your Pi and Notecard together?
- Are you able to connect to your Notecard through the In-Browser Terminal (In-Browser Terminal - IoT Connectivity at Blues) and send commands? (If you’re not sure how to do this go through the Notecard quickstart.
- What version of the Notecard firmware are you running? (You can find this by running a
{"req":"card.version"} request in the In-Browser Terminal.)
TJ
Hey @tjvantoll
Yes I am using the Notecarrier Pi to connect my Pi and Notecard together.
I was able to connect to the notecard through the in-browser terminal and send a command to it.
This is what I got from that:
> {"req":"card.version"}
{
"version": "notecard-9.2.3.17324",
"device": "hidden",
"name": "Blues Wireless Notecard",
"sku": "NOTE-ESP",
"ordering_code": "hidden",
"board": "4.0",
"wifi": true,
"body": {
"org": "Blues Wireless",
"product": "Notecard",
"target": "s3",
"version": "notecard-s3-9.2.3",
"ver_major": 9,
"ver_minor": 2,
"ver_patch": 3,
"ver_build": 17324,
"built": "Aug 11 2025 12:07:58"
}
}
Hey @smullbw,
If I2C isn’t working we could give serial a shot. It used to be easy to use serial on the Pi, but there were some changes with the Pi 5 that made it more complex.
I’ve got to step away for the day but I’ll get it running on my Pi tomorrow and give you the steps here.
TJ
Hi @smullbw
Jumping in here for TJ, we would recommend using Serial between the Raspberry Pi 5 and the Notecard as I2C can be a bit finicky due to timing issues and how I2C is implemented on the Raspberry Pi 5.
To configure the Pi 5 for serial communication with your Notecard you will need to set a couple of options in the config.txt file.
Setting dtoverlay=uart0will enable uart0 on the Pi 5’s 40 pin header. A concern with this is that you won’t be able to use uart0 for the serial console (you may need to set enable_uart=0 in the config.txt to disable the serial console, if you had previously set it).
Once this has been set on the Raspberry Pi 5, you’ll need to reboot it and set the Serial TXRX DIP switch on the Notecarrier Pi to ON.
Let us know how you get on with these changes.
Thanks,
Alex
1 Like