0

LSM303 with BeagleBoneBlack
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LSM303 with BeagleBoneBlack

by avanishah03 on Thu Mar 29, 2018 8:00 pm

Hi,
I am new to Linux Platform and not much aware of how the external hardware works with it, so please bear this with me. :)
I am working on BeagleboneBlack with the latest debian image 9.3 and I am trying to make it work with LSM303 with the Python file from this repository:

https://github.com/adafruit/Adafruit_Python_LSM303

I am using P9_19 and P9_20 pins.
With the help of the command "i2cdetect -y -r 2" I am able to detect the device on the pin.

But, when i try to run the program from "Adafruit_Python_LSM303/examples/simpletest.py" i am facing the following problems.
File "simpletest.py", line 15, in <module>
lsm303 = Adafruit_LSM303.LSM303()
File "build/bdist.linux-armv7l/egg/Adafruit_LSM303/LSM303.py", line 62, in __init__
File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 115, in write8
File "/usr/local/lib/python2.7/dist-packages/Adafruit_PureIO-0.2.1-py2.7.egg/Adafruit_PureIO/smbus.py", line 236, in write_byte_data
self._device.write(data)
IOError: [Errno 16] Device or resource busy

Thank you for your time and patience.

avanishah03
 
Posts: 2
Joined: Thu Mar 29, 2018 7:13 pm

Re: LSM303 with BeagleBoneBlack

by drewfustini on Fri Mar 30, 2018 1:57 am

I would like to know more about the software installed on your BeagleBone.

Please paste the output of:
Code: Select all | TOGGLE FULL SIZE
sudo /opt/scripts/tools/version.sh

cat /boot/uEnv.txt

Please also post a photo of how the LSM303 is wired to the BeagleBone.

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

Re: LSM303 with BeagleBoneBlack

by avanishah03 on Fri Mar 30, 2018 3:29 pm

I really appreciate your time, thank you very much for a quick reply.

These are the following output

root@beaglebone:/opt/scripts/tools# sudo /opt/scripts/tools//version.sh
git:/opt/scripts/:[ea6ea9fca05f36f5044398884375b0231348d6e2]
eeprom:[A335BNLT00C02917BBBK3859]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-01-28]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.03-00002-g254339602c]
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 us ers systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
dmesg | grep pinctrl-single
[ 1.416147] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
END

root@beaglebone:/opt/scripts/tools# 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 ... #U-Boot_Ov erlays
###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=

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

-- For pinout
P9_1-- GND
P9_7-- Vin
P9_19-- SCL
P9_20-- SDA
Attachments
LSM303-BeagleboneBlack.jpeg
LSM303-BeagleboneBlack.jpeg (22.05 KiB) Viewed 549 times

avanishah03
 
Posts: 2
Joined: Thu Mar 29, 2018 7:13 pm

Re: LSM303 with BeagleBoneBlack

by drewfustini on Wed Apr 04, 2018 2:22 pm

Thanks for posting that information. I should be receiving the Triple-axis Accelerometer+Magnetometer (Compass) Board - LSM303 (PID: 1120) by the end of this week so I can reproduce and fix the issue.

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

Re: LSM303 with BeagleBoneBlack

by drewfustini on Sun Apr 08, 2018 4:18 am

Sorry for the delay. I should have the part on Monday (April 9th) and then I can test.

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

Re: LSM303 with BeagleBoneBlack

by drewfustini on Wed Apr 11, 2018 6:25 pm

Please run these commands and paste the output in your reply:
Code: Select all | TOGGLE FULL SIZE
sudo i2cdetect -y -r 0
sudo i2cdetect -y -r 2

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

Please be positive and constructive with your questions and comments.