Use USB as serial port on OPO



  • Hi,

    Hope someone can help me with following?

    I'm trying to use my OnePlus One phone as linux server, with the aim to use the USB interface as serial port to control an i2c bus.

    I'm not sure if this is feasible at all, or that I'm here facing intrinsic limitations of running ubuntu on an 'android' phone .. Please your feedback.

    So far I did the following:

    • rooted the phone and installed Ubuntu via theUBPorts installation.
    • created a chroot using the procedure in below link:
      https://accu.org/index.php/journals/2158
    • In the chroot I could succesfully install programs in the expected manner with apt-get install ...; Python2.7 and pyserial are working.
    • When I connect the USB-I2C device I can see the device with lsusb
    • However, no ttyUSBx is created. Reading some posts on the internet, I think, for that the ftdi-sio module (usb driver) needs to be loaded in the kernel.
    • Further reading shows that one can enable that module with:
      modprobe ftdi_sio vendor=0x0403 product=0x6001
    • Then I get the error that proc/modules does not exist. Indeed I cannot find such directory and files in the chroot, nor in the regular file system.

    Questions:

    • Why cant I find the proc/modules ? Are the loaded kernel modules listed in another directory ?
    • Can I use commands like lsmod, insmod, modprobe etc ?
    • How to enable the ftdi-sio module ?

    Thanks,
    Jumbs



  • @jumbs I know nothing about i2c, but you might want to check whether your kernel has module support

    gunzip < /proc/config.gz | grep -i modules

    Mine says

    # CONFIG_MODULES is not set
    

    Which means my kernel doesn't have module support. I think this is typical for mobile device kernels (not sure why).

    So that would explain why you can't modprobe.
    You could try to compile a kernel for your device with support for loadable modules.

    However, after thinking further, this might not actually be the aspect you want to focus on. If I understand it right, then what you really need is to have the driver ftdi-sio compiled! It doesn't need to be a module, it can be linked directly into the kernel. However, that leads again to: compile a kernel. But then you want to focus on that driver and not on module support.

    Does that help?



  • Hi,

    @Doniks, Thanks.
    Indeed, I also get the response: 'config_modules is not set'.

    Do I understand correctly, that compiling a Kernel with the required driver linked into the Kernel, means, compiling on seperate computer starting from source code, and loading a new ROM on the OPO? Or can this still be done in some way within the existing ROM ...

    kind regards,
    Jumbs



  • @jumbs said in Use USB as serial port on OPO:

    Do I understand correctly, that compiling a Kernel with the required driver linked into the Kernel, means, compiling on seperate computer starting from source code, and loading a new ROM on the OPO?

    yes


Log in to reply
 

Looks like your connection to UBports Forum was lost, please wait while we try to reconnect.