Php Serial Port Communication Linux Kernel

Posted on

Serial HOWTO David S.Lawyer. It contains technical info about the serial port itself in more detail than found in the above HOWTOs and should be.

PhpLinux serial port communication

Php Serial Port Communication

this is from a question on stackoverflow titled 'Android USB host and hidden devices' (sorry, i can't add external URLs yet). it worked like a charm on a micromax A120 canvas 2 phone (kitkat 4.4.2). now i can control my Arduino! i used busybox tools to do all the command line work (otherwise chmod wouldn't work). my steps (perhaps some were not required):
(0) install PDAnet drivers on my Windows 8 computer.
(1) root the phone using Vroot (now called iRoot). Very simple, only catch is that the su grant/deny page is partly in chinese, no big deal.
(2) install busybox and jackpal's Android-Terminal-Emulator available on github and the google play store (free).
(3) open a terminal window and become the superuser:
# su
(4) the file system may be read-only, so you might have to remount it:
# mount -o rw,remount -t yaffs2 /
or
# mount -o rw,remount -t rootfs /
or
# mount -o rw,remount -t rootfs rootfs /system
(5) make default.prop read/write:
chmod 666 /default.prop
(6) edit /default.prop, make the following changes:
ro.secure=0
ro.debuggable=1
persist.service.adb.enable=1
... And this is the real meat of it:
(7) To enable USB host API support you should add a file named
android.hardware.usb.host.xml and containing the following lines:
<permissions>
<feature name='android.hardware.usb.host'/>
</permissions>
into folder
/system/etc/permissions
in that folder find file named
handheld_core_hardware.xml or tablet_core_hardware.xml
and add
<feature name='android.hardware.usb.host' />
into <permissions> section.
(8) Reboot your device. Usb host api should work.