Motor Bridge Cape/BBG with Debian 8 Jessie

Moderators: lily.li, violet, salmanfarisvp, seth.welday

Post Reply
cpendleton
Pre-kindergarten
Pre-kindergarten
Posts: 6
Joined: Tue Apr 05, 2016 8:27 am

Motor Bridge Cape/BBG with Debian 8 Jessie

Post by cpendleton » Tue May 10, 2016 3:42 am

I wanted to share my experience with making the Motor Bridge Cape work with Debian 8 Jessie on the BBG. I think it was only tested with Debian 7 Wheezy. I used this image https://debian.beagleboard.org/images/b ... 4gb.img.xz, with the 4.1.23-bone-rt-r21 kernel.

The I2C bus mappings between the 2 OSes are different. What was I2C1 on Wheezy is now I2C2 on Jessie. I think this is actually an improvement, as the mapping did not match the AM335x I2C module numbers on Wheezy. An explanation can be found here: https://datko.net/2013/11/03/bbb_i2c/.

To make the Motor Bridge Cape work on Jessie with the Seeed python libraries, I needed to change line 37 of MotorBridgeCapeforBBG_BBB / BBG_MotorBridgeCape / MotorBridge.py to:

MotorBridge = Adafruit_I2C(0x4b,2)

I might suggest that the code detect the environment, or at least allow the user to set it. Jessie seems like a much superior OS in my limited testing.

-Chris

silver1row
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Mon Apr 25, 2016 7:39 am
Contact:

Re: Motor Bridge Cape/BBG with Debian 8 Jessie

Post by silver1row » Wed May 18, 2016 2:46 am

Hello Chris,

Seth here. I could not find out how you accomplished your goal. I followed the instructions and I came up with an issue. I get error codes.

If you need a specific type of screen capture, please let me know. I have been unable to get my MotorBridgeCape to work so far.

Seth

silver1row
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Mon Apr 25, 2016 7:39 am
Contact:

Re: Motor Bridge Cape/BBG with Debian 8 Jessie

Post by silver1row » Thu May 19, 2016 12:42 am

Okay and Hello,

I updated the firmware. I just needed to uncomment the enable BB-UART2 line we all added. I added the python-smbus because this is where I received the error.

Here is what printed out after I added the python-smbus.

Traceback (most recent call last):
File "DC.py", line 1, in <module>
import MotorBridge
File "/root/MotorBridgeCapeforBBG_BBB/BBG_MotorBridgeCape/MotorBridge.py", line 37, in <module>
MotorBridge = Adafruit_I2C(0x4b)
File "build/bdist.linux-armv7l/egg/Adafruit_I2C.py", line 17, in __init__
IOError: [Errno 2] No such file or directory


I am going to add the 2, i.e. Adafruit_I2C(0x4b,2) on line 37.

Seth

P.S. I am still trying to run my motors. I have not been able to run the motors just yet.

silver1row
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Mon Apr 25, 2016 7:39 am
Contact:

Re: Motor Bridge Cape/BBG with Debian 8 Jessie

Post by silver1row » Thu May 19, 2016 12:46 am

Okay...

Hello again. I added the 2 in Adafruit_I2C(0x4b,2) on line 37. I get a readout of "hello" now.

This means nothing to me right now because the motor still did not turn clockwise or counterclockwise.

Seth

P.S. I am going to add the 12v battery and see what happens.

silver1row
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Mon Apr 25, 2016 7:39 am
Contact:

Re: Motor Bridge Cape/BBG with Debian 8 Jessie

Post by silver1row » Thu May 19, 2016 1:00 am

Hello,

I got the motor running. I had to plug in power via 12vDC battery, have an Internet connection, and have the BBG to USB plugged into the computer.

The example code for the DC Motor on http://www.seeedstudio.com/wiki/Motor_Bridge_Cape_v1.0 works. I just need to tweak it to suit my needs.

Thank you everyone. You have been very supportive through my confused state on this issue.

Seth

P.S. If anyone needs to know what to do, please just ask me. I have only run one motor thus far. I will check more motors in the future.

Post Reply