This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
INA219 directly on i2c of Pi without ESP8266
#8
(2020-02-07, 12:37 PM)Sailoog Wrote: buff I did not remember we had already done this Smile

forget that script, that is for OP1 and pyhon2

For OP2 you have to install ina219 module for python3:

sudo pip3 install pi-ina219

Haha! No worries, happens to the best of us.  Tongue

I am running 1.2.0 alpha, and installed both:

sudo pip install pi-ina219
sudo pip3 install pi-ina219

When trying the corresponding commands I get:

Python command:


Code:
pi@openplotter:~/.openplotter/tools/ina219 $ sudo python ina219.py
Traceback (most recent call last):
  File "ina219.py", line 3, in <module>
    from ina219 import INA219
  File "/home/pi/.openplotter/tools/ina219/ina219.py", line 3, in <module>
    from ina219 import INA219
ImportError: cannot import name INA219

Python3 command:


Code:
pi@openplotter:~/.openplotter/tools/ina219 $ python3 ina219.py
  File "ina219.py", line 19
    print home+'/.openplotter/openplotter_analog.conf'
             ^
SyntaxError: Missing parentheses in call to 'print'

Can I still make it work in 1.2.0. alpha? I can't upgrade that easily to 2.  Sad Have it running on a Pi 4 with 4GB to test, but my main system is still 1.2.0 for a while.

Hope you can help!
Reply


Messages In This Thread
RE: INA219 directly on i2c of Pi without ESP8266 - by jamos.tan@gmail.com - 2020-02-07, 03:36 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)