-
Notifications
You must be signed in to change notification settings - Fork 217
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
I2C issue with Adafruit-BBIO 1.2.0 #347
Comments
I am not familiar with MotorBridge. Could you link to where that library lives? |
Hello Drew.
And below we have installing dependiences:
Of course i was used newest installation method with "pip3":
and then i was try to use my simple program and... issue. Normally the library is copied to the directory where the application you want to run is and which references that application. In addition, below I present the entire link for this library for better analysis: https://github.com/Seeed-Studio/MotorBridgeCapeforBBG_BBB/tree/master/BBG_MotorBridgeCape Forgive my long description but I don't speak English well. |
Anyone have some idea? |
@tomek242 sorry for the delay. Please try running with strace so we might be able to see where the error occurs: This issues in the MotoBridgeCape might also be related: @Pillar1989 do you know who at Seeed is working on the BBG_MotorBridgeCape? Thank you |
Hello, It is late now but I have some resources on this effort... https://github.com/silver2row/bbg is the link I created some time ago. I keep updating it but sometimes I shy away from it all at once. Seth P.S. If you would like to have it work, just follow that repo. and if you have any issues, just ask away. |
Hello.
In other side i was tested MotorBridge.py: ... same problem And this is the strace log: |
Hello Seth. Where to find smbus2.py to edit this 302 line? |
Hello @tomek242 , Seth here. Okay, so ... Then, go into the Python venv by typing source bin/activate. I am sure you are already familiar w/ these commands. You may also want to track things w/ a Then...to find that line 302 in Also...in the file pyvenv.cfg, exchange out the false w/ true. Seth P.S. If you need any additional ideas, please just reply. |
Hello @tomek242 , If that is not clear or if you need additional help, just reply. So, set up the venv, go into the venv w/ souce bin/activate, install smbus2 w/ pip3, and then go to the listed dir. at /lib/python3.7/site-packages/smbus2/ while in the venv directly in the venv. smbus2.py will be located in that dir. Seth P.S. Also, stay in the venv to run the file.py of your choice w/ the Motorbridge.py altered file. If you need the altered file, reply and I will do my best to update you. Oh and use python3 and not python2. Also...look at the MotorBridge.py file at https://github.com/silver2row/bbg/blob/master/MBC/MotorBridge.py . It uses smbus2 instead of the older items of interest that have been put on deprecation and/or are no longer usable. Also, see further down in that file for the differences in the functions. Also...I updated the repo. at https://github.com/silver2row/bbg . Check it out and let me know if that helps! |
Hello guys and i have this: And this is Well i was use this file https://github.com/silver2row/bbg/blob/master/MBC/MotorBridge.py `import MotorBridge if name=="main":
Of course i was used new version of MotorBridge.py with smbus2 and... I had this:
|
Hello...
This makes it so you can have all your 'birds in one dish.' I mean, you can have those virtual or venv w/ all the python3 libs.
This makes it so you can use i2c-2 device on the BBB instead of what random guess the software makes to pick a randomly generated i2c-. You did not change the MotorBridge.py file yet. Look here: https://github.com/silver2row/bbg/blob/master/MBC/MotorBridge.py See that difference and see what your MotorBridge.py file looks like? Check out mine and let me know what you think. Seth P.S. Remember, we have to get MotorBridge.py working first. Then, we can move on to your source. |
Hello...you seem to be using Adafruit_GPIO still but it is deprecated. Use smbus2 via a pip3 install, put it in a venv first w/ python -m venv venv, and then make your installs but make sure you have your lib, Adafruit_BBIO, working and installed in the venv. I tried to explain that earlier but I may have not been too clear. ... Then, after, if you have not altered your MotorBridge.py file yet, we alter the MotorBridge.py file to resemble my adapted source from the original source, we can move on to other aspects of issues. |
Hello...Seth here. Did you get it up and running yet? You may want to update/upgrade your packages and kernel to --lts-4_19. There are some updates in this kernel too w/ it being r59. Seth P.S. Please reply when you have time... |
Hello Seth, hello silver2row. ` """
I made another attempt to run my servo test program. Results below: import MotorBridge if name=="main":
Trying run and:
Greetings guys and thanks for ur answer and help.... |
Hello @tomek242 , Did you put the BB-UART2-00A0.dtbo in the /boot/uEnv.txt file or use config-pin to handle the UART2 pins? This may be the cause. Oh and try this source at where you typed:
But instead of that line, use this line:
Also... Please reply w/ this command Seth P.S. Use the spacing when you use Try this:
Also:
|
Hello @tomek242 , Also, the pins on the Motor Bridge Cape are confusing for the servo header. If you are using Servo1 in your source, try to use the exterior pin(s) on the servo header. So, you may be plugged into the sixth servo pin instead of the first servo pin. Try to alter your configuration and... Perform the necessary adjustments and please reply. Seth P.S. Look at these differences compared to the actual https://github.com/Seeed-Studio/MotorBridgeCapeforBBG_BBB/blob/master/BBG_MotorBridgeCape/MotorBridge.py starting on line
... Do you see the difference? The smbus2 library has been used instead of the Adafruit_I2C or whatever library that came from during the update in '18. Anyway, try and try until you figure it out. I will check back after a while. |
Hello sir...did you figure it out yet? I am checking in to see if you got things working. Seth |
Hello Seth. Im sorry for late like always. BBB its my hobby only so i can write about it only when i had time after work. `from smbus2 import SMBus reset pin is P9.23, i.e. gpio1.17reset_pin = pathlib.Path('/sys/class/gpio/gpio49/direction') bus = SMBus('/dev/i2c-2') ReadMode = 0 also i've checked couple times lines since line 201 and rest, and i have exactly same code: `def WriteByte(Reg,Value): def WriteHalfWord(Reg,Value): def WriteOneWord(Reg,Value): def SetDefault(): class MotorBridgeCape: So everything seems correct but i had exactly same error like before in my posts.... |
Hello @tomek242 , Okay...I will test again. I have the hardware here. I will let you know exactly my set up, source, and board used. Please be patient. Seth P.S. Okay: BBGW, Motor Bridge Cape, and the set up:
and...
And here is the video. I just took this video on May 31st at 7:15 2021. https://youtu.be/IJWXZps9nsw :: The darn bot gets stuck on a tiny floor mat. Ha! ZumoBots! One other thing! There is a switch on the Cape. You can have it flipped to |
Okay and okay, Here:
... That is the MotorBridge.py file or call it whatever, e.g. as long as you call the MotorBridge or self-named file in the next file to handle your Motor Bridge Cape and motors or whatever you are using it for currently. And...here is a simple test to see motor movement! This will make some DC Motors (12v) move around and back and forth and change direction:
Then, after those files are in your cloned git repo. from https://github.com/silver2row/bbg and after changing line 302 to what this specific repo. states for smbus2, add the BB-UART2-00A0.dtbo in your /boot/uEnv.txt file under the uboot overlays section. Seth P.S. I think this covers it. Please let me know what you think thus far. I am not sure what I could be missing since mine works. |
Oh and... If you have time, please use a venv for this specific instance if you are having issues. So, Seth P.S. This may help you exclude specific issues so we can debug a bit better. Also, while in the venv called bbg, use
|
Howdy good folks.
My issue is I want to use simple program for my MotorBridge Cape v1.0
and when i want to fired up this simple servo test i had this:
This is my script versions below:
sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[029041f6866049997bbfd2c7667b3c6e8c95201c]
eeprom:[A335BNLT00C05114BBBK1322]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster LXQt Image 2020-05-18]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-g31a8ae0206]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-g31a8ae0206]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
UBOOT: Loaded Overlay:[BB-HDMI-TDA998x-00A0]
UBOOT: Loaded Overlay:[BB-UART2-00A0]
kernel:[4.19.94-ti-r43]
nodejs:[v10.19.0]
/boot/uEnv.txt Settings:
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BB-UART2-00A0.dtbo]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20200430.0-0
buster+20200430]buster+20200424]pkg:[bb-wl18xx-firmware]:[1.20200420.1-0
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.4-git20190227.1-0rcnee0
buster+20190327]buster+20200305]pkg:[firmware-ti-connectivity]:[20190717-2rcnee1
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[ 85.845243] remoteproc remoteproc0: wkup_m3 is available
[ 86.427759] remoteproc remoteproc0: powering up wkup_m3
[ 86.427794] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 86.428131] remoteproc remoteproc0: remote processor wkup_m3 is now up
[ 93.265874] remoteproc remoteproc1: 4a334000.pru is available
[ 93.279707] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[ 93.265874] remoteproc remoteproc1: 4a334000.pru is available
[ 93.266027] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[ 93.279707] remoteproc remoteproc2: 4a338000.pru is available
[ 93.280000] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[ 1.177283] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 1.190496] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 005: ID 079b:0062 Sagem XG-76NA 802.11bg
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 003: ID 0c45:6366 Microdia
Bus 001 Device 002: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END
uname -a
Linux beaglebone 4.19.94-ti-r43 #1buster SMP PREEMPT Wed Apr 22 06:11:16 UTC 2020 armv7l GNU/Linux
I had this problem with any debian on my BBB...Can someon help me or someone had similiar problem?
Thanks for any help.
Tom.
The text was updated successfully, but these errors were encountered: