0

RE: sudo pip install --upgrade Adafruit_BBIO
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RE: sudo pip install --upgrade Adafruit_BBIO

by silver2row on Mon Feb 12, 2018 12:25 am

Hello,

I cannot upgrade to 1.0.10 and I have 1.0.3 on my BBB. I cannot figure out why my I2C address will not work either.

Seth

P.S. I used sudo pip install --upgrade Adafruit_BBIO and got a list of errors.

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by drewfustini on Mon Feb 12, 2018 12:27 pm

Please copy and paste the exact errors here.

Also please paste the output of these commands:

sudo /opt/scripts/tools/version.sh

cat /boot/uEnv.txt

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by silver2row on Mon Feb 12, 2018 5:28 pm

Hello Sir,

Seth here. Here are the reads from what you needed to help me debug.

Traceback (most recent call last):
File "MBC.py", line 1, in <module>
import MotorBridge
File "/home/debian/MotorBridgeCapeforBBG_BBB/BBG_MotorBridgeCape/MotorBridge.py", line 33
from Adafruit_GPIO.I2C import Adafruit_GPIO.I2C
^
SyntaxError: invalid syntax

...

I am dealing w/ a .py file from what I programmed from https://github.com/Seeed-Studio/MotorBr ... forBBG_BBB. This .py file is mine but I cannot run my .py file b/c of issues pertaining to ____________.

sudo /opt/scripts/tools/version.sh

debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[ea6ea9fca05f36f5044398884375b0231348d6e2]
eeprom:[A335BNLTBBG1BBG116044099]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-01-28]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.01-00002-g9aa111a004]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2017.07-00002-gd316f5106c]
kernel:[4.9.78-ti-r94]
nodejs:[v6.12.3]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20180126.0-0rcnee0~stretch+20180126]
pkg:[bb-wl18xx-firmware]:[1.20170829-0rcnee2~stretch+20180104]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee0~stretch+20170830]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
dmesg | grep pinctrl-single
[ 1.469672] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
END

cat /boot/uEnv.txt

debian@beaglebone:~$ cat /boot/uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_pa ... layout_2.0

uname_r=4.9.78-ti-r94
#uuid=
#dtb=


###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBon ... t_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/<file0>.dtbo
#uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
#uboot_overlay_addr2=/lib/firmware/<file2>.dtbo
#uboot_overlay_addr3=/lib/firmware/<file3>.dtbo
###
###Additional custom capes
#uboot_overlay_addr4=/lib/firmware/<file4>.dtbo
#uboot_overlay_addr5=/lib/firmware/<file5>.dtbo
#uboot_overlay_addr6=/lib/firmware/<file6>.dtbo
#uboot_overlay_addr7=/lib/firmware/<file7>.dtbo
###
###Custom Cape
#dtb_overlay=/lib/firmware/<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_uio (4.4.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

cmdline=coherent_pool=1M net.ifnames=0 quiet

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 quiet video=HDMI-A-1:1024x768@60e

##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
cape_enable=bone_capemgr.enable_partno=BB-UART2

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by silver2row on Mon Feb 12, 2018 5:46 pm

Hello...

I was able to upgrade via your/Adafruit's recommendation on which image to grab. I installed a fresh image but I could not get my software/.py file running. If you need the info. on the software and where it originates, please let me know.

Seth

P.S. Here goes it!

Code: Select all | TOGGLE FULL SIZE
# */
# FileName : MotorBridge.py
# by Jiankai.li

from Adafruit_I2C import Adafruit_I2C
import Adafruit_BBIO.GPIO as GPIO
import time
Reset = "P9_23"
MotorBridge = Adafruit_I2C(0x4b)
GPIO.setup(Reset, GPIO.OUT)

ReadMode  = 0
WriteMode = 1
DeAddr    = 0X4B
ConfigValid =  0x3a6fb67c
DelayTime = 0.005

# TB_WORKMODE

TB_SHORT_BREAK  = 0
TB_CW           = 1
TB_CCW          = 2
TB_STOP         = 3
TB_WORKMODE_NUM = 4


# TB_PORTMODE

TB_DCM          = 0
TB_SPM          = 1
TB_PORTMODE_NUM = 2


# SVM_PORT

SVM1            = 0
SVM2            = 1
SVM3            = 2
SVM4            = 3
SVM5            = 4
SVM6            = 5
SVM_PORT_NUM    = 6

# SVM_STATE

