Hi all,
I'm working about a problem since some weeks for many time.
I wanted to create a robot with a my friend, and we decided some time ago to buy a fonera, that have wireless, serial port,gpio, ehternet ecc.. with 20€.
So i installed kamikaze 7.06, i started to use it and understand how it works. I installed python on it( i want to use in the robot a neural network and other things so i want to use python) and i installed a kernel module to control gpio ports.
This module create files in /proc/gpio wich you can read and write to control digital input and output of gpio ports.
But there were a problem: transfer on pins were too slow.
So i searched and i saw that with a mmc driver you can write something like 600 kb/s or more...
Then i flashed the board for some reasons and i passed to 7.09, so i reinstalled python and all other things.
But the version of the module that i used to control gpio ports don't work on this new kernel, so i decided to do what i wanted to do from some time:
Use a C library and wrap it to use into python to have speed in comunication.
First i have documented myself about the library to use to write on gpio ports, and i constated that with io.h , using the function ioperm, io can write and read on gpio ports also if you aren't a kernel module.
For my fortune there is already a C library already prepared to be used on python , a porting of io.h for python.
You can find it here: http://www.hare.demon.co.uk/ioport/ioport.html
Usually if you want to port a library on python you have to use the "Python.h" library, so you can compile using commands
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c ioport.c -o ioport.o
and then
ld -shared ioport.o -o ioport.so
So when you have the ioport.so you can simply open python and do:
>>> import ioport
and then you can use all function of that porting. (ioport.ioperm, ioport.write ecc...)
On my pc with ubuntu 7.06 worked perfectly, so i tried to do it on openwrt.
First of all i downloaded the svn of kamikaze 7.09 and i have done "make menuconfig", i selected my platform(atheros 2.6) and i have made "make world", so now i have the compiler gcc and also ld for my platform. But there are already some problems.
I don't compiled the python 2.5 package on the svn because i tried but i'm not able, also after the reading of differents wiki. Anyway i have the source package of python2.5, i dowloaded it from openwrt source dir ( http://downloads.openwrt.org/sources/ )
Then i looked into it, but tring to compile the program using the Python.h inside and the pyconfig.h(another depend library) the compilation give me some errors, i tried to use my lbiraries on my pc and looks to work, but then ld say that there is a problem ( i used the compilator gcc and ld in staging dir ) , or all go ok and then it give me error when i try to run it on openwrt.
So if anyonae have an idea i need to know if the Python.h and pyconfig.h must be of the soruce or of my pc or i have to compile python package(so please give me some information to compile it). Also i want to be shoure that the compilator, if i say he something like
staging_dir_mips/bin/mips-linux-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c ioport2.c -o ioport2.o
the compilator of openwrt, already know witch io.h go to pick in the svn, of it pick that of my pc and so i have to select the folder where there is the correct library for my platform
Thanks all
p.s: when the robot will be finished i will publish the photos