**** BEGIN LOGGING AT Sat Dec 22 02:59:58 2012 Dec 22 13:59:23 Is there any way to debig serial on android Dec 22 13:59:33 s/debig/debug/ Dec 22 14:58:50 is the android serialport-api stable? Dec 22 15:00:37 GNUtoo Mr.zhuang is doing a project with serial poet in android, but he meet some problem, do you know something about serial port? Dec 22 15:01:35 ayaka: what is your question? It's really hard to understand. Dec 22 15:02:57 he have some problem with android serialport api, sometime it can get the output, but sometimes it can't Dec 22 15:03:20 I want to know whether what api is stable or is there alternative Dec 22 15:04:06 ok Dec 22 15:04:10 yes Dec 22 15:04:32 i've serial for many devices... Dec 22 15:05:05 htc dream,crespo,maguro,gta02,gta04... Dec 22 15:06:16 I am ayaka, have you used the android serialport api? Dec 22 15:07:21 I only know this api can operate serial port, and it is hard to debug, can I use cat to get the raw output from serial port Dec 22 15:07:30 like cat /dev/ttyS2 Dec 22 15:14:38 no, i used serial as normal serial... Dec 22 15:15:20 first look if your serial port is ocupated already... Dec 22 15:15:30 you use it just as tty , don't you Dec 22 15:15:33 like by a console... Dec 22 15:15:42 I see Dec 22 15:15:43 yes Dec 22 15:16:05 i use it for: Dec 22 15:16:14 *console Dec 22 15:16:24 *boot messages Dec 22 15:16:31 *kgdb Dec 22 15:17:58 basically for debugging Dec 22 15:18:15 can minicom show its recived in hex format? Dec 22 15:19:13 hmm Dec 22 15:19:42 where? Dec 22 15:19:49 because Dec 22 15:19:53 in screen Dec 22 15:20:14 1)configure the serial (speed etc...) Dec 22 15:20:27 2) hexdump the dev Dec 22 15:20:48 1) is with stty Dec 22 15:20:55 use stty to set speed then use hexdump to recived Dec 22 15:21:25 I see, I will install busybox right now Dec 22 15:22:17 yes Dec 22 15:22:35 it should.work on both sides.... Dec 22 15:22:54 if the serial port is not already used Dec 22 15:23:08 like by a console Dec 22 15:23:38 or a debugger(FIQ debugger for instance) Dec 22 15:23:39 but there is problem, how to send data in hex mode? does hexdump can do that Dec 22 15:24:12 without sending a data first, the remote won't return a data Dec 22 15:24:19 use python or C Dec 22 15:25:05 I see, I will let them install s4droid Dec 22 15:25:08 print "\xff" in python i think Dec 22 15:25:23 then put that in a file Dec 22 15:25:43 like that: Dec 22 15:25:59 python test.py > file Dec 22 15:26:18 cat file > /dev/tty... Dec 22 15:27:05 i don't have python to test the print argument here... Dec 22 15:28:01 can I use hexedit to make a file in pc, then use adb push to android, then cat file > /dev/ttyS2 Dec 22 15:28:26 yes Dec 22 15:28:37 that would work too Dec 22 15:28:40 I think I need to adb client, one runing hexdump, the cleint2 cat that file Dec 22 15:29:11 only that i usually copy strace output... Dec 22 15:29:28 so python is easier for me... Dec 22 15:32:42 I don't think my bad python skill can help him, he need to show his project after 8 hours Dec 22 15:36:18 it 's just writing print in a file.... Dec 22 15:36:52 but configure python in android is another problem Dec 22 15:37:39 just generate the file on your pc Dec 22 15:38:04 and adb push it Dec 22 15:38:11 then cat it.... Dec 22 15:38:26 yes, I am trying Dec 22 15:38:29 but an hex editor works too Dec 22 15:50:43 GNUtoo-desktop, can hexdump show real time data Dec 22 15:51:22 yes Dec 22 15:51:51 there is a buffer involved tough Dec 22 15:53:02 I try to test hexdump, I conect mobile to PC, I cat /dev/urandom > /dev/ttyUSB0, but the hexdump only show me 1 line Dec 22 15:54:08 try hexdump /dev/urandom Dec 22 15:54:19 you'll see that it works fine Dec 22 15:54:20 in PC or mobile? Dec 22 15:54:24 in whatever Dec 22 15:54:56 but first of all you didn't look if the serial is ocupated Dec 22 15:55:07 for instance it could be used by a console Dec 22 15:55:14 and you would have issues if it's the case Dec 22 15:55:37 ok, yes it work, then I wil try again Dec 22 15:56:50 oh, sorry, I forgot to set speed in PC side Dec 22 15:57:01 I will do real test now Dec 22 15:57:12 also try hexdump -C Dec 22 15:57:28 and echo strings to the serial port Dec 22 16:01:17 but how to clean the buffer of serial in mobile, it can't stop output, even I have disconnect it from PC Dec 22 16:04:21 kill the program which send characters on serial Dec 22 16:04:38 but there is no program Dec 22 16:04:57 it doesn't connect to anything Dec 22 16:05:43 ? Dec 22 16:05:59 "it can't stop output, even I have disconnect it from PC" Dec 22 16:06:33 sorry, I type wrong Dec 22 16:08:28 what did you type wrong? Dec 22 16:09:04 let us back to "I will only receive one line data" Dec 22 16:09:44 I type hexdump /dev/urandom, I think I get the correct data from PC side cat Dec 22 16:09:58 ok Dec 22 16:11:27 I cat /dev/urandom > /dev/ttyS2 in mobile then hexdump in PC , it works Dec 22 16:12:20 ok Dec 22 16:12:23 but then I switch, cat /dev/urandom > /dev/ttyUSB0 in PC then hexdump in mobile, I will only receive a line of data Dec 22 16:12:36 maybe it's badly wired? Dec 22 16:13:21 but aagain you didn't told me if there was a console or not on /dev/ttyS2 Dec 22 16:14:07 no, is there is not other program which is using serial port in both side Dec 22 16:14:26 it's not necessarly a program Dec 22 16:14:32 it can be another driver too Dec 22 16:14:35 like FIQ debugger Dec 22 16:14:39 or something like that Dec 22 16:15:00 please cat /proc/cmdline on mobile Dec 22 16:16:04 oh, console=ttyS2 Dec 22 16:17:12 lucky, it is a OMAP platfom, I wish it use uboot Dec 22 16:18:02 can you paste the full line? Dec 22 16:18:21 because console= usually prints stuff during boot Dec 22 16:18:33 but after boot....nothing I think Dec 22 16:18:44 I must try to be sure Dec 22 16:18:56 unless you have getty or something like that Dec 22 16:18:58 yes, wait a moment Dec 22 16:19:07 on android too it spawns shell on such consoles Dec 22 16:19:21 http://paste.debian.net/218295/ Dec 22 16:19:24 for instance I've serial on crespo+maguro Dec 22 16:19:29 and there is a non-root shell Dec 22 16:19:32 on the main serial port Dec 22 16:20:22 what device is it? Dec 22 16:20:31 because last time you were with an msm device Dec 22 16:20:39 it is OMAP develop board Dec 22 16:20:52 anyway for safety remove console= and androidboot.console= Dec 22 16:20:54 it is not mine, it is Mr.zhuang's Dec 22 16:21:04 yes but that board has a name Dec 22 16:21:08 like pandaboard Dec 22 16:21:14 or beagleboard Dec 22 16:21:46 it is made by XiaMen university, it is called WS-DM37X01 Dec 22 16:22:05 but I don't know "on android too it spawns shell on such consoles" Dec 22 16:22:50 ok Dec 22 16:23:18 just picocom -b 115200 /dev/ttyUSB0 Dec 22 16:23:23 and look if you have a shell Dec 22 16:23:43 on PC of course Dec 22 16:25:20 Terminal ready Dec 22 16:25:47 GNUtoo-desktop, how to kill that? Dec 22 16:28:22 CTRL+A Dec 22 16:28:24 Q Dec 22 16:28:36 oops Dec 22 16:28:37 but how to disable it for even Dec 22 16:28:38 CTRL+A Dec 22 16:28:40 CTRL+Q Dec 22 16:28:57 so there is a shell on the serial port? Dec 22 16:29:05 yes Dec 22 16:29:28 it show "Terminal ready" in picocom Dec 22 16:30:00 and? Dec 22 16:30:05 that's part of picocom Dec 22 16:30:20 I type enter, I enter the shell Dec 22 16:30:25 ok Dec 22 16:30:26 so that's bad Dec 22 16:30:28 remove the shell Dec 22 16:30:36 but how to? Dec 22 16:30:37 edit the kernel boot arguments Dec 22 16:31:05 does it cause by kenrel boot arguments, but by android? Dec 22 16:31:11 does it cause by kenrel boot arguments, but not by android? Dec 22 16:31:22 I think it's kernel boot arguments Dec 22 16:31:39 since it's a devboard Dec 22 16:31:39 ok, I will try to use uboot Dec 22 16:31:44 and that devboards have USB Dec 22 16:31:49 maybe do: Dec 22 16:31:50 yes Dec 22 16:32:19 devboard->USB->usb-serial-adapter->serial-null-modem-cable<->usb-serial-adapter<-computer Dec 22 16:32:20 ? Dec 22 16:32:27 that's way easier Dec 22 16:33:13 no,no, devboard has serial port, devboard>serial>usb-serial-adapter>computer Dec 22 16:33:34 yes Dec 22 16:33:36 I know that Dec 22 16:33:45 but I was suggesting a way to avoid editing uboot and such Dec 22 16:33:59 so that you use a serial port without a shell on it Dec 22 16:34:11 because it won't spawn a shell on /dev/ttyUSB0 on your phone Dec 22 16:36:13 sorry, the serial in devboard(phone) is /dev/ttyS2 Dec 22 16:37:07 yes I know Dec 22 16:37:15 but I mean since /dev/ttyS2 is occupated Dec 22 16:37:26 if you have 2* USB->Serial adapter Dec 22 16:37:52 you plug 1 in the devboard, 1 in your pc, you put a null-modem cable in between Dec 22 16:38:08 that way the 1 that you put in the devboard won't be used by a console Dec 22 16:38:19 because /dev/ttyUSB* are usually not used by consoles Dec 22 16:39:36 but there is problem, I think devboard doesn't support usb-to-serial adapter, because I don't build in driver Dec 22 16:40:09 ok Dec 22 16:40:13 then edit the bootloader Dec 22 16:40:19 and the devboard has nic, I can use it for devlop. Dec 22 16:40:26 and hope that userspace won't spawn a shell Dec 22 16:40:49 ok, I will try Dec 22 16:41:03 bbl Dec 22 16:54:41 GNUtoo-desktop, it seems works, thank you very much, then just save uboot env Dec 22 16:54:48 and making it stable Dec 22 16:57:34 ok Dec 22 16:57:36 np Dec 22 16:59:07 next time try to answer the question I ask Dec 22 16:59:17 like for if there was already a console on the port Dec 22 16:59:24 and if you don't know how to do it, then ask Dec 22 17:10:09 GNUtoo-desktop, I am very sorry Dec 22 17:10:40 ok Dec 22 17:14:21 it seems cause some problem in android, I am not sure, please wait a moment Dec 22 17:16:10 ok Dec 22 17:18:53 first problem is about uboot, I set bootargs and saveenv, then nand read 0x82000000 0x280000 0x300000; bootm Dec 22 17:18:57 it works Dec 22 17:19:20 but if I doesn't interrupt uboot next time, it can't work Dec 22 17:19:36 do: Dec 22 17:19:38 printenv Dec 22 17:19:40 and read that Dec 22 17:21:04 prinenv outputs too much. just printenv bootargs;? Dec 22 17:21:58 no, read it completely Dec 22 17:22:06 bootargs is probably set by a command Dec 22 17:22:16 like not stored Dec 22 17:22:21 but set dynamically Dec 22 17:23:02 but how to? there is no less Dec 22 17:23:26 printenv|less Dec 22 17:23:29 can't work Dec 22 17:23:30 scroll back in your computer Dec 22 17:23:40 I see Dec 22 17:25:01 does this part cause problem ? http://paste.debian.net/218312/ Dec 22 17:27:05 GNUtoo-desktop, so, just modify commonargs ? Dec 22 17:27:49 let me look Dec 22 17:28:04 yes I guess so Dec 22 17:32:16 http://paste.debian.net/218313/ in line 28 Dec 22 17:34:50 bootcmd Dec 22 17:34:55 that's where it starts Dec 22 17:35:16 GNUtoo-desktop, so setenv bootcmd? Dec 22 17:35:23 no Dec 22 17:35:29 read starting from bootcmd Dec 22 17:35:54 ignore line 28 and 29? Dec 22 17:36:30 no Dec 22 17:36:34 just be sure they're run Dec 22 17:36:48 look at what it prints during boot Dec 22 17:37:05 so let it auto boot? Dec 22 17:37:33 yes, just change the right line so it sets the right arguments Dec 22 17:37:41 read the whole thing Dec 22 17:38:16 start from bootcmd Dec 22 17:39:03 I see, I think it is nandboot, not nandboot_dvi, becuase it outputs to lcd not to dvi(it can) Dec 22 17:39:12 but I will follow you Dec 22 17:40:37 http://paste.debian.net/218315/ Dec 22 17:42:44 GNUtoo-desktop, so modify nandboot? Dec 22 17:48:15 yes, if you boot on the NAND Dec 22 17:50:16 do I need to also remove "rw" behind "androidboot.console=ttyS2" Dec 22 17:51:50 no Dec 22 17:51:54 rw is for filesystem Dec 22 17:52:17 I see, but there is not "rootfs=" near by Dec 22 17:53:34 just remove what's doing =ttyS2 Dec 22 17:53:44 don't forget the console= Dec 22 17:56:52 yes Dec 22 17:57:36 but in android, adbd seems can't work, lsusb in PC doesn't show our devboard Dec 22 18:01:29 in windows PC, it show in devboard , but adb can't find it Dec 22 18:06:09 GNUtoo-desktop, does it cause by serial port? Dec 22 18:15:57 no idea Dec 22 18:17:33 GNUtoo-desktop, thank you very much, actually, some of parts works, just a little problem reminds Dec 22 18:18:06 ok Dec 22 18:18:20 it happends in android program exits, that time serial will has some problem, let me fix adb first Dec 22 18:18:25 cmd Dec 22 18:18:40 sorry Dec 22 22:59:18 GNUtoo-desktop, thank you so muchm there is still one problem remain, I add script in /init.rc that I want to up eth0 and set dhcp but it can't work Dec 22 22:59:38 ah ok Dec 22 22:59:45 I'll go to sleep right now tough **** ENDING LOGGING AT Sun Dec 23 02:59:59 2012