SVM_DISABLE     = 0
SVM_ENABLE      = 1
SVM_STATE_NUM   = 2

# IO_MODE

IO_IN           = 0
IO_OUT          = 1
IO_MODE_NUM     = 2

# IO_PUPD

IO_PU           = 0
IO_PD           = 1
IO_NP           = 2
IO_PUPD_NUM     = 3

# IO_PPOD

IO_PP           = 0
IO_OD           = 1
IO_PPOD_NUM     = 2

# IO_STATE

IO_LOW          = 0
IO_HIGH         = 1
IO_STATE_NUM    = 2

# IO_PORT

IO1             = 0
IO2             = 1
IO3             = 2
IO4             = 3
IO5             = 4
IO6             = 5
IO_NUM          = 6


# PARAM_REG

CONFIG_VALID        = 0 
CONFIG_TB_PWM_FREQ  = CONFIG_VALID + 4
 
I2C_ADDRESS         = CONFIG_TB_PWM_FREQ + 4
 
TB_1A_MODE          = I2C_ADDRESS + 1
TB_1A_DIR           = TB_1A_MODE + 1
TB_1A_DUTY          = TB_1A_DIR + 1
TB_1A_SPM_SPEED     = TB_1A_DUTY + 2
TB_1A_SPM_STEP      = TB_1A_SPM_SPEED + 4
 
TB_1B_MODE          = TB_1A_SPM_STEP + 4
TB_1B_DIR           = TB_1B_MODE + 1
TB_1B_DUTY          = TB_1B_DIR + 1
TB_1B_SPM_SPEED     = TB_1B_DUTY + 2
TB_1B_SPM_STEP      = TB_1B_SPM_SPEED + 4
 
TB_2A_MODE          = TB_1B_SPM_STEP + 4
TB_2A_DIR           = TB_2A_MODE + 1
TB_2A_DUTY          = TB_2A_DIR + 1
TB_2A_SPM_SPEED     = TB_2A_DUTY + 2
TB_2A_SPM_STEP      = TB_2A_SPM_SPEED + 4
 
TB_2B_MODE          = TB_2A_SPM_STEP + 4
TB_2B_DIR           = TB_2B_MODE + 1
TB_2B_DUTY          = TB_2B_DIR + 1
TB_2B_SPM_SPEED     = TB_2B_DUTY + 2
TB_2B_SPM_STEP      = TB_2B_SPM_SPEED + 4

SVM1_STATE          = TB_2B_SPM_STEP + 4
SVM1_FREQ           = SVM1_STATE + 1
SVM1_ANGLE          = SVM1_FREQ + 2
 
SVM2_STATE          = SVM1_ANGLE + 2
SVM2_FREQ           = SVM2_STATE + 1
SVM2_ANGLE          = SVM2_FREQ + 2
 
SVM3_STATE          = SVM2_ANGLE + 2
SVM3_FREQ           = SVM3_STATE + 1
SVM3_ANGLE          = SVM3_FREQ + 2
 
SVM4_STATE          = SVM3_ANGLE + 2
SVM4_FREQ           = SVM4_STATE + 1
SVM4_ANGLE          = SVM4_FREQ + 2
 
SVM5_STATE          = SVM4_ANGLE + 2
SVM5_FREQ           = SVM5_STATE + 1
SVM5_ANGLE          = SVM5_FREQ + 2
 
SVM6_STATE          = SVM5_ANGLE + 2
SVM6_FREQ           = SVM6_STATE + 1
SVM6_ANGLE          = SVM6_FREQ + 2

IO1_STATE           = SVM6_ANGLE + 2
IO1_MODE            = IO1_STATE + 1
IO1_PUPD            = IO1_MODE + 1
IO1_PPOD            = IO1_PUPD + 1

IO2_STATE           = IO1_PPOD + 1
IO2_MODE            = IO2_STATE + 1
IO2_PUPD            = IO2_MODE + 1
IO2_PPOD            = IO2_PUPD + 1
 
IO3_STATE           = IO2_PPOD + 1
IO3_MODE            = IO3_STATE + 1
IO3_PUPD            = IO3_MODE + 1
IO3_PPOD            = IO3_PUPD + 1
 
IO4_STATE           = IO3_PPOD + 1
IO4_MODE            = IO4_STATE + 1
IO4_PUPD            = IO4_MODE + 1
IO4_PPOD            = IO4_PUPD + 1
 
IO5_STATE           = IO4_PPOD + 1
IO5_MODE            = IO5_STATE + 1
IO5_PUPD            = IO5_MODE + 1
IO5_PPOD            = IO5_PUPD + 1
 
