Black Lives Matter - Action and Equality. ... Adafruit joins the Stop Hate for Profit campaign.
0

MotorKit "board not supported" error from Python3???
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MotorKit "board not supported" error from Python3???

by JC_LaFleur on Thu May 28, 2020 11:35 pm

Hello,
I recently purchased a DC & Stepper Motor Bonnet for Raspberry Pi. I have the board installed on a raspberry pi 2 B running the latest updates of Raspbian Buster Lite. I've installed all the packages, dependencies, and tools as per the following tutorials:
https://learn.adafruit.com/adafruit-dc-and-stepper-motor-hat-for-raspberry-pi/overview
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/i2c-sensors-and-devices
https://github.com/adafruit/Adafruit_CircuitPython_Bundle
https://github.com/adafruit/Adafruit_CircuitPython_MotorKit
https://learn.adafruit.com/welcome-to-circuitpython?view=all

I've confirmed that the i2c bus sees something connected...
Code: Select all | TOGGLE FULL SIZE
pi@motortest:~ $ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --                         
pi@motortest:~ $


This is the example code I'm trying to run:
Code: Select all | TOGGLE FULL SIZE
"""Simple test for using adafruit_motorkit with a stepper motor"""
import time
from adafruit_motorkit import MotorKit
 
kit = MotorKit()
 
for i in range(100):
    kit.stepper1.onestep()
    time.sleep(0.01)


However when I try to run code in
Code: Select all | TOGGLE FULL SIZE
Python3
to test a stepper motor I get the following error and nothing happens:

Code: Select all | TOGGLE FULL SIZE
pi@motortest:~ $ sudo python3 motortest.py
Traceback (most recent call last):
  File "motortest.py", line 1, in <module>
    from adafruit_motorkit import MotorKit
  File "/usr/local/lib/python3.7/dist-packages/adafruit_motorkit.py", line 55, in <module>
    import board
  File "/usr/local/lib/python3.7/dist-packages/board.py", line 165, in <module>
    raise NotImplementedError("Board not supported {}".format(board_id))
NotImplementedError: Board not supported None
pi@motortest:~ $


Can someone please tell me if I missed something, or if I'm doing something wrong, or if there's something wrong with the latest CircuitPython package that is causing this problem? I have a fairly good working knowledge of Linux and the raspberry pi, but this is the first time I've really tried using a python driven i2c board and after 2 days of trying to figure this out on my own with posts on this forum and Google searches I'm getting nowhere :-(

Thank you,
JCL

JC_LaFleur
 
Posts: 27
Joined: Thu May 28, 2020 10:29 pm

Re: MotorKit "board not supported" error from Python3???

by adafruit_support_carter on Fri May 29, 2020 12:07 pm

It looks like something happening with the Blinka library. Does the simple sanity check for that still pass OK?
https://learn.adafruit.com/circuitpytho ... 3030038-15

adafruit_support_carter
 
Posts: 15850
Joined: Tue Nov 29, 2016 2:45 pm

Re: MotorKit "board not supported" error from Python3???

by JC_LaFleur on Fri May 29, 2020 5:08 pm

Same error running "pythoin3 blinkatest.py"... something is broken when it tries to "import board"...
Code: Select all | TOGGLE FULL SIZE
pi@motortest:~ $ python3 blinkatest.py
Traceback (most recent call last):
  File "blinkatest.py", line 1, in <module>
    import board
  File "/home/pi/.local/lib/python3.7/site-packages/board.py", line 165, in <module>
    raise NotImplementedError("Board not supported {}".format(board_id))
NotImplementedError: Board not supported None
pi@motortest:~ $


Should the Adafruit_CircuitPython_Bundle be installed in the "/home/pi/.local/lib/python3.7/" folder, or just the "/home/pi/" folder?
What is the "elif board id" for the DC & Stepper Motor Bonnet for Raspberry Pi? I don't see any reference to it in "/home/pi/.local/lib/python3.7/site-packages/board.py". Seems this is where it's having a problem?

JC_LaFleur
 
Posts: 27
Joined: Thu May 28, 2020 10:29 pm

Re: MotorKit "board not supported" error from Python3???

by adafruit_support_carter on Fri May 29, 2020 7:25 pm

That's looking like Blinka is having trouble identifying your specific Pi model for some reason. Can you run this command and paste the output here.
Code: Select all | TOGGLE FULL SIZE
cat /proc/cpuinfo

adafruit_support_carter
 
Posts: 15850
Joined: Tue Nov 29, 2016 2:45 pm

Re: MotorKit "board not supported" error from Python3???

by JC_LaFleur on Fri May 29, 2020 8:01 pm

Nothing happens when I enter
cat /proc/cpuinfo
or
sudo cat /proc/cpuinfo
.
I get a blank line with a blinking cursor and I have to enter
ctrl+c
to exit.
This is a Raspberry Pi 2 Model B V1.1

JC_LaFleur
 
Posts: 27
Joined: Thu May 28, 2020 10:29 pm

Re: MotorKit "board not supported" error from Python3???

by adafruit_support_carter on Fri May 29, 2020 8:18 pm

I get a blank line with a blinking cursor

Do you see the raspberry pi prompt?
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $


Or....looking back at your first post. How did you get to here?
Code: Select all | TOGGLE FULL SIZE
pi@motortest:~ $

adafruit_support_carter
 
Posts: 15850
Joined: Tue Nov 29, 2016 2:45 pm

Re: MotorKit "board not supported" error from Python3???

by JC_LaFleur on Fri May 29, 2020 8:52 pm

when I enter
cat /proc/cpuinfo

I get a blank line (no output) with a blinking cursor. It does not go back to the prompt, it's like it's stuck in a loop and I have to enter "ctrl+c" to get back to the prompt.

JC_LaFleur
 
Posts: 27
Joined: Thu May 28, 2020 10:29 pm

Re: MotorKit "board not supported" error from Python3???

by adafruit_support_carter on Sat May 30, 2020 10:25 am

Weird. I don't think the Raspbian images are drastically different between the Pi models. The underlying board detection is based on information taken from /proc/cpuinfo. So not sure why yours is behaving like that.

What do you get from running this?
Code: Select all | TOGGLE FULL SIZE
uname -a

adafruit_support_carter
 
Posts: 15850
Joined: Tue Nov 29, 2016 2:45 pm

Re: MotorKit "board not supported" error from Python3???

by JC_LaFleur on Sat May 30, 2020 6:52 pm

I get this...
pi@motortest:~ $ uname -a
Linux motortest 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux
pi@motortest:~ $

JC_LaFleur
 
Posts: 27
Joined: Thu May 28, 2020 10:29 pm

Re: MotorKit "board not supported" error from Python3???

by JC_LaFleur on Sat May 30, 2020 7:00 pm

OK, now this is weird... I just tried "cat /proc/cpuinfo" again and now it is giving me an output...
pi@motortest:~ $ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 1
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 2
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 3
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

Hardware : BCM2835
Revision : 3a21041
Serial : 0000000067e40b59
Model : Raspberry Pi 2 Model B Rev 1.1
pi@motortest:~ $


Yesterday it was just hanging, even after trying a reboot it wasn't returning any output from "cat /proc/cpuinfo". Is there maybe something wrong with my Pi board? This is one of the oldest Pi boards I own, second one I ever bought I think... I just don't have another spare Pi to test this with at the moment.

I am still getting the same errors as before when trying to run code in python3.

JC_LaFleur
 
Posts: 27
Joined: Thu May 28, 2020 10:29 pm

Re: MotorKit "board not supported" error from Python3???

by JC_LaFleur on Sat May 30, 2020 8:01 pm

Well, I decided to temporarily take apart a different project and try using the Pi board from that for a comparison ... I am now testing this on a Raspberry Pi Model B+ V1.2... and everything is working fine... the python code is running with no errors, and the stepper motor is turning!

I still need to figure out why none of this is working on the Raspberry Pi 2 Model B V1.1 I originally planned on using for this project... so if we could continue troubleshooting this I would appreciate it.

And thank you for all your help so far, and your quick responses :-). Hopefully we'll get this figured out, or at least determine if it is actually a library problem or if there is something wrong with this Pi 2 Model B V1.1 board I have :-(

