BiPOM Forum

General => GadgetPC => Topic started by: Igor_M on December 14, 2009, 11:54:03 am

Title: linux on gadgetpc
Post by: Igor_M on December 14, 2009, 11:54:03 am
Hi.
How to get linux terminal or console via miniusb gadgetpc. Is possible? What to do in the settings on linux gadgetpc and computer windows, linux.
Can communicate with speakers of Russian engineer via email?
Title: Re: linux on gadgetpc
Post by: vitaliy on December 14, 2009, 02:49:11 pm
yes, it is possible.
It is necessary to install the latest Mini-Max/ARM9 release
which is based on Linux 2.6.30.4
Please download and install http://www.bipom.com/files/mmarm9260e/mmarm9260e_setup.exe
Then copy all the files to USB Flash drive

It is necessary to install a driver on Win PC
http://www.bipom.com/support/gadgetpc/gserial.inf

GadgetPC will appear as a virtual COM port.
Then you can open any terminal program ( for example, hypertertminal)  to establish connection with Linux console

>Can communicate with speakers of Russian engineer via email?
yes, you can send email to tech@bipom.com in Russian.
Jack knows many languages   :)
http://www.bipom.com/support.php

Title: Re: linux on gadgetpc
Post by: franklin97355 on December 22, 2009, 08:04:04 pm
OK here is what I get when I tried this. To start the GadgetPC loads and I can see the console on the serial connection. It gets an IP but I can\'t see it on the net. After installing the new software I get a com port and the PC beeps when it installes the device but the Gadget PC does not boot to a point where I can communicate with it either on the network or over the usb port.
Title: Re: linux on gadgetpc
Post by: vitaliy on December 23, 2009, 01:30:00 am
Please copy and paste  the log you can see on the serial connection.
Maybe your problem is NTPD server. The board tries to connect to Internet to get time. Try to disable that server
in vars.sh
Title: Re: linux on gadgetpc
Post by: franklin97355 on December 23, 2009, 07:35:24 pm
OK, Here it is:

GadgetPC rev 1.07 08/13/2009
BiPOM Electronics, Inc.
www.bipom.com
AT91BootStrap...OK


U-Boot 2008.10 (Feb 24 2009 - 11:45:00)

DRAM:  32 MB
DataFlash:AT45DB642
Nb pages:   8192
Page Size:   1056
Size= 8650752 bytes
Logical address: 0xD0000000
Area 0:      D0000000 to D0003FFF (RO) Bootstrap
Area 1:      D0004000 to D0007FFF      Environment
Area 2:      D0008000 to D002FFFF (RO) U-Boot
Area 3:      D0030000 to D042FFFF      Kernel
Area 4:      D0430000 to D083FFFF      FS
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  2 1 0
(Re)start USB...
USB:   scanning bus for devices... 4 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
reading uimage
...
...
...
................................................................................
................................................................................
..

1665359 bytes read
reading gpcfs.gz
...
...
...
...