IO6_STATE           = IO5_PPOD + 1
IO6_MODE            = IO6_STATE + 1
IO6_PUPD            = IO6_MODE + 1
IO6_PPOD            = IO6_PUPD + 1

PARAM_REG_NUM = IO6_PPOD + 1

def WriteByte(Reg,Value):
    data = [0 for i in range(2)]
    data[0] = Reg
    data[1] = Value
    MotorBridge.writeList(WriteMode,data)

def WriteHalfWord(Reg,Value):
    data = [0 for i in range(3)]
    data[0] = Reg
    data[1] = Value & 0xff
    data[2] = (Value>>8) & 0xff
    MotorBridge.writeList(WriteMode,data)
   
def WriteOneWord(Reg,Value):
    data = [0 for i in range(5)]
    data[0] = Reg
    data[1] = Value & 0xff
    data[2] = (Value>>8) & 0xff
    data[3] = (Value>>16) & 0xff
    data[4] = (Value>>24) & 0xff
    MotorBridge.writeList(WriteMode,data)

def SetDefault():
    WriteOneWord(CONFIG_VALID,0x00000000)

class MotorBridgeCape:
    def __init__(self):
        GPIO.output(Reset, GPIO.HIGH)
        time.sleep(1)
       
    # init stepper motor A
    def StepperMotorAInit(self):
        WriteByte(TB_1A_MODE,TB_SPM) #Stepper
        time.sleep(DelayTime)
        WriteHalfWord(TB_1A_DUTY,1000)    # voltage
        time.sleep(DelayTime)
       
    # MoveSteps > 0 CW
    # MoveSteps < 0 CCW
    # StepDelayTime : delay time for every step. uint us
    def StepperMotorAMove(self,MoveSteps,StepDelayTime):
        if MoveSteps > 0:
            WriteByte(TB_1A_DIR,TB_CW)   #CW
        else:
            WriteByte(TB_1A_DIR,TB_CCW)   #CW
            MoveSteps = -MoveSteps
        time.sleep(DelayTime)   
        WriteOneWord(TB_1A_SPM_SPEED,StepDelayTime)  # unit us
        time.sleep(DelayTime)
        WriteOneWord(TB_1A_SPM_STEP,MoveSteps)
        time.sleep(DelayTime)
       
       
    # init stepper motor B
    def StepperMotorBInit(self):
        WriteByte(TB_2A_MODE,TB_SPM) #Stepper
        time.sleep(DelayTime)
        WriteHalfWord(TB_2A_DUTY,1000)    # voltage
        time.sleep(DelayTime)
       
    # MoveSteps > 0 CW
    # MoveSteps < 0 CCW
    # StepDelayTime : delay time for every step. uint us
    def StepperMotorBMove(self,MoveSteps,StepDelayTime):
        if MoveSteps > 0:
            WriteByte(TB_2A_DIR,TB_CW)   #CW
        else:
            WriteByte(TB_2A_DIR,TB_CCW)   #CW
            MoveSteps = -MoveSteps
        time.sleep(DelayTime)   
        WriteOneWord(TB_2A_SPM_SPEED,StepDelayTime)  # unit us
        time.sleep(DelayTime)
        WriteOneWord(TB_2A_SPM_STEP,MoveSteps)
        time.sleep(DelayTime)
       
    # Init DC Motor
    def DCMotorInit(self,MotorName,Frequency):
    # Init the DC Frequency
        WriteOneWord(CONFIG_TB_PWM_FREQ,Frequency)
        time.sleep(DelayTime)
       
    # Set the port as DC Motor
        if MotorName == 1 or MotorName == 2:
            WriteByte(TB_1A_MODE,TB_DCM)
            time.sleep(DelayTime)
            WriteByte(TB_1A_DIR,TB_STOP)
            time.sleep(DelayTime)
            WriteByte(TB_1B_MODE,TB_DCM)
            time.sleep(DelayTime)
            WriteByte(TB_1B_DIR,TB_STOP)
            time.sleep(DelayTime)
        if MotorName == 3 or MotorName == 4:
            WriteByte(TB_2A_MODE,TB_DCM)
            time.sleep(DelayTime)
            WriteByte(TB_2A_DIR,TB_STOP)
            time.sleep(DelayTime)
            WriteByte(TB_2B_MODE,TB_DCM)
            time.sleep(DelayTime)
            WriteByte(TB_2B_DIR,TB_STOP)
            time.sleep(DelayTime)
           
    # Drive the DC Motor
    # Direction 1 CW | 2 CCW
    # PWNDuty  0 ~ 100
    def DCMotorMove(self, MotorName,Direction,PWMDuty):
        if MotorName == 1:
            WriteByte(TB_1B_DIR,Direction)
            time.sleep(DelayTime)
            WriteOneWord(TB_1B_DUTY,PWMDuty*10)
            time.sleep(DelayTime)
           
        if MotorName == 2:
            WriteByte(TB_1A_DIR,Direction)
            time.sleep(DelayTime)
            WriteOneWord(TB_1A_DUTY,PWMDuty*10)
            time.sleep(DelayTime)
           
        if MotorName == 3:
            WriteByte(TB_2B_DIR,Direction)
            time.sleep(DelayTime)
            WriteOneWord(TB_2B_DUTY,PWMDuty*10)
            time.sleep(DelayTime)

        if MotorName == 4:
            WriteByte(TB_2A_DIR,Direction)
            time.sleep(DelayTime)
            WriteOneWord(TB_2A_DUTY,PWMDuty*10)     
            time.sleep(DelayTime)
           
    # Stop the DC motor
    def DCMotorStop(self, MotorName):
        if MotorName == 1:
            WriteByte(TB_1B_DIR,TB_STOP)
        if MotorName == 2:
            WriteByte(TB_1A_DIR,TB_STOP)
        if MotorName == 3:
            WriteByte(TB_2B_DIR,TB_STOP)
        if MotorName == 4:
            WriteByte(TB_2A_DIR,TB_STOP)   
        time.sleep(DelayTime)
   
    # init the Servo
    def ServoInit(self,ServoName,Frequency):
        if ServoName == 1:
            WriteHalfWord(SVM1_FREQ,Frequency)
            time.sleep(DelayTime)       
            WriteByte(SVM1_STATE,SVM_ENABLE)
            time.sleep(DelayTime)

        if ServoName == 2:
            WriteHalfWord(SVM2_FREQ,Frequency) 
            time.sleep(DelayTime)
            WriteByte(SVM2_STATE,SVM_ENABLE)
            time.sleep(DelayTime)
        if ServoName == 3:
            WriteHalfWord(SVM3_FREQ,Frequency)
            time.sleep(DelayTime)       
            WriteByte(SVM3_STATE,SVM_ENABLE)
            time.sleep(DelayTime)

        if ServoName == 4:
            WriteHalfWord(SVM4_FREQ,Frequency) 
            time.sleep(DelayTime)
            WriteByte(SVM4_STATE,SVM_ENABLE)
            time.sleep(DelayTime)
        if ServoName == 5:
            WriteHalfWord(SVM5_FREQ,Frequency)
            time.sleep(DelayTime)       
            WriteByte(SVM5_STATE,SVM_ENABLE)
            time.sleep(DelayTime)

        if ServoName == 6:
            WriteHalfWord(SVM6_FREQ,Frequency) 
            time.sleep(DelayTime)
            WriteByte(SVM6_STATE,SVM_ENABLE)
            time.sleep(DelayTime)
             
    def ServoMoveAngle(self,ServoName,Angle):
        if ServoName == 1:
            WriteHalfWord(SVM1_ANGLE,Angle)
            time.sleep(DelayTime)

        if ServoName == 2:
            WriteHalfWord(SVM2_ANGLE,Angle)   
            time.sleep(DelayTime)
           
        if ServoName == 3:
            WriteHalfWord(SVM3_ANGLE,Angle)
            time.sleep(DelayTime)

        if ServoName == 4:
            WriteHalfWord(SVM4_ANGLE,Angle)   
            time.sleep(DelayTime)     
           
        if ServoName == 5:
            WriteHalfWord(SVM5_ANGLE,Angle)
            time.sleep(DelayTime)

        if ServoName == 6:
            WriteHalfWord(SVM6_ANGLE,Angle)   
            time.sleep(DelayTime)   
           
