We have moved to a new Sailfish OS Forum. Please start new discussions there.
5

USB OTG Serial Port

asked 2019-10-15 18:00:34 +0200

NobodyInPerson gravatar image

Hi,

I would like to get a USB to serial adapter to work on my Xperia X. Basically I'd love to be able to program microcontrollers with PlatformIO.

When I plug it in, dmesg -ew says

[  +0.230771] usb 1-1: new full-speed USB device number 4 using msm_hsusb_host
[  +0.164788] usb 1-1: New USB device found, idVendor=0403, idProduct=6001
[  +0.000027] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  +0.000012] usb 1-1: Product: FT232R USB UART
[  +0.000012] usb 1-1: Manufacturer: FTDI
[  +0.000011] usb 1-1: SerialNumber: hedut1
[  +0.018256] platform 184c030.qcom,gdsc: Driver gdsc requests probe deferral

However, on a normal Linux machine this reads

[Okt15 16:08] usb 1-3: new full-speed USB device number 11 using xhci_hcd
[  +0,155261] usb 1-3: New USB device found, idVendor=0403, idProduct=6001
[  +0,000007] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  +0,000004] usb 1-3: Product: FT232R USB UART
[  +0,000004] usb 1-3: Manufacturer: FTDI
[  +0,000003] usb 1-3: SerialNumber: hedut1
[  +0,034657] usbcore: registered new interface driver usbserial_generic
[  +0,001045] usbserial: USB Serial support registered for generic
[  +0,005617] usbcore: registered new interface driver ftdi_sio
[  +0,000024] usbserial: USB Serial support registered for FTDI USB Serial Device
[  +0,000099] ftdi_sio 1-3:1.0: FTDI USB Serial Device converter detected
[  +0,001101] usb 1-3: Detected FT232RL
[  +0,000287] usb 1-3: FTDI USB Serial Device converter now attached to ttyUSB0

It seems that SailfishOS does not assign a serial port to the device. Wild guess is that the usbserial driver is not loaded. I really have no ideas how drivers work in Linux.

Any ideas how to get serial ports to work under SailfishOS?

Cheers,

Yann

edit retag flag offensive close delete

Comments

1

If I know correctly the loadable kernel module is not enabled in the X's kernel. And obviously the ftdi_sio and usbserial modules are not present on the device.

martonmiklos ( 2019-10-16 11:02:23 +0200 )edit

So it's a kernel issue and without a kernel modification there's no luck?

NobodyInPerson ( 2019-10-16 11:03:29 +0200 )edit
4

You need to build a custom kernel (either with loadable module support or compile in the necessary modules). It might be useful to ask on the Community meeting about what is the reason of the disabling of the loadable module support on the Xperia X, and would it be possible to ship kernel with loadable module support.

martonmiklos ( 2019-10-16 11:15:54 +0200 )edit

What's USB-OTG got to do with programming microcontrollers?

I have several types of microcontrollers and I sometimes use Platformio (windows) but generally I use Arduino IDE (windows) connected via microusb.

What am I missing from your question?, are you saying there is a mobile version of Platformio?

Spam Hunter ( 2019-10-17 01:08:41 +0200 )edit
1

@Edz You can install PlatformIO as any other Python package via python3 -m pip install --user platformio. The pio command works fine. Compilation of sketches still fails due to some missing compilers I guess. And the USB OTG serial functionality is of course needed to flash or interface the microcontrollers.

NobodyInPerson ( 2019-10-17 05:36:03 +0200 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2019-10-16 20:20:35 +0200

bionade24 gravatar image

updated 2019-10-16 20:55:37 +0200

The Sony Android Kernel doesn't have the necessary kernel part. You have to use a device with a "normal Linux Kernel" (e. g. The Pine Phone coming soon) or you have to hack on Sony's Android Kernel and libhybris.

Edit: libhybris wikipedia URL

edit flag offensive delete publish link more

Comments

:-( Alright then... Thank you!

NobodyInPerson ( 2019-10-16 20:21:45 +0200 )edit
1

I had the problem myself, too. Maybe you wan't to understand it better: https://en.wikipedia.org/wiki/Hybris_%28software%29

bionade24 ( 2019-10-16 20:54:28 +0200 )edit
3

I do not think that the missing modules has anything to do with the libhybris. Jolla built the kernel without loadable modules support and did not compiled in or shipped the missing modules.

martonmiklos ( 2019-10-16 22:04:29 +0200 )edit

Are you sure it is Jolla that build the kernel?

deloptes ( 2019-10-20 22:30:36 +0200 )edit

Not 100 percently, but I think yes because they publish the sources of it.To make it sure we would need to diff the published sources to the Sony's kernel.

martonmiklos ( 2019-10-20 23:13:26 +0200 )edit
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2019-10-15 18:00:34 +0200

Seen: 740 times

Last updated: Oct 16 '19