Comments (15)
from pi_ina219.
@chrisb2 sorry to at you but this is important for its use
from pi_ina219.
Code and circuit look good. Please can you check that the device is visible on the i2c bus with:
sudo i2cdetect -y 1
as explain in https://learn.adafruit.com/scanning-i2c-addresses/raspberry-pi, you should see it at address 0x40.
Just checking but have you enable i2c as described in https://www.raspberrypi-spy.co.uk/2014/11/enabling-the-i2c-interface-on-the-raspberry-pi/.
Chris
from pi_ina219.
I2C is enabled and when running i2cdetect -y 1
the sensor is detected on 0x40
from pi_ina219.
Searching in Google it seems the OSError: [Errno 121] Remote I/O error
error is a pain to track down. Here are a few questions, sorry if you have already thought of some of these:
- How long are leads between the Pi and the ina219?
- Is the circuit diagram accurate or just a representation (sometimes the issue is something small)?
- What version of Pi OS are you running (
cat /etc/os-release
)?
Things to Try
Add the following delay before you call ina.configure()
in your program:
utime.sleep_ms(10)
Verify all the wires to the device are good and joints are solid? Are they soldered (dry joints?), or is this a prototype board (dodgy connection?)?
from pi_ina219.
The leads are about 10cm long, and the circuit diagram is accurate minus the light and 12V battery.
when running cat /etc/os-release
:
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
I'm having issues with installing utime so i used time.sleep(0.01)
instead but no luck.
All wires are solid dry joints.
from pi_ina219.
Maybe try sleep(1).
Using a Pi 4B and latest Bullseye and a simple circuit like yours except bulb is a LED and series resistor powered from Pi 5V, I can make a measurement using example.py with busnum=1. I think it most likely the issue is something to do with your circuit, can you try the following to try and eliminate where:
- In your circuit what happens it you disconnect the load and make a measurement?
- Replace your existing load under measurement with an LED and resistor power from Pi 5V (so same as my setup). Does this work?
- If it does not work, that might indicate an issue with the ina219 breakout itself. If you have spare, trying swapping to it in the LED circuit.
- If it does work, then there must be some issue with your actual load, perhaps you can use a process of elimination to try and work out the problem? If you have a logic analyzer this might be the time to use it.
Chris
from pi_ina219.
- Same error.
- The LED lights but the error persists.
- I have not got any spare (soldered) boards currently.
Also the LED only lit when connecting to the screw terminals not the header (they should be the same?)
from pi_ina219.
Header should work same as terminals. If you use a magnifying glass do the tracks look OK, or use a multimeter to check tracks.
Given LED circuit is not working its beginning to sound like your ina219 has a problem. So we are clear, below is a sketch of my LED circuit.
Chris
from pi_ina219.
To be clear, the LED does work now, yes, and I am using a separate power source with the ground shared with the pi.
from pi_ina219.
So you can measure current and voltage with LED circuit?
from pi_ina219.
The LED lights, but the board gives the same error.
from pi_ina219.
So I think your ina219 has a problem, I have never seen this simple led circuit fail with my library. The LED is always going to light unless the shunt resistor is dead, the ina219 chip on the breakout is another matter. I think you need to obtain a new breakout.
from pi_ina219.
Oh alright. I'll resolder another one and try then. Probably later today.
from pi_ina219.
After soldering a new board and closely inspecting the old one to see the ground pin wasn't even soldered on, it works! Thank you so much. Have a great day/evening what be it.
from pi_ina219.
Related Issues (20)
- issue with code
- Johnny Five Plugin HOT 3
- Calculation of "current" for negative "shunt_voltage" HOT 10
- Current overflow false positive HOT 7
- cannot import name INA219 HOT 5
- Citation HOT 1
- Use named logger instead of root HOT 5
- getting [Errno 121] Remote I/O error? HOT 8
- Unable to get ADC_16SAMP (or any of the others to work) HOT 2
- ImportError: cannot import name INA219 HOT 8
- improbable values returned?
- Convert from Adafruit_GPIO library (which is archived) to smbus2 library HOT 2
- Reading current samples from python while INA219 is connected to Arduino board HOT 1
- ina219.DeviceRangeError: Current out of range I have got exactly the same problem when trying to install Raspberry PI i52 UPS Plus HAT. Device is called EP-0136 HOT 1
- Problem with this on a Pi Pico HOT 7
- Force library to use specified logging level HOT 1
- not working on raspberrypiOS 32 bit HOT 1
- No change in resolution or time when changing ADC samples and bit HOT 5
- Library depends on obsolete dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pi_ina219.