def myloop():
    print 'Hello From MotorBridge'
    time.sleep(1)
    motor.StepperMotorBMove(-1000,1000) # 20 steppers  1000us every step
    time.sleep(1)
    motor.StepperMotorBMove(1000,1000)  # 20 steppers  1000us every step
    myloop()


if __name__=="__main__":
   
    motor = MotorBridgeCape()
    motor.StepperMotorBInit()
    motor.StepperMotorBMove(1000,1000) # 20 steppers  1000us every step
    myloop()


and...here is my idea of software.

Code: Select all | TOGGLE FULL SIZE
import MotorBridge
import time

MotorName        = 1
MotorName        = 3
ClockWise        = 1
CounterClockWise = 2
PwmDuty          = 90
Frequency        = 1000

if __name__=="__main__":
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 1, 90)
        print "I got your biscuit, now!"

#Making a U-Shape in the lawn
#Left motor on chassis goes while the right motor ccw
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 2, 90)
        print "I love Jim's TURN!"

#All Flanks...Straight Ahead!       
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 1, 90)
        print "Give in to temptation!"
       
#Make another U-Turn but this time, motors go in the opposite direction!
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 2, 90)
        motor.DCMotorMove(3, 1, 90)
       
#Straight Ahead
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 1, 90)
        print "Tacos are not all around here!"
       
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 2, 90)
   
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 1, 90)   
   
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 2, 90)
        motor.DCMotorMove(3, 1, 90)
   
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 1, 90)

    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 2, 90)

    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 1, 90)       

    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 3):
        motor.DCMotorMove(1, 2, 90)
        motor.DCMotorMove(3, 1, 90)
       
    motor = MotorBridge.MotorBridgeCape()
    motor.DCMotorInit(1, 1000)
    motor.DCMotorInit(3, 1000)
    for i in range(1, 51):
        motor.DCMotorMove(1, 1, 90)
        motor.DCMotorMove(3, 1, 90)

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by silver2row on Mon Feb 12, 2018 6:37 pm