What would you recommend trying next?

JC_LaFleur
 
Posts: 27
Joined: Thu May 28, 2020 10:29 pm

Re: MotorKit "board not supported" error from Python3???

by adafruit_support_carter on Sun May 31, 2020 11:02 am

Also not sure why you couldn't get /proc/cpuinfo to print before. But now that you were able to get it to work, it contains the info needed.

Issue opened here:
https://github.com/adafruit/Adafruit_Py ... /issues/85

adafruit_support_carter
 
Posts: 15850
Joined: Tue Nov 29, 2016 2:45 pm

Re: MotorKit "board not supported" error from Python3???

by JC_LaFleur on Sun May 31, 2020 4:20 pm

So it was something missing in the library code?
And you're already on top of things with a bug report and assigned someone to look at the code?
You!
ALL!!
ROCK!!!

Thank you SO much for looking into this... on a weekend no less :-)

For now I'll just use this other Pi to get my stepper motor code written for my project and wait to hear back about the fix for the Pi Model B V1.1.

Thanks again, and please stay safe and healthy out there.

JCL

JC_LaFleur
 
Posts: 27
Joined: Thu May 28, 2020 10:29 pm

Re: MotorKit "board not supported" error from Python3???

by adafruit_support_carter on Mon Jun 01, 2020 12:46 pm

Please try updating Blinka, which should hopefully also bring in the updated version of Platform Detect:
https://github.com/adafruit/Adafruit_Py ... tag/2.13.2
which should fix this issue.

adafruit_support_carter
 
Posts: 15850
Joined: Tue Nov 29, 2016 2:45 pm

Re: MotorKit "board not supported" error from Python3???

by JC_LaFleur on Tue Jun 02, 2020 9:09 pm

OK... finally got around to switching back to the Raspberry Pi 2 Model B V1.1 to try the updated python package.

I first ran "sudo apt update" and "sudo apt upgrade"

Then I ran
Code: Select all | TOGGLE FULL SIZE
pip3 install Adafruit-Blinka --upgrade

and it upgraded from blinka version 4.10.1 to 5.0.1

This did not fix the problem of the board detect error, I was still getting the same error as before when running my python program.

Then I ran
Code: Select all | TOGGLE FULL SIZE
pip3 install Adafruit-PlatformDetect --upgrade

and it upgraded from version 2.13.1 to 2.13.2

After this everything seems to be working now!

Thank you so much!

JCL

JC_LaFleur
 
Posts: 27
Joined: Thu May 28, 2020 10:29 pm

Please be positive and constructive with your questions and comments.