Active Topics

 


Reply
Thread Tools
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#1
This module makes your N800 appear as a serial device over USB. Thanks to Stskeeps for mentioning this module, I just compiled it :P.

g_serial can be used a a serial console, so if you manage to insmod it in initfs (you could use bootmenu.conf to do that, or insmod it in linuxrc for really early messages) you can get dmesg messages piped to your computer.

It can be used to get you a shell to your N800 over USB.

Theoretically, this works in windows too unlike g_ether.

I don't know if you can send files over USB serial using this unlike g_ether. But this doesn't require any complicated configuration unlike g_ether.

g_ether can do a lot more than this, ssh, file transfer etc but it's a bit more complicated to setup & RNDIS is broken in windows so it doesn't work in windows.

1. Grab the module from here: http://qwerty12.maemobox.org/modules_libs/g_serial.ko and save it in /lib/modules/2.6.21-omap1/ on the device.

2. Grab this script: http://pastebin.com/f205aa540 and save it somewhere on the device and set it executable.

(Thanks to http://openinkpot.org/wiki/HowToGetShellOverUsb where I got the script from and made a few changes. Thanks to fanoush for the root stuff)

Now, if you want to use that script to get a shell over usb,

1. Run the script from wherever you saved it on the device.
2. Plug in the USB cable to your N8x0.
3. In Linux for example on the computer, run cu -l /dev/ttyACM0 -s 115200
4. When cu says connected, rerun the script on the device.

That openinkpot has a driver and instructions for using g_serial in windows.

Last edited by qwerty12; 2008-09-02 at 08:50.
 

The Following 6 Users Say Thank You to qwerty12 For This Useful Post:
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#2
Sounds useful. If this works with some default Windows usbserial driver this may be easier for someone for recovery.

Files can be sent/received via rz/sz (z-modem protocol), hyperterminal supports it. Also one can even run PPP over it for networking if desperate.

I wonder if it is possible to switch kernel console (where printk goes) on the fly.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.

Last edited by fanoush; 2008-08-28 at 11:05.
 

The Following User Says Thank You to fanoush For This Useful Post:
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#3
Ok, started to integrate usb_serial into initfs. Got it working, just dirty (sometimes works, sometimes doesn't)

(Either use mkfs.jffs2 to do this on the computer or in diablo, remount /mnt/initfs/ rw)

1. In initfs, I needed to place g_serial.ko into /lib/modules/2.6.21-omap1/
x. Download http://qwerty12.maemobox.org/initfs/getty and place it in /sbin/

(initfs lacks getty so I was forced to compile busybox with only getty statically against uclibc) Binary is only 49KB anyway


2. Modify bootmenu.sh with this patch:
http://pastebin.com/m349c7c5d

Press the full screen button at the top when the bootmenu is open. It's a dirty method though to run getty and insmod g_serial though so a cleaner method would be nice

3: Updated usbser function:
http://pastebin.com/m6d2855e1

Much more cleaned up and now does not need getty (thanks to Stskeeps for pointing me to the method)

Last edited by qwerty12; 2008-09-02 at 09:01.
 

The Following 3 Users Say Thank You to qwerty12 For This Useful Post:
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#4
Just to prove this works in windows...

(As you can see, all my network interfaces are disabled)


Last edited by qwerty12; 2008-09-02 at 08:57.
 

The Following User Says Thank You to qwerty12 For This Useful Post:
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#5
Originally Posted by qwerty12 View Post
initfs lacks getty so I was forced to compile busybox with only getty statically against uclibc) Binary is only 49KB anyway
Yes, this is way to go. I also tried to compile another busybox just with the missing stuff (statically agains uclibc :-) Also it is good that same binary can be called in rootfs too when installing/flashing bootmenu so we can use patch, md5sum, ... without any external dependency.
Originally Posted by qwerty12 View Post
Press the full screen button at the top when the bootmenu is open. It's a dirty method though to run getty and insmod g_serial though so a cleaner method would be nice
I guess there should be another submenu with such custom stuff and usb networking with ssh/telnet should be moved there too.

Such menu can be constructed at flashing time depending on choices for extra stuff. Also such extra stuff should be modularized not hardcoded like now. bootmenu installer should discover such modules/packages at initfs jffs2 creation time and call into them to install their stuff into initfs.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 

The Following User Says Thank You to fanoush For This Useful Post:
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#6
Originally Posted by fanoush View Post
I guess there should be another submenu with such custom stuff and usb networking with ssh/telnet should be moved there too.

Such menu can be constructed at flashing time depending on choices for extra stuff. Also such extra stuff should be modularized not hardcoded like now. bootmenu installer should discover such modules/packages at initfs jffs2 creation time and call into them to install their stuff into initfs.
Oh, don't get me wrong, I have no problem with pressing full screen; it's method I'm using to insmod and launch getty that is at fault

Yes, I agree, I like the way you do it for ssh + telnet, the reason why this is messy is because it's unofficial and you need to know what you are doing so far
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#7
sure, no problem with that, I'm just thinking how to do it in more universal way in future. More people may come with ideas and there may be not enough buttons (at least on 770/N800) for everything :-)
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 

The Following User Says Thank You to fanoush For This Useful Post:
Posts: 9 | Thanked: 5 times | Joined on Aug 2008
#8
Can this be adapted to provide a terminal (vt100) emulator directly on the tablet using a usb serial adapter?
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#9
Originally Posted by ensign View Post
Can this be adapted to provide a terminal (vt100) emulator directly on the tablet using a usb serial adapter?
It is not related. You can already do this. Search forum for usb, serial, pl2303, ftdi.

This topic is about tablet acting as usb serial device. Terminal emulator is run on the other end.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 

The Following User Says Thank You to fanoush For This Useful Post:
Posts: 6 | Thanked: 2 times | Joined on Jan 2010
#10
Sorry to bring back such an old thread, but has anyone tried this on the N900?

As the N900 can't support USB host/otg, it's not much good as a 3G interface to a mobile robot.
This, however, might give me reason to buy one after all.
 
Reply

Tags
console, serial, shell, telnet, usb


 
Forum Jump


All times are GMT. The time now is 04:05.