Hello Again Sir,

Seth here, again. I am learning from https://github.com/Seeed-Studio/MotorBr ... SourceCode. This is their firmware/C software for the Motor Bridge Cape.

Seth

P.S. If you find something I have missed, please let me know or I will keep on hunting. Thank you, again.

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by drewfustini on Tue Feb 13, 2018 5:35 am

It would be helpful if you could run strace so that I can better understand what is happening.

Install strace (if it doesn't already exist):

sudo apt-get install strace

Then run strace:

sudo strace -f -o strace.log python ./MotorBridge.py

Paste the contents of strace.log into a GitHub Gist or attach the file to your reply.

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by silver2row on Tue Feb 13, 2018 6:08 pm

Hello Again,

Sir...the strace.log file is too long. Do I need to produce each section of that file? If so, I will. But if the required info. can be bent to a "T," let me know. I will reproduce the "fine-tuned" .log file.

Seth

P.S. The issue on my terminal prints out a "." that is the issue on import Adafruit_GPIO.I2C. Please let me know what you think.

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by silver2row on Tue Feb 13, 2018 6:21 pm

Hello Again,

I learned a bit about GitGist a while back and I will try to push the .log file from strace.log to gitGist.

Seth

P.S. It may take time. I have a cheat sheet and I will try w/ the cheat sheet first and then go deeper if the cheat sheet does not work.

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by silver2row on Tue Feb 13, 2018 6:42 pm

Okay...Sir,

Seth here. I got it! The gist is at https://gist.github.com/silver2row/2a3c ... 66322b35c7. Please reply here or there, i.e. anywhere. I would really like to know what you think. Still, yes still, after all this time, my education on debugging specific machinery is difficult. I have limited resources and extra time. If you have any recommendations on books and/or articles, please let me know.

Seth

P.S. I am not in the loop but I do have time. I got some Linux books a while back and I pick them up at times. I think things grew a bit too quickly and people did not want to keep up the pace. For me, I saw changes and gave up. My issue has created a lapse in time where I did not get to keep up w/ what changes were being processed. Otay!

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by silver2row on Tue Feb 13, 2018 7:18 pm

Sir,

I am not sure if this will help, i.e. https://github.com/Seeed-Studio/MotorBr ... 20ENG.docx.

Seth

P.S. They have this "update firmware" section that was never needed. I will try it and get back to you. I have encountered issues w/ their update before and I have used the MotorBridgeCape w/out the firmware update. Sorry for all these issues.

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by silver2row on Tue Feb 13, 2018 7:30 pm

I Know I Am Annoying,

Anyway...check out this error code from updating the firmware on the BBG w/ uname -a 4.9.78-ti-r94. I can revert back to 4.4.x if necessary. I thought this was taken care of, though. Here are the errror codes for updating the firmware on the BBG w/ "make flash."

Code: Select all | TOGGLE FULL SIZE
./script/flasher MotorBridgeCapeFirmware.bin
/home/debian/MotorBridgeCapeFirmware
sh: echo: I/O error
sh: echo: I/O error
Reading data from MotorBridgeCapeFirmware.bin
Can't init. Ensure BOOT0=1, BOOT1=0, and reset device
Traceback (most recent call last):
  File "./script/stm32loader.py", line 555, in <module>
    bootversion = cmd.cmdGet()
  File "./script/stm32loader.py", line 141, in cmdGet
    if self.cmdGeneric(0x00):
  File "./script/stm32loader.py", line 138, in cmdGeneric
    return self._wait_for_ack(hex(cmd))
  File "./script/stm32loader.py", line 89, in _wait_for_ack
    raise CmdException("No response to %s" % info)
__main__.CmdException: No response to 0x0
./script/flasher: 19: ./script/flasher: [1==0]: not found
Reading data from MotorBridgeCapeFirmware.bin
Can't init. Ensure BOOT0=1, BOOT1=0, and reset device
Traceback (most recent call last):
  File "./script/stm32loader.py", line 555, in <module>
    bootversion = cmd.cmdGet()
  File "./script/stm32loader.py", line 141, in cmdGet
    if self.cmdGeneric(0x00):
  File "./script/stm32loader.py", line 138, in cmdGeneric
    return self._wait_for_ack(hex(cmd))
  File "./script/stm32loader.py", line 89, in _wait_for_ack
    raise CmdException("No response to %s" % info)
__main__.CmdException: No response to 0x0
haha


Seth

P.S. If you need any other info, please let me know. I understand that you are not working around the clock and I have time. So, let me know if there are any stuff I should be reading. Thank you again, sir.

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by drewfustini on Tue Feb 13, 2018 11:26 pm

It appears from your Gist that Python could not find MotorBridge.py:
2474 readlink("./MotorBridge.py", 0xbed84564, 4096) = -1 ENOENT (No such file or directory)
2474 getcwd("/home/debian", 4096) = 13
2474 lstat64("/home/debian/MotorBridge.py", 0xbed834c8) = -1 ENOENT (No such file or directory)
2474 stat64("./MotorBridge.py", 0xbed84410) = -1 ENOENT (No such file or directory)
2474 stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
2474 stat64("./MotorBridge.py", 0xbed87468) = -1 ENOENT (No such file or directory)
2474 open("./MotorBridge.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
2474 write(2, "python: can't open file './Motor"..., 80) = 80
2474 exit_group(2) = ?
2474 +++ exited with 2 +++


Please make sure you are in the directory that contains MotorBridge.py before running the command.

For example, here is how I did it:
Code: Select all | TOGGLE FULL SIZE
debian@beaglebone:~/tmp/MotorBridgeCapeforBBG_BBB/BBG_MotorBridgeCape$ sudo strace -f -o strace.log python ./MotorBridge.py

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by silver2row on Tue Feb 13, 2018 11:30 pm

Hello Mr. Drew,

I renamed my MotorBridgeCapeforBBG_BBB/BBG_MotorBridgeCape to abc/double. Do you think this matters?

Seth

P.S. I have an IoT version of the Debian Distro too. Does this matter?

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by drewfustini on Tue Feb 13, 2018 11:32 pm

In regards to flashing the MotorBridgeCape firmware, I'm not familiar this the product and do have one to test with. I would suggest getting in touch with Seeed Studio support or opening an issue in its GitHub repo:
https://github.com/Seeed-Studio/MotorBridgeCapeFirmware

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: RE: sudo pip install --upgrade Adafruit_BBIO

by drewfustini on Tue Feb 13, 2018 11:38 pm

silver2row wrote:I renamed my MotorBridgeCapeforBBG_BBB/BBG_MotorBridgeCape to abc/double. Do you think this matters?

Yes, this is very important.

You need to run make sure the path to script is specified:
Code: Select all | TOGGLE FULL SIZE
sudo strace -f -o strace.log python INSERT_THE_PATH_TO_MotorBridge.py


If if it is in abc/double, then I imagine the proper command would be:
Code: Select all | TOGGLE FULL SIZE
sudo strace -f -o strace.log python ./abc/double/MotorBridge.py


silver2row wrote:P.S. I have an IoT version of the Debian Distro too. Does this matter?

The BeagleBoard.org Debian IoT image should be OK to use. The difference is that it does not include a full graphical desktop environment which does not matter if you have no display connected.

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Please be positive and constructive with your questions and comments.