** Unable to read "gpcfs.gz" from usb 0:1 **
## Booting kernel from Legacy Image at 21000000 ...
   Image Name:   
   Image Type:   ARM Linux Kernel Image (gzip compressed)
   Data Size:    1665295 Bytes =  1.6 MB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.6.30.4 (mini@mini-max) (gcc version 4.3.2 (Sourcery G++ Lite 200
8q3-41) ) #71 Wed Oct 7 20:03:11 EEST 2009
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Mini-Max/ARM9260
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: mem=32M console=ttyS1,115200 root=/dev/ram0 rw initrd=0x204
10000,0x800000 ramdisk_size=8200
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
PID hash table entries: 128 (order: 7, 512
Title: Re: linux on gadgetpc
Post by: franklin97355 on December 23, 2009, 07:44:48 pm
Well it won\'t let me copy the whole thing so here is the end of what I got.

usb mass storage support registered.
udc: at91_udc version 3 may 2006
g_serial gadget: gadget serial v2.4
g_serial gadget: g_serial ready
mice: ps/2 mouse device common for all mice
rtc-at91sam9 at91_rtt.0: rtc core: registered at91_rtt as rtc0
irq 1/rtc0: irqf_disabled is not guaranteed on shared irqs
rtc-at91sam9 at91_rtt.0: rtc0: set time!
i2c-gpio i2c-gpio: using pins 55 (sda) and 56 (scl)
linux video capture interface: v2.00
at91sam9 watchdog: sorry, watchdog is disabled
at91_wdt: probe of at91_wdt failed with error -5
sdhci: secure digital host controller interface driver
sdhci: copyright(c) pierre ossman
advanced linux sound architecture driver version 1.0.20.
usbcore: registered new interface driver snd-usb-audio
usbcore: registered new interface driver snd-usb-caiaq
alsa device list:
  no soundcards found.
tcp cubic registered
net: registered protocol family 17
vfp support v0.3: not present
rtc-at91sam9 at91_rtt.0: hctosys: unable to read the hardware clock
ramdisk: couldn\'t find valid ram disk image starting at 0.
list of all partitions:
no filesystem could mount root, tried:  ext3 ext2 cramfs vfat romfs
kernel panic - not syncing: vfs: unable to mount root fs on unknown-block(1,0)
[<c002a4ec>] (unwind_backtrace+0x0/0xdc) from [<c0249988>] (panic+0x40/0x110)
[<c0249988>] (panic+0x40/0x110) from [<c0008fb8>] (mount_block_root+0x25c/0x2ac)
[<c0008fb8>] (mount_block_root+0x25c/0x2ac) from [<c00091d0>] (prepare_namespace
+0x164/0x1bc)
[<c00091d0>] (prepare_namespace+0x164/0x1bc) from [<c000859c>] (kernel_init+0xb8
/0xe4)
[<c000859c>] (kernel_init+0xb8/0xe4) from [<c003ce64>] (do_exit+0x0/0x5ac)
[<c003ce64>] (do_exit+0x0/0x5ac) from [<00000001>] (0x1)
g_serial gadget: full speed config #2: cdc acm config
 The case has been set to lower because the website was complaining I was trying to post in all caps.
Title: Re: linux on gadgetpc
Post by: vitaliy on December 24, 2009, 01:56:56 am
I can see the cause

> !!! ** Unable to read "gpcfs.gz" from usb 0:1 ** !!!
U-boot loader can\'t read the gpcfs.gz file from a USB Flash drive.

Please try to  check if you can read the file connecting the USB Flash drive to a PC USB host port.
Also, try to check  the USB Flash drive using standard Windows tools.

> USB:   scanning bus for devices... 4 USB Device(s) found
3 external USB devices are connected to the board.
1 internal device is a USB hub.
If the board is powered from a USB host port of your PC
it can cause problems because it can provide only 500mA.
As the 1st step please disconnect 2 devices ( leave only USB Flash drive) to see.

Title: Re: linux on gadgetpc
Post by: franklin97355 on December 24, 2009, 05:50:26 pm
OK, a bit confused here. Do I copt the gadgetPC files to the flash drive and then add the mmarm9260 files? The file gpcfs.gz is only in the gadgetpc devtools folder and NOT in the newer mmarm9260 devtools folder.

<edit> OK, I tried that and I can get to the OS [root@GadgetPC /] but the wireless does not activate and if I run ifconfig I get nothing but the prompt back.

I only had the flash drive and the wireless device hooked up before so I don\'t know where it found four devices unless it is just countin the ports available.

Thanks for all the help so far, I feel I\'m getting closer.
Title: Re: linux on gadgetpc
Post by: vitaliy on December 25, 2009, 02:13:30 am
>  Do I copt the gadgetPC files to the flash drive and then add the mmarm9260 files?

no, you don\'t need to copy mmarm9260 files at  this stage.
Let\'s simplify everything because you have a serial console.
No needs to copy the mmarm9260 files to get a USB console.


Just format USB Flash drive to FAT32, then copy all files of GadgetPC release. Then, run LCP and edit vars.sh to match your configuration ( enable WiFi,  assign IP, etc.)

Then , boot and show Linux log
Also, try to execute ifconfig command when it reaches [root@GadgetPC /]
Title: Re: linux on gadgetpc
Post by: franklin97355 on December 25, 2009, 10:15:50 pm
ok, reformatted, reflashed with original files and i get the console. the wireless is passing packets as shown here:

Code: [Select]
please press enter to activate this console.
[root@gadgetpc /]$ifconfig
lo        link encap:local loopback
          inet addr:127.0.0.1  mask:255.0.0.0
          up loopback running  mtu:16436  metric:1
          rx packets:0 errors:0 dropped:0 overruns:0 frame:0
          tx packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          rx bytes:0 (0.0 b)  tx bytes:0 (0.0 b)

rausb0    link encap:ethernet  hwaddr 00:24:01:9e:99:9c
          inet addr:192.168.1.190  bcast:192.168.1.255  mask:255.255.255.0
          up broadcast running multicast  mtu:1500  metric:1
          rx packets:121 errors:0 dropped:0 overruns:0 frame:0
          tx packets:225 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          rx bytes:9900 (9.6 kib)  tx bytes:16702 (16.3 kib)

[root@gadgetpc /]$ping 192.168.1.1
ping 192.168.1.1 (192.168.1.1): 56 data bytes

--- 192.168.1.1 ping statistics ---
33 packets transmitted, 0 packets received, 100% packet loss
but i can not see the gadget from my pc or ping from the gadget.
Title: Re: linux on gadgetpc
Post by: vitaliy on December 26, 2009, 02:52:24 am
OK, I can see a wireless interface. It can send and receive packets.  Very nice.
The next step is to configure your router
to create a correct  wireless network. Please look at the picture ( below). Note, your wireless network has to use WEP
(http://www.bipom.com/support/gadgetpc/router.jpg)
Title: Re: linux on gadgetpc
Post by: franklin97355 on December 26, 2009, 01:42:21 pm
(http://farm3.static.flickr.com/2553/4215926137_2464178079_o.jpg
) here is the image
Title: Re: linux on gadgetpc
Post by: vitaliy on December 27, 2009, 01:43:56 am
Default SSID is DLinkRouter
I can see \'franklin\' on your picture.
Did you edit vars.sh ?

Title: Re: linux on gadgetpc
Post by: franklin97355 on December 27, 2009, 01:03:41 pm
Yes, it\'s franklin on my network and in vars.sh. I\'ll double check the flash image to make sure but I changed it the first time and I hope I remembered to do it this last time.
Title: Re: linux on gadgetpc
Post by: franklin97355 on January 07, 2010, 08:48:29 pm
Still no luck connecting to the Gadget over the network. 
Title: Re: linux on gadgetpc
Post by: vitaliy on January 08, 2010, 04:08:37 am
did you re-check SSID ?
Title: Re: linux on gadgetpc
Post by: franklin97355 on January 08, 2010, 07:00:30 pm
Yes, franklin on both devices. Does the GadgetPC do DHCP?
Title: Re: linux on gadgetpc
Post by: vitaliy on January 09, 2010, 03:48:21 am
yes, it can do DHCP.
But in case of WiFi connection the current Shell files do not try to use DHCP. So it can\'t be a problem.
Note, we provide a complete set of wireless executables
under /mnt/usb/wireless/sbin folder
So you can play with different SSID, keys, etc.
/mnt/usb/wireless/sbin/iwconfig rausb0 key KEY
      /mnt/usb/wireless/sbin/iwpriv rausb0 set SSID= SSID

Also, you can use iwlist to  look at the existing network
In my opinion, the hardware layer worked.
I mean WiFi adapters. Also, IPs are correct.
You have problems only with authorization to your Access Point (AP).

Also, did you try to connect to AP ( your router) from a PC with the same key, ssid, wep ?
Title: Re: linux on gadgetpc
Post by: franklin97355 on January 10, 2010, 01:28:32 pm
I\'ll take a look at the other files you referenced but I did test it with another of my computers that connects to the AP wirelessly and your settings work just fine. (WEP and key)
Title: Re: linux on gadgetpc
Post by: franklin97355 on January 26, 2010, 08:41:19 pm
Key looks OK and SSID set to franklin.
ESSID is "" is this correct?
It says it sees a wireless signal at -41db and displays it\'s mac address but still no communications in either direction.
What next?
Title: Re: linux on gadgetpc
Post by: vitaliy on January 27, 2010, 12:39:35 pm
>ESSID is ""
it has to be franklin on both GPC and router
Title: Re: linux on gadgetpc
Post by: franklin97355 on January 27, 2010, 04:36:28 pm
OK I\'ve tried setting the SSID from
./iwpriv rausb0 set SSID= franklin
but this is what I get in return
Code: [Select]
[root@GadgetPC sbin]$./iwconfig rausb0[J
<14:28:09> rausb0    RT73 WLAN  ESSID:off/any  Nickname:""
<14:28:09>           Mode:Auto  Frequency=2.412 GHz  Bit Rate:54 Mb/s
<14:28:09>           RTS thr:off   Fragment thr:off
<14:28:09>           Encryption key:1237-4895-67   Security mode:open
<14:28:09>           Link Quality=0/100  Signal level:-121 dBm  Noise level:-115 dBm
<14:28:09>           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
<14:28:09>           Tx excessive retries:0  Invalid misc:0   Missed beacon:0
<14:28:09> [root@GadgetPC sbin]$
Title: Re: linux on gadgetpc
Post by: vitaliy on January 28, 2010, 03:20:35 am
the correct syntax is

cd /mnt/usb/wireless/sbin
./ifconfig rausb0 192.168.1.15 netmask 255.255.255.0 up
route add default gw 192.168.1.1 rausb0
./iwpriv rausb0 set SSID="franklin"
./iwconfig rausb0 key 1237489567

Title: Re: linux on gadgetpc
Post by: franklin97355 on January 28, 2010, 10:08:50 am
I\'ll try that tonight, thanks.
<edit> This is what I got...caps removed due to forum guidelines
Code: [Select]
[root@gadgetpc sbin]$ifconfig
lo        link encap:local loopback 
          inet addr:127.0.0.1  mask:255.0.0.0
          up loopback running  mtu:16436  metric:1
          rx packets:17 errors:0 dropped:0 overruns:0 frame:0
          tx packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          rx bytes:1904 (1.8 kib)  tx bytes:1904 (1.8 kib)

rausb0    link encap:ethernet  hwaddr 00:24:01:9e:99:9c 
          inet addr:192.168.1.190  bcast:192.168.1.255  mask:255.255.255.0
          up broadcast running multicast  mtu:1500  metric:1
          rx packets:2364 errors:0 dropped:0 overruns:0 frame:0
          tx packets:2661 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          rx bytes:204989 (200.1 kib)  tx bytes:196966 (192.3 kib)

[root@gadgetpc sbin]$./iwpriv rausb0 set ssid="franklin"
[root@gadgetpc sbin]$./iwconfig
lo        no wireless extensions.

rausb0    rt73 wlan  essid:off/any  nickname:""
          mode:auto  frequency=2.412 ghz  bit rate:54 mb/s   
          rts thr:off   fragment thr:off
          encryption key:1237-4895-67   security mode:open
          link quality=0/100  signal level:-121 dbm  noise level:-115 dbm
          rx invalid nwid:0  rx invalid crypt:0  rx invalid frag:0
          tx excessive retries:0  invalid misc:0   missed beacon:0
Title: Re: linux on gadgetpc
Post by: vitaliy on January 29, 2010, 12:47:14 am
NOT ./iwconfig
BUT ./iwconfig rausb0 key 1237489567
Title: Re: linux on gadgetpc
Post by: franklin97355 on January 29, 2010, 10:12:57 am
I understand that. The ./iwconfig was to print out the data for you to see. If you look the key is set correctly as shown in the results returned from the ./iwconfig
Code: [Select]
encryption key:1237-4895-67 Thanks for working on this with me.
Title: Re: linux on gadgetpc
Post by: franklin97355 on February 03, 2010, 06:24:15 pm
I tried ./iwconfig rausb0 Nickname "franklin" and it assigned a nickname but it won\'t stick on restart and it still will not ping either the router or other computers on the network.
Title: Re: linux on gadgetpc
Post by: franklin97355 on February 07, 2010, 04:36:10 pm
According to your email I have started to install Debian on the flash drive. I\'m using Debian to do this and have gotten to page 8. I have the file debian_lenny_armel_small.qcow2 but can\'t extract it.
It appears the debian also does not have mkfs.msdos but I got around that by mounting the flash on a windows box and formatting it there.
What is it I need to do now?
I have a 247M FAT partition on /dev/sdb1 and a 3.3G EXT3 partition on /dev/sdb2.
Thanks for the help.
Title: Re: linux on gadgetpc
Post by: vitaliy on February 08, 2010, 07:18:14 am
Note, the instruction describes all steps how to start from scratch. It is for advanced users who wants to generate
everything from ZERO point.

I guess you have to use the existing packages from bipomftp.

http://www.bipom.com/cgi-bin/yabb2/YaBB.pl?num=1263702424/1#1

1)
Download 2 packages ( Linux kernel and Debian RootFs)
to /home/mini/fs/debian folder
Linux kernel: linux2.6.30.4_06Feb2010.tar.bz2
RootFS (Debian Lenny): debian_rootfs_06Feb2010.tar.bz2

change to that folder
cd  /home/mini/fs/debian

2) Insert  the Flash USB drive to a PC
Let\'s say you have Linux partitions called EXT3
and MSDOS partition called FAT. I mean labels
It has to mount your 2 partitions to
/dev/sdb1 -> /media/FAT
/dev/sdb2 -> /media/EXT3

3)
sudo tar [ch8211]xvjf  debian_rootfs_06Feb2010.tar.bz2

