A13 Olinuxino wifi android - FTDI usb-to-serial issue please help

Started by ozko, February 25, 2013, 12:54:13 PM

Previous topic - Next topic

ozko

I have an FTDI usb-to-serial cable but I cant get response from the serial device. The problem is that I don`t have root access and I cant change the eventd.rc.
As far as I know, all that I need to do is to change the /dev/bus/usb* 0660 to 0666. I`m not sure if there are going to be problems ahead. I managed to put the FTDI libs but I don`t have usb permissions.

Currently using the Android image from olimex, some FTDI sample apps for test. I can change the tty ports with chmod but when I reboot the changes are reversed. Someone told me about the init.sh in /system/etc/ but it did not work.

I dont know how to root the image so that would be helpful, or if someone have experience with usb-to-serial and can help that would be great.
I can use the tty too but I cant change the permissions to them anyway.

murerten

You can change the permissions by editing ueventd.sun5i.rc file. It is on top of root (/).

ozko

I managed to get root access and to change permissions but it seems like there are no FTDI drivers on the current kernel. Please if someone could help me to build kernel because I haven`t done such a thing so far this is the FTDI documantation http://www.ftdichip.com/Support/Documents/TechnicalNotes/TN_132_Adding_FTDI_Devices_VCP_Driver_Support_to_Android.pdf but its for old kernel if someone could help me, because Im pretty new to this?

murerten


ozko

Thanks a lot  ;D you saved me! ^^
The mod works fine, but when I reboot its gone.
How can I fix this? Tried to put insmod into init.goldfish.sh in system/etc but its not working :/

murerten

You are right. The files on root are volatile but the /system and /data is not. In init.rc it says at the end that when boot completed it runs /system/bin/preinstall.sh. Maybe you can try that. Also you can check init.sun5i.rc how they insmod modules. You can put the module in /system/vendor/modules/. Hope you get it work.

ozko

That information was very helpful too, but init.sun5i.rc recover itself after reboot.
Is there a way to edit it permanently without messing with the image, because I have no experience with building or editing images?

murerten

I mean you can edit /system/bin/preinstall.sh; not init.sun5i.rc. Did you tried that? you can add a line like this to preinstall.sh:

/system/bin/insmod /system/vendor/modules/ftdi_sio.ko

And don't forget to copy the module to /system/vendor/modules. Once you reboot it should work I think.

murerten

Hi again,

You did insmod in wrong place. That if block is executed only once when you factory reset the device:


#!/system/bin/busybox sh

echo "do preinstall job"
BUSYBOX="/system/bin/busybox"

if [ ! -e /data/system.notfirstrun ]; then      
   /system/bin/sh /system/bin/pm preinstall /system/preinstall
   /system/bin/insmod /system/vendor/modules/ftdi_sio.ko
   # copy android modify tool files
   mkdir /mnt/nanda
   mount -t vfat /dev/block/nanda /mnt/nanda
#   $BUSYBOX cp /mnt/nanda/vendor/initlogo.rle /
   $BUSYBOX cp /mnt/nanda/vendor/system/build.prop /system/
   $BUSYBOX cp /mnt/nanda/vendor/system/media/bootanimation.zip /system/media/
   $BUSYBOX cp /mnt/nanda/vendor/system/usr/keylayout/*.kl /system/usr/keylayout/
   sync
   umount /mnt/nanda
   rmdir /mnt/nanda

   $BUSYBOX touch /data/system.notfirstrun   

fi

echo "preinstall ok"


To correct it do it like this:

#!/system/bin/busybox sh

echo "do preinstall job"
BUSYBOX="/system/bin/busybox"

/system/bin/insmod /system/vendor/modules/ftdi_sio.ko
chmod 0666 /dev/ttyS0
chmod 0666 /dev/ttyS1
chmod 0666 /dev/ttyS2
chmod 0666 /dev/ttyS3
chmod 0666 /dev/bus/usb/*


if [ ! -e /data/system.notfirstrun ]; then      
   /system/bin/sh /system/bin/pm preinstall /system/preinstall
   
   # copy android modify tool files
   mkdir /mnt/nanda
   mount -t vfat /dev/block/nanda /mnt/nanda
#   $BUSYBOX cp /mnt/nanda/vendor/initlogo.rle /
   $BUSYBOX cp /mnt/nanda/vendor/system/build.prop /system/
   $BUSYBOX cp /mnt/nanda/vendor/system/media/bootanimation.zip /system/media/
   $BUSYBOX cp /mnt/nanda/vendor/system/usr/keylayout/*.kl /system/usr/keylayout/
   sync
   umount /mnt/nanda
   rmdir /mnt/nanda

   $BUSYBOX touch /data/system.notfirstrun   

fi

echo "preinstall ok"


And init.goldfish.sh is executed only in emulator not on real device.

ozko

Thank you so much murerten!!!
Its always such small things that I have problems with.
Thank again for your help and your time!

murerten