![]() |
|
Error processing ADS1015: has no attribute 'P0' - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1) +--- Forum: Bug Reports (https://forum.openmarine.net/forumdisplay.php?fid=4) +--- Thread: Error processing ADS1015: has no attribute 'P0' (/showthread.php?tid=6627) Pages:
1
2
|
Error processing ADS1015: has no attribute 'P0' - Mitch C - 2026-01-11 So after getting the i2c service running following the advice in this thread: I2C service not running ...Work Around I now have the below error with my ads1015: Checking I2C sensors... | service running | I2C enabled | Access to Signal K server validated ↳Error processing ADS1015: module 'adafruit_ads1x15.ads1015' has no attribute 'P0' Spent a little time with the AI help bots, but honestly they were taking me down a rabbit hole that I just wasn't comfortable following fearing I would break my 99% working setup. Does anybody "human" have any thoughts on how to resolve the no attribute 'P0' error? Hope it's an easy fix :-( Thanks Mitch - (53 year old sailor not computor programmer )
RE: Error processing ADS1015: has no attribute 'P0' - PaddyB - 2026-01-11 (2026-01-11, 06:42 PM)Mitch C Wrote: Does anybody "human" have any thoughts on how to resolve the no attribute 'P0' error? Only what a good Ai will find - Perplexity says there was a fairly recent library change which might have broken it. Try pip list | grep ads1x15 in a terminal to see what version your library is, might be a smoking gun to look at first Quote: Discussion and implementation in late 2024 (around the v3.0 release cycle) aimed to further clean up these imports by moving constants like P0 into an enum-like Pin class RE: Error processing ADS1015: has no attribute 'P0' - Mitch C - 2026-01-17 (2026-01-11, 07:14 PM)PaddyB Wrote:(2026-01-11, 06:42 PM)Mitch C Wrote: Does anybody "human" have any thoughts on how to resolve the no attribute 'P0' error? Result is: adafruit-circuitpython-ads1x15 3.0.2 After antoher session with Perplexity, I still have the error. The steps below that AI recommended: I tried option 1 as I don;t want to break my 99% running system. Any other thioughts on how tio define the P0 within Openplotter? That E: Unable to locate package ... just means OpenPlotter’s underlying Debian/Raspberry Pi OS does not ship a python3-adafruit-circuitpython-ads1x15 apt package, so you need to use pip instead of apt for this library. Because your Python is “externally managed”, there are two realistic options on an appliance image like OpenPlotter. Option 1 – Install via pip for your user (safer) Install the library into your user’s site-packages and avoid touching system packages: bash pip3 install --user adafruit-circuitpython-ads1x15 If you still hit the “externally managed” error, add the override: bash pip3 install --user adafruit-circuitpython-ads1x15 --break-system-packages This follows Adafruit’s recommendation to install from PyPI on Raspberry Pi, while using the PEP 668 override. After this, restart Signal K so its Python helper sees the new package: bash sudo systemctl restart signalk Option 2 – System-wide via pip (more intrusive) If OpenPlotter’s Signal K tools run strictly under the system Python and do not see user-site packages, you may need to go system-wide: bash sudo pip3 install adafruit-circuitpython-ads1x15 --break-system-packages This is exactly the pattern documented for Raspberry Pi plus the --break-system-packages flag to bypass the externally managed guard. Again, restart Signal K afterwards. After installing Once the library is present, your remaining ADS1015 issue is the missing P0 constant. You can: Update the plugin/code to use integer channels (0–3) instead of P0–P3, or Import/define P0–P3 yourself as described earlier. RE: Error processing ADS1015: has no attribute 'P0' - PaddyB - 2026-01-17 (2026-01-17, 07:10 PM)Mitch C Wrote: Result is: Sorry, no, sounds like might be a bug. Quick search says the adafruit library is the latest version. ![]() I haven't gone that route before in OP for ADS1x15 so not sure how much assistance I can be. Downloaded the code from github into vscode & let copilot have a good look around then gave it your error, came up with.. Quote:The issue was that the code was trying to access pin constants (P0, P1, etc.) from the ADS11 and ADS10 modules, but these constants are actually defined in the parent adafruit_ads1x15.ads1x15 module. If you want to give it a go I could send the updated i2c_read file to try, can't see what damage it could other than more error messages & frustration ![]() The grownups are usually not far off if their not too busy so someone who knows for sure might come along RE: Error processing ADS1015: has no attribute 'P0' - Mitch C - 2026-01-24 [quote pid="35717" dateline="1768680269"] If you want to give it a go I could send the updated i2c_read file to try, can't see what damage it could other than more error messages & frustration ![]() The grownups are usually not far off if their not too busy so someone who knows for sure might come along [/quote] Sorry for the slow reply - been at the Dussledorf boat show for a few days - highly recommended if you've never been!! I'm happy to try the updated i2c file - as you say it could work or it could trigger more errors. If its the later I can revert back to the originasl until the grown ups come and help :-) Thanks for the support, Mitch RE: Error processing ADS1015: has no attribute 'P0' - penot.gilles - 2026-01-25 (2026-01-24, 07:36 PM)Mitch C Wrote: [quote pid="35717" dateline="1768680269"] Sorry for the slow reply - been at the Dussledorf boat show for a few days - highly recommended if you've never been!! I'm happy to try the updated i2c file - as you say it could work or it could trigger more errors. If its the later I can revert back to the originasl until the grown ups come and help :-) Thanks for the support, Mitch [/quote] I'am interested by your update file to test it, where can I find it? RE: Error processing ADS1015: has no attribute 'P0' - leif_klasson@hotmail.com - 2026-03-25 Same problem, any updates? Tried the suggestion above to force an update, not working. Where can I find the files to update? /Leif RE: Error processing ADS1015: has no attribute 'P0' - bobcat - 2026-05-01 openplotter4 on Rpi4 with update from a month ago same problem wolfgang RE: Error processing ADS1015: has no attribute 'P0' - bobcat - 2026-05-02 it seems the name of the inputs is defined in /usr/local/lib/python3.11/dist-packages/adafruit_ads1x15/ads1x15.py class Pin: """An enum-like class representing possible ADC pins.""" A0 = 0 """Analog Pin 0""" A1 = 1adafruit_ads1x15.ads1115 """Analog Pin 1""" A2 = 2 """Analog Pin 2""" A3 = 3 """Analog Pin 3""" will try to rename and give update late /wolfgang RE: Error processing ADS1015: has no attribute 'P0' - bobcat - 2026-05-08 renaming the pins in ads1x15.py as class Pin: """An enum-like class representing possible ADC pins.""" A0 = P0 """Analog Pin 0""" A1 = P1 """Analog Pin 1""" A2 = P2 """Analog Pin 2""" A3 = P3 """Analog Pin 3""" did not solve the problem the same error persists anybody out there who may solve this ? |