8000 AttributeError: 'PixelBuf' object has no attribute '_transmit' · Issue #4682 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

AttributeError: 'PixelBuf' object has no attribute '_transmit' #4682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
makermelissa opened this issue Apr 27, 2021 · 13 comments
Closed

AttributeError: 'PixelBuf' object has no attribute '_transmit' #4682

makermelissa opened this issue Apr 27, 2021 · 13 comments
Assignees
Milestone

Comments

@makermelissa
Copy link
Collaborator

When resuming from light sleep, the code crashes with this error:

Traceback (most recent call last):
  File "code.py", line 44, in <module>
  File "/lib/adafruit_funhouse/__init__.py", line 122, in enter_light_sleep
AttributeError: 'PixelBuf' object has no attribute '_transmit'

I'm not sure what happened since I had previously tested this, but will fix it as soon as I can figure out what is going on.

@makermelissa makermelissa self-assigned this Apr 27, 2021
@makermelissa
Copy link
Collaborator Author

Ok, this seems to only happen when I compiled CircuitPython on my machine. The issue does not exist in 6.2.0.

@makermelissa
Copy link
Collaborator Author

Also, this occurred at any time when trying to set the dotstar values.

@makermelissa makermelissa changed the title AttributeError: 'PixelBuf' object has no attribute '_transmit' when entering light sleep AttributeError: 'PixelBuf' object has no attribute '_transmit' Apr 27, 2021
@makermelissa
Copy link
Collaborator Author

Ok, I looked at the boot out and it appears I have compiled on the 7.0.0 branch, so this is likely a 7.0.0 CircuitPython bug.

@makermelissa makermelissa transferred this issue from adafruit/Adafruit_CircuitPython_FunHouse Apr 28, 2021
@makermelissa
Copy link
Collaborator Author
makermelissa commented Apr 28, 2021

According to @kattni, this issue has reportedly been seen on the Saola and QT Py M0 Haxpress. I observed in on the FunHouse.

@anecdata
Copy link
Member
anecdata commented Apr 28, 2021

This appeared for me after 7.0.0 (Saola, but suspect it isn't port-dependent), never saw it in 6.2.0 on any device.

Adafruit CircuitPython 7.0.0-alpha.1-790-gaaba6e082-dirty on 2021-04-27; Saola 1 w/Wrover with ESP32S2
>>> import board
>>> import neopixel
>>> status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.05, pixel_order=neopixel.GRB)
>>> status_light[0] = (0, 0, 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'PixelBuf' object has no attribute '_transmit'

@Neradoc
Copy link
Neradoc commented Apr 28, 2021

fill does not cause the bug in the same version I encountered it:

Adafruit CircuitPython 7.0.0-alpha.1-844-g9e183bbbb on 2021-04-27; Adafruit QT Py M0 Haxpress with samd21e18
>>> import board
>>> import neopixel
>>> pix = neopixel.NeoPixel(board.NEOPIXEL,1)
>>> pix.fill((0,255,0)) # lights up green
>>> pix[0] = (255,0,0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'PixelBuf' object has no attribute '_transmit'

@hierophect
Copy link
Collaborator

I'm running into this now that all the 6.2 mpy files are deprecated for 7.0.0

@jerryneedell
Copy link
Collaborator
jerryneedell commented Apr 29, 2021

FYI -- I was able to "workaround" this on a FunHouse by using adafruit_pypixelbuf in adafruit_dotstar instead of _pixelbuf
That is, in adafruit_dotstar, just import adafruit_pypixelbuf as _pixelbuf
It now works with 7.0.0 (tip of main)

"works" may be an overstatement. It does not throw the error, but there are still some issues controlling the pixels on the Funhouse. When setting the brightness, not all of the pixels respond reliably.

@dunkmann00
Copy link

This must have something to do with merging the newer versions of Micropython (#4646, #4649). '_transmit' exists in the Neopixel and Dotstar subclasses, not in _Pixelbuf, which is the superclass. So for some reason instead of searching the subclass type for the transmit function and then searching the _Pixelbuf type, it would seem Circuitpython is only searching _Pixelbuf.

This would also support why 'fill' would work, as it is a function from _Pixelbuf. It is interesting using adafruit_pypixelbuf works, since that would indicate the problem has to do with subclassing a native type from Circuitpython, but not something written in Python.

If @tannewt has plans to continue to merge the newer versions of Micropython perhaps this will be fixed in one of those?

@makermelissa
Copy link
Collaborator Author

Makes sense. Last I heard he is planning to continue. If it doesn't fix it, then it would make more sense to address this issue after that is finished so it doesn't break again.

@kattni
Copy link
kattni commented Apr 29, 2021

Yes, the plan is to merge though the current version. As there is no 7.0.0 release yet, I agree we should wait to address this issue until we're done merging MicroPython.

@tannewt
Copy link
Member
tannewt commented Apr 29, 2021

@jepler Is looking at this. _transmit is usually on the subclass (not PixelBuf) so it's likely a bug with the attribute lookup.

@jerryneedell
Copy link
Collaborator

I believe this was resolved by #4688 -- OK to close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants
0