Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 17366

Re: i2c-tool pgk to be able to use SMBUS in python

$
0
0

Hi

I have the same problem as Keiner

I am using AlexT's version of Yocto and get the following

root@RGBYocto:/media/realroot/GalileoPrograms# python testSMBUS.py

 

/usr/bin/python2.7: symbol 'i2c_smbus_access': can't resolve symbol in lib '/usr/lib/python2.7/site-packages/smbus.so'.

Traceback (most recent call last):

  File "testSMBUS.py", line 1, in <module>

    from smbus import SMBus

ImportError: unknown dlopen() error

 

and the listing of site-packages shows smbus.so

root@RGBYocto:/media/realroot/GalileoPrograms# ls -l /usr/lib/python2.7/site-packages/

total 1511

-rw-r--r--  1 root root     119 Oct 20 03:33 README

-rw-r--r--  1 root root    3931 Nov 19 19:16 Wiring_x86-1.0.0-py2.7.egg-info

-rw-r--r--  1 root root      21 Apr 11  2014 cv.py

-rwxr-xr-x  1 root root 1412532 Oct 21 01:25 cv2.so

drwxr-sr-x  5 root root    1024 Nov  2 17:16 nose-1.2.1-py2.7.egg

drwxr-sr-x 18 root root    1024 Nov  2 17:16 numpy

-rw-r--r--  1 root root    1630 Oct 20 04:07 numpy-1.7.0-py2.7.egg-info

-rw-r--r--  1 root root    2362 Oct 20 04:28 site.py

-rw-r--r--  1 root root    1943 Oct 20 04:28 site.pyo

-rw-r--r--  1 root root     263 Nov 21  2014 smbus-1.1-py2.7.egg-info

-rwxr-xr-x  1 root root   50331 Nov 21 18:39 smbus.so

-rwxr-xr-x  1 root root   29582 Nov 19 19:03 wiringx86.py

-rw-r--r--  1 root root   26614 Nov 19 19:16 wiringx86.pyo

 

Something strange, i2cdetect doesn't see the i2c backpack LCD at 27, which works with Arduino IDE

 

i2cdetect -y -r 0 gives
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

 

Please let me know if you can think of anything

regards

rgb

 

UPDATE

I found a newer version at:  http://www.lm-sensors.org/wiki/I2CTools
removed old: make uninstall

Changed line in py-smbus/smbusmodule.c. line 161, from I2C_SLAVE to I2C_SLAVE_FORCE

did a new installation following your instructions

the i2c LCD backpack still doesn't show up at 27, same output as before, but when I run your test program,

from smbus import SMBus
bus = SMBus(0)
bus.write_byte_data(0x20, 0x29, 0x04)

I get nothing back.

I loaded a sketch to access the i2c LED Backpack and i2cdetect now shows the address, 27

Seems all is working, at least if I use the Arduino library to get it going.

Now need to find a way to get it to work from Python

thanks

rgb


Viewing all articles
Browse latest Browse all 17366

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>