Password is max

It will create EXT3 folder under /home/mini/fs/debian

 4)
Copy all files from EXT3 folder to your Linux partition

sudo cp -R EXT3/* /media/EXT3

5)
sudo tar [ch8211]xvjf  linux2.6.30.4_06Feb2010.tar.bz2
It will create FAT folder under /home/mini/fs/debian

 6)
Copy all files from FAT folder to your  MSDOS partition

sudo cp -R FAT/* /media/FAT

Note, all the steps are described in details on the last page
of the installation guide.


7) Edit /media/EXT3/etc/network/interfaces file to match your needs

8) Unmount Flash drive, connect to Gadget PC.

 Don\'t forget to adapt U-Boot
Code: [Select]
setenv bootargs mem=32M console=ttyS1,115200 root=/dev/sda2 rw rootwait
setenv bootcmd \'usb start; fatload usb 0:1 0x21000000 uimage; bootm 0x21000000\'
saveenv



Title: Re: linux on gadgetpc
Post by: franklin97355 on February 08, 2010, 11:23:07 am
Thanks, I\'ll try this tonight.
Title: Re: linux on gadgetpc
Post by: franklin97355 on February 11, 2010, 08:27:16 pm
Now that I have the new software installed I can\'t get into the GadgetPC using ssh or the USB com port. On ssh it says I need to change the password and restart EVERY time I restart. On the gadgetpc com port it asks for a login but there does not seem to be a way to set one from the config tool. What am I missing and why does this need to be so hard?
Title: Re: linux on gadgetpc
Post by: vitaliy on February 12, 2010, 01:04:38 am
There are 2 pairs of user name / password in accordance with the installation guide
user/user
root/root