OESF Portables Forum

Model Specific Forums => Gemini PDA => Gemini PDA - Linux => Topic started by: cdnt on June 18, 2018, 09:07:01 am

Title: PL2303 serial adapter drivers?
Post by: cdnt on June 18, 2018, 09:07:01 am
Has anyone managed to get a PL2303 USB to serial converter working with Debian?  It shows up with lsusb, but I can't find anything in /dev that would correspond to it.  I presume I need to compile a driver but wondered if anyone else had tried and had any useful pointers?

Many thanks in advance!
Title: PL2303 serial adapter drivers?
Post by: Murple2 on June 18, 2018, 10:29:03 am
Quote from: cdnt
Has anyone managed to get a PL2303 USB to serial converter working with Debian?  It shows up with lsusb, but I can't find anything in /dev that would correspond to it.  I presume I need to compile a driver but wondered if anyone else had tried and had any useful pointers?

Many thanks in advance!

Ive not played around with the Debian TP but my understanding is that you'll need to compile a kernel with module support, or compile the driver into the kernel itself. I'm not sure why this isn't the case by default but I'm sure someone here can explain in more detail.

Warm regards
Michael
Title: PL2303 serial adapter drivers?
Post by: cdnt on June 18, 2018, 01:02:52 pm
I think I have it figured - I followed the steps at https://github.com/gemian/gemini-keyboard-a...rnelCompilation (https://github.com/gemian/gemini-keyboard-apps/wiki/KernelCompilation) but I think the extra step was to use:

