I’ve been playing with my new XBees for few days, and I’m enjoying them a lot
I’m now trying to deal with the I2C bus and with micropython.
I’m then facing some difficulties.
My configuration is the following :
When I open the micropython terminal on one of my end devices, the I2C.scan method works well :
>>> from machine import I2C
>>> i2c = I2C(1)
[25, 60, 119]
But when I try to exchange more in detail with one of the I2C device, it doesn’t works
>>> i2c.readfrom_mem(0x77, 0xD0, 2)
Traceback (most recent call last):
File “”, line 1, in
OSError: [Errno 7019] ENODEV
I’ve been trying to format the flash (both with XCTU and with micro python) without any kind of success.
I’m sure that I’m doing something wrong, but what ? Can someone help me ?
Have you simply opened the file manager in XCTU and tried formatting the file system from there without having the Terminal open or connected?
Yes I did
I tried with only the file manager (with and without having discovered the module) and with micro python.
Where you ever able to fix that issue?
I’ve paused developing with my XBees for some months and everything was working, could deal with 5 different I2C devices at once.
Now I’m trying to get back to the development and I’m getting “OSError: [Errno 7019] ENODEV” all the time, tried different XBees, different sensors, different development boards… Changed cables… I really don’t know what else to try.
I would suggest restoring to defaults. Then follow the steps for the example Digi offers for I2C.
Thanks for the suggestion @mvut.
Today I was investigating this further and changed the only piece that I hadn’t changed yet, the computer.
I moved from my Macbook Pro M1 Max to my wife’s Dell Inspiron with Windows 11 installed, and it worked!!
I tested the voltage and with the Mac I’m getting 3.51v whereas with the Dell I’m getting 3.3v.
Although the XBee I’m using is rated to work up to 3.6V, apparently when using I2C this doesn’t apply.
Certainly there has been an update in the past months for the Mac/MacOS that changed something in regard to USB power.
The development board I’m using does a very poor job regulating the voltage. It is a very cheap one.
I’ve tried to get the XBee Grove Development Board, but it was confiscated by the customs of my country, I’ll try to buy a different dev board.
I would suggest contacting your Digi regional Sales office or a local Distributor.
It seems like the issue is related to the I2C device not being recognized by your end device. Here are some troubleshooting steps you can try:
- Make sure the I2C device is properly connected to your end device and that the wiring is correct.
- Check if the I2C device has the correct address. You are trying to read from memory address 0xD0 on device address 0x77, so make sure that is the correct address for your device. You can check the device’s datasheet or manual for this information.
- Try using a different I2C device to see if the issue is with your current device or with your setup.
- Double-check your code to make sure there are no errors or typos in the device address or memory address.
If none of these steps work, it may be helpful to reach out to the manufacturer of your XBee or I2C device for further assistance. book a pick up
It is really the voltage @EthanWalker!
I had the software tested and properly working for months now, with at least 4 different I2C devices.
Without changing anything else, just taking my setup to a different computer providing proper 5V via USB port, everything works.
My Mac after a recent upgrade started providing 5.35V through the USB ports instead of 5V, and my cheap development board couldn’t regulate it to 3.3V, it “regulates” to 3.51V. It certainly uses a constant step down rate.
The XBee doesn’t regulate it either, I’ve measured the voltage on the SCL and SDA lines and both were reading the same 3.51V of the main input.
Everything else works, uploading and running code, dealing with devices via UART, formatting the file system, reading/changing parameters via XCTU or via MicroPython code, Network discovery, etc., etc., etc.
I2C seems to be very sensitive to the voltage. I was getting all sorts of errors, not finding the devices, when finding them, the information read from device registers that should be constant would return random values, ENODEV and ETIMEDOUT happening very often and intermittently.
I’m no electronic expert, but the conclusion seems to be quite obvious.
This article explains in more details the required voltage levels for I2C to work.
The error message “OSError: [Errno 7019] ENODEV” indicates that the I2C device at the address 0x77 is not responding or is not present on the bus. This could be due to a wiring issue, a problem with the device itself, or a software issue.
Here are a few things you can try to troubleshoot the problem:
- Check your wiring: Ensure that the I2C device is connected properly to the XBee end device and that the connections are not loose or short-circuited. Double-check the device’s address to make sure it matches the address you’re trying to read from.
- Check the power supply: Make sure that the I2C device is receiving enough power to function properly. Some devices may require a separate power supply or voltage regulator.
- Check the I2C bus frequency: Make sure that the I2C bus frequency is set correctly for the device you’re trying to communicate with. Some devices may require a specific frequency or timing.
- Try a different I2C device: If possible, try communicating with a different I2C device to make sure that the problem is not with your XBee end device or your Micropython code.
Hopefully, one of these steps will help you identify and resolve the issue. Good luck!
For the record, I was finally able to get a Digi Grove Board, just to find out that it’s voltage regulation is also constant, so I’m still getting 3.52V on the VCC and I2C pins, therefore I2C doesn’t work.
The whole problem is the Macbook, next step is to try an USB hub connected to the computer.
I know this one is stale, but I came across it and I will put in my two cents. I had similar issues a few years back. Was using a simple Bosch BME280 sensor with an XBee3. My troubles related back to the wiring. I made the mistake of using our standard 4 conductor sensor cable and it caused a lot of strange errors. I switched to ribbon cable and all the problems went away. If you are using simple run-of-the-mill jumper wires, those should work great. I2C also doesn’t like long wire lengths because of the issue you mentioned - voltage drops.