Qtopia how to install i2c-tools ???

Slycom
Hi, 

I have a question. How I can install i2c-tools ?

thanks.

Jeremy Maccelari
In the Makefile for i2c-tools replace the line:
CC  := gcc
with
CC  := arm-linux-gcc

Run make to build.

Then copy the resulting binaries to the FriendlyARM and run them...

jen
This does not work.
I compiled with arm-linux-gcc and copied the binaries to 2440.
when i run and i2c-tools command it gives this error:
line 1: syntax error: "(" unexpected

jen
Found out the way..
You also need to change 
CC  := gcc
with
CC  := arm-linux-gcc
OR replace $(CC) with arm-linux-gcc every where
in i2c-tools/tools/Module.mk

Now run make and copy binery files in i2c-tools/tools/ to your FriendlyARM

xite
Hi,

which Python version did you use to compile 2.7 or 3.2?
I try to build only py-smbus, with python 3.2 as a first step, before go to
compile it for arm. But the command python3.2 ./setup.py build failes with
the following errors:
running build
running build_ext
building 'smbus' extension
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g
-fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
-Werror=format-security -fPIC -I/usr/include/python3.2mu -c smbusmodule.c
-o build/temp.linux-x86_64-3.2/smbusmodule.o
smbusmodule.c: In function ‘SMBus_dealloc’:
smbusmodule.c:97:13: error: ‘SMBus’ has no member named ‘ob_type’
smbusmodule.c: In function ‘SMBus_set_addr’:
smbusmodule.c:161:39: error: ‘I2C_SLAVE’ undeclared (first use in this
function)
smbusmodule.c:161:39: note: each undeclared identifier is reported only
once for each function it appears in
smbusmodule.c: In function ‘SMBus_write_quick’:
smbusmodule.c:190:9: warning: implicit declaration of function
‘i2c_smbus_write_quick’ [-Wimplicit-function-declaration]
smbusmodule.c: In function ‘SMBus_read_byte’:
smbusmodule.c:214:9: warning: implicit declaration of function
‘i2c_smbus_read_byte’ [-Wimplicit-function-declaration]
smbusmodule.c: In function ‘SMBus_write_byte’:
smbusmodule.c:237:9: warning: implicit declaration of function
‘i2c_smbus_write_byte’ [-Wimplicit-function-declaration]
smbusmodule.c: In function ‘SMBus_read_byte_data’:
smbusmodule.c:261:9: warning: implicit declaration of function
‘i2c_smbus_read_byte_data’ [-Wimplicit-function-declaration]
smbusmodule.c: In function ‘SMBus_write_byte_data’:
smbusmodule.c:284:9: warning: implicit declaration of function
‘i2c_smbus_write_byte_data’ [-Wimplicit-function-declaration]
smbusmodule.c: In function ‘SMBus_read_word_data’:
smbusmodule.c:309:9: warning: implicit declaration of function
‘i2c_smbus_read_word_data’ [-Wimplicit-function-declaration]
smbusmodule.c: In function ‘SMBus_write_word_data’:
smbusmodule.c:332:9: warning: implicit declaration of function
‘i2c_smbus_write_word_data’ [-Wimplicit-function-declaration]
smbusmodule.c: In function ‘SMBus_process_call’:
smbusmodule.c:357:9: warning: implicit declaration of function
‘i2c_smbus_process_call’ [-Wimplicit-function-declaration]
smbusmodule.c: In function ‘SMBus_read_block_data’:
smbusmodule.c:402:9: warning: implicit declaration of function
‘i2c_smbus_access’ [-Wimplicit-function-declaration]
smbusmodule.c: In function ‘SMBus_list_to_data’:
smbusmodule.c:437:17: warning: implicit declaration of function
‘PyInt_Check’ [-Wimplicit-function-declaration]
smbusmodule.c:441:17: warning: implicit declaration of function
‘PyInt_AS_LONG’ [-Wimplicit-function-declaration]
smbusmodule.c: In function ‘SMBus_set_pec’:
smbusmodule.c:623:37: error: ‘I2C_PEC’ undeclared (first use in this
function)
smbusmodule.c: At top level:
smbusmodule.c:640:9: warning: missing braces around initializer
[-Wmissing-braces]
smbusmodule.c:640:9: warning: (near initialization for
‘SMBus_type.ob_base.ob_base’) [-Wmissing-braces]
smbusmodule.c:642:9: warning: initialization makes integer from pointer
without a cast [enabled by default]
smbusmodule.c:642:9: warning: (near initialization for
‘SMBus_type.tp_basicsize’) [enabled by default]
smbusmodule.c:645:9: warning: initialization from incompatible pointer type
[enabled by default]
smbusmodule.c:645:9: warning: (near initialization for
‘SMBus_type.tp_print’) [enabled by default]
smbusmodule.c:660:9: warning: initialization makes pointer from integer
without a cast [enabled by default]
smbusmodule.c:660:9: warning: (near initialization for ‘SMBus_type.tp_doc’)
[enabled by default]
smbusmodule.c:661:9: warning: initialization from incompatible pointer type
[enabled by default]
smbusmodule.c:661:9: warning: (near initialization for
‘SMBus_type.tp_traverse’) [enabled by default]
smbusmodule.c:668:9: warning: initialization from incompatible pointer type
[enabled by default]
smbusmodule.c:668:9: warning: (near initialization for
‘SMBus_type.tp_members’) [enabled by default]
smbusmodule.c:670:9: warning: initialization from incompatible pointer type
[enabled by default]
smbusmodule.c:670:9: warning: (near initialization for
‘SMBus_type.tp_base’) [enabled by default]
smbusmodule.c:676:9: warning: initialization from incompatible pointer type
[enabled by default]
smbusmodule.c:676:9: warning: (near initialization for
‘SMBus_type.tp_alloc’) [enabled by default]
smbusmodule.c:678:9: warning: initialization from incompatible pointer type
[enabled by default]
smbusmodule.c:678:9: warning: (near initialization for
‘SMBus_type.tp_free’) [enabled by default]
smbusmodule.c: In function ‘initsmbus’:
smbusmodule.c:694:17: warning: ‘return’ with no value, in function
returning non-void [-Wreturn-type]
smbusmodule.c:696:9: warning: implicit declaration of function
‘Py_InitModule3’ [-Wimplicit-function-declaration]
smbusmodule.c:696:11: warning: assignment makes pointer from integer
without a cast [enabled by default]
error: command 'gcc' failed with exit status 1

xite
Ok, it tried compile i2c-tools-3.1.0 with Python 2.7 and it work under
Ubuntu 12.04.
Has anyone an idea how to compile it with Python 3.2 and which changes has
to be done in the smbusmodule.c code?