[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']make O=../KERNEL_OUT -C kernel-3.18 ARCH=arm64 menuconfig[/div]

...so I could enable the driver for my usb-serial adapter.

Very happy - now I have a pocket-sized device with a physical keyboard which I can use to configure network switches about the building!
Title: PL2303 serial adapter drivers?
Post by: hk135 on June 20, 2018, 05:30:56 am
Quote from: Murple2
Ive not played around with the Debian TP but my understanding is that you'll need to compile a kernel with module support, or compile the driver into the kernel itself. I'm not sure why this isn't the case by default but I'm sure someone here can explain in more detail.

Warm regards
Michael

From what I can see there isn't loadable module support (run lsmod) on the default kernel provided hence why there are some device recognition issues, unless its compiled in its not supported.

hk135
Title: PL2303 serial adapter drivers?
Post by: Murple2 on June 20, 2018, 05:41:07 am
Quote from: hk135
Quote from: Murple2
Ive not played around with the Debian TP but my understanding is that you'll need to compile a kernel with module support, or compile the driver into the kernel itself. I'm not sure why this isn't the case by default but I'm sure someone here can explain in more detail.

Warm regards
Michael

From what I can see there isn't loadable module support (run lsmod) on the default kernel provided hence why there are some device recognition issues, unless its compiled in its not supported.

hk135

Yes, I wondered why there wasn't module support compiled in? Its kinda important...
Title: PL2303 serial adapter drivers?
Post by: mithrandir on June 20, 2018, 06:45:43 am
Quote from: Murple2
Quote from: hk135
Quote from: Murple2
Ive not played around with the Debian TP but my understanding is that you'll need to compile a kernel with module support, or compile the driver into the kernel itself. I'm not sure why this isn't the case by default but I'm sure someone here can explain in more detail.

Warm regards
Michael

From what I can see there isn't loadable module support (run lsmod) on the default kernel provided hence why there are some device recognition issues, unless its compiled in its not supported.

hk135

Yes, I wondered why there wasn't module support compiled in? Its kinda important...

Also wondering... I have built a modular kernel. If someone wants to use, downloads and some instructions can be found here: http://www.mygnu.de/index.php/2018/06/modu...the-gemini-pda/ (http://www.mygnu.de/index.php/2018/06/modular-linux-kernel-for-the-gemini-pda/)

Hoping this (or a better kernel) can be included in the next TP.

Mith
Title: PL2303 serial adapter drivers?
Post by: cdnt on June 20, 2018, 06:57:01 am
Quote from: mithrandir
Also wondering... I have built a modular kernel. If someone wants to use, downloads and some instructions can be found here: http://www.mygnu.de/index.php/2018/06/modu...the-gemini-pda/ (http://www.mygnu.de/index.php/2018/06/modular-linux-kernel-for-the-gemini-pda/)

Hoping this (or a better kernel) can be included in the next TP.

Mith

Mith, many thanks for this!  I'll stick with my static one for the moment but have bookmarked for if discover I have anything else I want to connect to it in future.
Title: PL2303 serial adapter drivers?
Post by: speculatrix on June 29, 2018, 12:13:49 pm
I just tested two USB to serial adaptors, which work fine in Android, one is a Prolific and the other FTDI. Neither work in Gemian. I'll have to consider changing the kernel, thanks @mithrandir for making one available.
Title: PL2303 serial adapter drivers?
Post by: speculatrix on June 29, 2018, 12:22:52 pm
@mithrandir, does flashing your modular kernel with your instructions wipe the system partition, or does it solely replace the kernel?
thanks
Title: PL2303 serial adapter drivers?
Post by: mithrandir on June 30, 2018, 05:12:29 pm
Quote from: speculatrix
@mithrandir, does flashing your modular kernel with your instructions wipe the system partition, or does it solely replace the kernel?
thanks
It only replaces the kernel. Just make sure the other partitions are unchecked in the flash tool.
Title: PL2303 serial adapter drivers?
Post by: Dr. Watson on July 13, 2018, 05:59:21 pm
Quote from: mithrandir
It only replaces the kernel. Just make sure the other partitions are unchecked in the flash tool.

Hi J..... aaahhm mithrandir,

First of all: Thank you so much !!!!!!!!!!    

I simply dd-ed your kernel to /dev/block/disk/by-partlabel/linux_boot, was that wrong?

Like:
Download mithrandir's kernel, unzip and flash while on your Gemini:

root@gemini:/home/gemini# find /dev/block/ | grep linux
/dev/block/disk/by-partlabel/linux_boot
/dev/block/disk/by-partlabel/linux

dd if=/root/kernel_from_mithrandir/linux_boot-gemini-3.18.41+.img  of=/dev/block/disk/by-partlabel/linux_boot

Download mithrandir's modules/firmware tgz and untar:

cd /
tar -xzf /root/modules_from_mithrandir/modules_firmware-gemini-3.18.41+.tar.gz

Reboot. Everything works just fine. (Have I been pwned now? ).

Unfortunately one of the first things I was missing in your modules is the usb gadget drivers.
To compile your kernel, did you use sources from https://github.com/gemian (https://github.com/gemian) ???
I want to try to copy your kernel's config and play around a little bit. I have no experience in kernel compilation, let alone cross compilation. Let's see how well I can brick my Gem.

Regards,
DrW
Title: PL2303 serial adapter drivers?
Post by: mithrandir on July 13, 2018, 08:42:45 pm
Quote from: Dr. Watson
Quote from: mithrandir
It only replaces the kernel. Just make sure the other partitions are unchecked in the flash tool.

Hi J..... aaahhm mithrandir,

First of all: Thank you so much !!!!!!!!!!    

I simply dd-ed your kernel to /dev/block/disk/by-partlabel/linux_boot, was that wrong?

Like:
Download mithrandir's kernel, unzip and flash while on your Gemini:

root@gemini:/home/gemini# find /dev/block/ | grep linux
/dev/block/disk/by-partlabel/linux_boot
/dev/block/disk/by-partlabel/linux

dd if=/root/kernel_from_mithrandir/linux_boot-gemini-3.18.41+.img  of=/dev/block/disk/by-partlabel/linux_boot

Download mithrandir's modules/firmware tgz and untar:

cd /
tar -xzf /root/modules_from_mithrandir/modules_firmware-gemini-3.18.41+.tar.gz

Reboot. Everything works just fine. (Have I been pwned now? ).

Unfortunately one of the first things I was missing in your modules is the usb gadget drivers.
To compile your kernel, did you use sources from https://github.com/gemian (https://github.com/gemian) ???
I want to try to copy your kernel's config and play around a little bit. I have no experience in kernel compilation, let alone cross compilation. Let's see how well I can brick my Gem.

Regards,
DrW

Hi,
dd is fine. The flash tool is only needed when Linux is the primary OS. Is this still true?
Yes, I have used the sources from https://github.com/gemian/gemini-linux-kernel-3.18 (https://github.com/gemian/gemini-linux-kernel-3.18).
I am currently creating a new kernel config, because the old one still lacks support for quite some devices including the ethernet adapter of the PC hub. So I'll also have a look into the gadget drivers now.
Mith
Title: PL2303 serial adapter drivers?
Post by: mithrandir on July 14, 2018, 08:01:19 pm
Unfortunately I did not get the gadget drivers working within reasonable time. When selecting "USB functions configurable through configfs" and not the default Android gadget (from  the original kernel config), well and some sub options. this results in compiler or linker errors. maybe we can get this to work later on. I have uploaded what I have to mygnu.de, at least the updated kernel should be better than  the old one.

Anyways I am still hoping for a 4.X kernel, which hopefully fixes the sd card performance issue...

Mith
Title: PL2303 serial adapter drivers?
Post by: speculatrix on July 16, 2018, 05:56:27 pm
yay, the new modular kernel working fine for me, thanks, now I can connect my G to network devices, servers etc.

I installed it using "dd". because my system is triple boot - android, debian and sailfish, I overwrote boot2
Title: PL2303 serial adapter drivers?
Post by: Kiriririn on July 17, 2018, 08:40:49 am
Quote from: mithrandir
Anyways I am still hoping for a 4.X kernel, which hopefully fixes the sd card performance issue...

There's an sd card performance issue?

I've been using F2FS on mine, but it's been perfect
Title: PL2303 serial adapter drivers?
Post by: mithrandir on July 17, 2018, 12:10:00 pm
Quote from: Kiriririn
Quote from: mithrandir
Anyways I am still hoping for a 4.X kernel, which hopefully fixes the sd card performance issue...

There's an sd card performance issue?

I've been using F2FS on mine, but it's been perfect

It looks like.  For all cards I have tried read speed drop to under 20 MB/sec after suspend. @see: http://www.mygnu.de/index.php/2018/07/micr...the-gemini-pda/ (http://www.mygnu.de/index.php/2018/07/micro-sd-card-performance-with-the-gemini-pda/)
Title: PL2303 serial adapter drivers?
Post by: Kiriririn on July 17, 2018, 01:53:52 pm
Quote from: mithrandir
It looks like.  For all cards I have tried read speed drop to under 20 MB/sec after suspend. @see: http://www.mygnu.de/index.php/2018/07/micr...the-gemini-pda/ (http://www.mygnu.de/index.php/2018/07/micro-sd-card-performance-with-the-gemini-pda/)

Ah fair enough, yes I can repro that too via hdparm with the same 64gb orange EVO card, not really noticed it in my real world use though, I guess it'd be more noticeable if random reads were affected
Title: PL2303 serial adapter drivers?
Post by: Jess R on July 19, 2018, 05:04:36 am
Quote from: mithrandir
Also wondering... I have built a modular kernel. If someone wants to use, downloads and some instructions can be found here: http://www.mygnu.de/index.php/2018/06/modu...the-gemini-pda/ (http://www.mygnu.de/index.php/2018/06/modular-linux-kernel-for-the-gemini-pda/)

Hoping this (or a better kernel) can be included in the next TP.

Mith

This is very helpful, thanks! I was a bit confused by the installation section, mine doesn't have a linux_boot, I have boot, boot2 and boot3 .. given I have dual-boot Android/Linux, I guessed at boot2 and seem to be correct
Title: PL2303 serial adapter drivers?
Post by: mithrandir on July 19, 2018, 06:12:54 am
Quote from: Jess R
This is very helpful, thanks! I was a bit confused by the installation section, mine doesn't have a linux_boot, I have boot, boot2 and boot3 .. given I have dual-boot Android/Linux, I guessed at boot2 and seem to be correct

It looks like partition names have changed with the firmware upgrade / new scatter file generator.  Added a sentence clarifying the partition names.
Title: PL2303 serial adapter drivers?
Post by: Kiriririn on July 20, 2018, 04:09:57 pm
Huge thanks to mithrandir for discovering the CONFIG_RCU changes! I've added them to my kernel and it appears to have literally doubled screen-on battery life!

I was previously getting 20-25% per hour, now around 10%. It's also running cooler under the same usage

No idea how it can have made such a difference, but I'm not complaining!