Matrix Portal M4 Error

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
sunbake
 
Posts: 8
Joined: Sat May 21, 2022 3:24 am

Matrix Portal M4 Error

Post by sunbake »

Been following this tutorial using the hardware listed on it, but I'm not getting the Creature Eyes.
https://learn.adafruit.com/matrix-porta ... s/overview

The attached image shows what is displayed instead.
display.jpg
display.jpg (838.71 KiB) Viewed 210 times
It works fine when running the sand demo: https://learn.adafruit.com/adafruit-mat ... -dust-demo
What am I doing wrong?

User avatar
dastels
 
Posts: 15819
Joined: Tue Oct 20, 2015 3:22 pm

Re: Matrix Portal M4 Error

Post by dastels »

If it runs the sand demo ok then the hardware is connected correctly and functioning.

You're seeing the circuitPython "terminal" output. The code isn't running for some reason. I suspect some file missing.

Can you post what you see in the REPL when the code runs? That should give a better idea of what's happening.

If you aren't familiar with using the REPL (or even just the serial connection), see
https://learn.adafruit.com/welcome-to-c ... al-console
https://learn.adafruit.com/welcome-to-c ... al-console
https://learn.adafruit.com/welcome-to-c ... n/the-repl

Dave

User avatar
sunbake
 
Posts: 8
Joined: Sat May 21, 2022 3:24 am

Re: Matrix Portal M4 Error

Post by sunbake »

Thank you for the links!

This is what is shown in the REPL:

Code: Select all

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 68, in <module>
  File "code.py", line 56, in __init__
AttributeError: 'Sprite' object has no attribute 'height'

Code done running.
Again the code used is directly from here:
https://learn.adafruit.com/matrix-porta ... d-graphics

User avatar
dastels
 
Posts: 15819
Joined: Tue Oct 20, 2015 3:22 pm

Re: Matrix Portal M4 Error

Post by dastels »

Are you running the latest version (7.3.0) of CircuitPython and the libraries/modules from the latest bundle?

If you need to update the contents of the CIRCUITPY/lib directory, be sure to delete everything in it first, empty trash, then copy in the latest.

Dave

User avatar
ntynen
 
Posts: 19
Joined: Sat May 28, 2022 10:15 pm

Re: Matrix Portal M4 Error

Post by ntynen »

I too am seeing this same error. I have downloaded the latest bundle and installed into the previously empty lib directory.

>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File "<stdin>", line 68, in <module>
File "<stdin>", line 56, in __init__
AttributeError: 'Sprite' object has no attribute 'height'
>>>

User avatar
dastels
 
Posts: 15819
Joined: Tue Oct 20, 2015 3:22 pm

Re: Matrix Portal M4 Error

Post by dastels »

Digging deeper I see that the complaint is about the assignment to height which generally is not the case. The "no attribute"error is typically when you access an attribute that isn't there. Assigning it is how it gets created. I'm looking into it.

Dave

User avatar
sunbake
 
Posts: 8
Joined: Sat May 21, 2022 3:24 am

Re: Matrix Portal M4 Error

Post by sunbake »

dastels wrote:Are you running the latest version (7.3.0) of CircuitPython and the libraries/modules from the latest bundle?

Dave
Yes, I am running the latest version (7.3.0) including the latest libraries/modules. I'm only using the recommended libraries that was listed in the tutorial including the 'adafruit_imageload'. The list is found here:
https://learn.adafruit.com/matrix-porta ... thon-setup

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: Matrix Portal M4 Error

Post by neradoc »

Tilegrid has its own height property now, which is read only and can't be overridden by a subclass because it's a builtin.
Try removing line 56: "self.height = bitmap.height".

User avatar
sunbake
 
Posts: 8
Joined: Sat May 21, 2022 3:24 am

Re: Matrix Portal M4 Error

Post by sunbake »

neradoc wrote:Try removing line 56: "self.height = bitmap.height".
Oh wow, it works perfectly! Thank you so much!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”