Topic: Not automatically connecting to a previously configed wifi connection

It seems that some Chumbys don't remmeber or unable to use a pre existing wifi conneciton.

In other words setup a wifi connection on the Chumby. The Chumby connects and runs fine.

Now restart the Chumby and instead of automatically using the previously configured wifi connection it shows the use existing/create new one screen.

On some Chumbys this happens about 60% of times after a reboot. On other Chumbys this happens maybe 10% of the time.

Is this a known issue? Bug?

Thanks
-Sam

Re: Not automatically connecting to a previously configed wifi connection

We're not aware of this behavoir - the chumby *should* attempt to connect to the last configured network and only bring up that dialog if it's unsuccessful.

Re: Not automatically connecting to a previously configed wifi connection

I am seeing this consistently (on multiple Chumbys). What information can I get from Chumby to help track this down?

Also I noticed that this happens more frequently when I have a USB stick plugged in and there are things that are started through userhook0&2.

Re: Not automatically connecting to a previously configed wifi connection

You could try to collect information using a USB stick.

For instance, you could do something like this in userhook/debugchumby file:

#!/bin/sh
ifconfig > /mnt/usb/ifconfig.txt
iwconfig > /mnt/usb/iwconfig.txt
iwlist rausb0 accesspoints > /mnt/usb/iwlist.txt
network_status.sh > /mnt/usb/network_status.txt
sync

..then examine the output files.  This might uncover some clue about why it's having trouble with the internal wifi.

Re: Not automatically connecting to a previously configed wifi connection

I will try that... One other piece of information which I see some errors in dmesg when this happens here is a snippet:

[   18.050000] rt73 driver version - 1.0.4.0 CVS
[   20.860000] RT73-INFO NICInitAsicFromEEPROM().1458: bHardwareRadio --> 0
[   20.880000] ***rt73***: Interface goes up for the first time, activating permanent MAC
[   20.900000] drivers/mfd/chumby-tsc2100.c/tsc2100_dma_play_isr(): timed-out wating for DMA to start.
[   20.920000] ***rt73***: Active MAC is: 00:1d:0f:b2:81:bc.
[   28.010000] RT73-OOPS!!! RTMPCheckRxDescriptor().2989: CipherErr 1 (len = 60, Mcast=1, Cipher=wep128, KeyId=0)
[   28.030000] RT73-OOPS!!! RTMPCheckRxDescriptor().2989: CipherErr 1 (len = 60, Mcast=1, Cipher=wep128, KeyId=0)
[   28.050000] drivers/mfd/chumby-tsc2100.c/tsc2100_dma_play_isr(): timed-out wating for DMA to start.
[   28.070000] sense1_task_record: FIFO is full, PWM write ignored.
[   28.110000] sense1_task_record: FIFO is full, PWM write ignored.
[   28.120000] sense1_task_record: FIFO is full, PWM write ignored.
[   28.990000] RT73-OOPS!!! RTMPCheckRxDescriptor().2989: CipherErr 1 (len = 60, Mcast=1, Cipher=wep128, KeyId=0)
[   29.010000] drivers/mfd/chumby-tsc2100.c/tsc2100_dma_play_isr(): timed-out wating for DMA to start.
[   29.030000] sense1_task_record: FIFO is full, PWM write ignored.
[   29.050000] sense1_task_record: FIFO is full, PWM write ignored.
[   29.070000] sense1_task_record: FIFO is full, PWM write ignored.
[   29.970000] RT73-OOPS!!! RTMPCheckRxDescriptor().2989: CipherErr 1 (len = 60, Mcast=1, Cipher=wep128, KeyId=0)
[   30.970000] RT73-OOPS!!! RTMPCheckRxDescriptor().2989: CipherErr 1 (len = 60, Mcast=1, Cipher=wep128, KeyId=0)
[   31.010000] sense1_task_record: FIFO is full, PWM write ignored.
[   31.970000] RT73-OOPS!!! RTMPCheckRxDescriptor().2989: CipherErr 1 (len = 60, Mcast=1, Cipher=wep128, KeyId=0)
[   31.990000] RT73-OOPS!!! RTMPCheckRxDescriptor().2989: CipherErr 1 (len = 60, Mcast=1, Cipher=wep128, KeyId=0)
[   32.010000] RT73-OOPS!!! RTMPCheckRxDescriptor().2989: CipherErr 1 (len = 60, Mcast=1, Cipher=wep128, KeyId=0)

Re: Not automatically connecting to a previously configed wifi connection

From the script you gave me to run it looks like on reboot the Chumby is picking the wifi access point that is at the top of the list instead of the one that was used last? I am not sure how the list is rank ordered but that is what it looks like to me.

It should be picking 00:0C:41:66:71:49 which my wifi access point (ssid: shyster2) but instead it is trying to connect to 00:1F:B3:05:F6:E9 which is someone else's access point (ssid: 2WIRE729).

Some more info from the script:

chumby:/mnt/usb# cat ifconfig.txt

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:137 errors:0 dropped:0 overruns:0 frame:0
          TX packets:137 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:14134 (13.8 KiB)  TX bytes:14134 (13.8 KiB)

rausb0    Link encap:Ethernet  HWaddr 00:1D:0F:B2:81:BC
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:328 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:25458 (24.8 KiB)  TX bytes:2046 (1.9 KiB)

chumby:/mnt/usb# cat iwconfig.txt

rausb0    RT73 WLAN  ESSID:"2WIRE729"
          Mode:Managed  Frequency=2.427 GHz  Access Point: 00:1F:B3:05:F6:E9
          Bit Rate=9 Mb/s
          RTS thr:off   Fragment thr:off
          Encryption key: (a WEP key)
          Link Quality=85/100  Signal level:-54 dBm  Noise level:-79 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

chumby:/mnt/usb# cat iwlist.txt

rausb0    Peers/Access-Points in range:
    00:1F:B3:05:F6:E9 : Quality:85/100  Signal level:-54 dBm  Noise level:-79 dBm
    00:22:3F:9A:12:4D : Quality:69/100  Signal level:-70 dBm  Noise level:-79 dBm
    00:22:A4:E4:03:F1 : Quality:93/100  Signal level:-46 dBm  Noise level:-79 dBm
    00:0C:41:66:71:49 : Quality:100/100  Signal level:-34 dBm  Noise level:-79 dBm

chumby:/mnt/usb# cat network_status.txt

<network>
        <interface if="rausb0" up="true" link="true" gateway="">
                <stats rx_bytes="25614" rx_packets="330" rx_errs="0" rx_drop="0" rx_fifo="0" rx_frame="0" rx_compressed="0" rx_multicast="0" tx_bytes="2046" tx_packets="28" tx_errs="0" tx_drop="0" tx_fifo="0" tx_colls="0" tx_carrier="0" tx_compressed="0" wifi_link="85." wifi_level="202" wifi_noise="177" />
                <error>failed to obtain IP address</error>
                <error>chumby.com is unreachable</error>
        </interface>
<configuration gateway="" ip="" nameserver1="" encryption="WEP" key="[Our WEP Key]" hwaddr="00:0C:41:66:71:49" nameserver2="" auth="WEPAUTO" netmask="" type="wlan" ssid="shyster2" allocation="dhcp" encoding="hex" />
</network>

Re: Not automatically connecting to a previously configed wifi connection

Thanks - we're looking at this now.

Re: Not automatically connecting to a previously configed wifi connection

It does indeed look like it's associating with the wrong AP.

Could you please post the contents of /psp/network_config and /psp/network_configs (be sure to edit out the WEP keys).

It would also be helpful to know what you're doing in the userhooks if that seems to be exacerbating the problem.

Thanks

Re: Not automatically connecting to a previously configed wifi connection

Here is the info:

chumby:~# cat /psp/network_config

<configuration gateway="" ip="" nameserver1="" encryption="WEP" key="[ Our key ]" hwaddr="00:0C:41:66:71:49"
nameserver2="" auth="WEPAUTO" netmask="" type="wlan" ssid="shyster2" allocation="dhcp" encoding="hex" />

chumby:~# cat /psp/network_configs

<configurations><configuration allocation="dhcp" key="[ Our key ]" encoding="hex" encryption="WEP" 
auth="WEPAUTO" hwaddr="00:0C:41:66:71:49" ssid="shyster2" type="wlan" /></configurations>

Re: Not automatically connecting to a previously configed wifi connection

Thanks

Re: Not automatically connecting to a previously configed wifi connection

Just realized I did not answer your other question.

Userhook0 just loads two drivers:
/sbin/insmod /mnt/usb/usbserial.ko
/sbin/insmod /mnt/usb/cp2101.ko

Userhook2 is a bit more complex. It starts a script that runs in the background. Here is a breakdown
1. Wait for network (otherwise the time might be set to 1970)
2. calls sync_time.sh
3. Issues a wget to get some of our software
4. unzips it onto the usb stick
5. Starts SSHD
6. Starts some of our apps that read from our board and a USB device
7. Starts an internal httpd server on port 8080 which our widgets talks too

I initially suspected that us doing any sort of network access from userhook2 was messing things up but since it also happens without our USB stick plugged in I don't think it has anything to do with it.

Hope this helps
-Sam

Re: Not automatically connecting to a previously configed wifi connection

Thanks -

A couple more bits of data we need, please add to the above script:

iwlist rausb0 scan > /mnt/usb/iwlist_scan.txt
ap_scan > /mnt/usb/ap_scan.txt

Is your neighbor's AP ("2WIRE729") completely open (ie no encryption)?

Re: Not automatically connecting to a previously configed wifi connection

The other (2WIRE729) access point is secure (not open).

Also I noticed that a hard reboot is more likely to cause this then a soft one. Hard being pressing the off button on the back and soft being issuing a "reboot_normal.sh" command.

Here is the info you asked for.

chumby:/mnt/usb# cat iwlist_scan.txt

rausb0    Scan completed :
          Cell 01 - Address: 00:22:A4:E4:03:F1
                    ESSID:"2WIRE775"
                    Mode:Managed
                    Channel:8
                    Encryption key:on
                    Bit Rates:1 Mb/s; 24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                              2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 18 Mb/s
                    Quality:89/100  Signal level:-50 dBm  Noise level:-79 dBm
          Cell 02 - Address: 00:1F:B3:05:F6:E9
                    ESSID:"2WIRE729"
                    Mode:Managed
                    Channel:4
                    Encryption key:on
                    Bit Rates:1 Mb/s; 24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                              2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 18 Mb/s
                    Quality:83/100  Signal level:-56 dBm  Noise level:-79 dBm
          Cell 03 - Address: 00:22:3F:9A:12:4D
                    ESSID:"BlueHillsCon"
                    Mode:Managed
                    Channel:6
                    Encryption key:on
                    Bit Rates:1 Mb/s; 24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                              2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 18 Mb/s
                    Quality:61/100  Signal level:-78 dBm  Noise level:-79 dBm
          Cell 04 - Address: 00:0C:41:66:71:49
                    ESSID:"shyster2"
                    Mode:Managed
                    Channel:11
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Quality:91/100  Signal level:-48 dBm  Noise level:-79 dBm

chumby:/mnt/usb# cat ap_scan.txt

<aps>
 <ap mode="Managed" encryption="WEP" channel="8" hwaddr="00:22:A4:E4:03:F1" auth="WEPAUTO" linkquality="-50" signalstrength="89" ssid="2WIRE775" noiselevel="-79" />
 <ap mode="Managed" encryption="WEP" channel="4" hwaddr="00:1F:B3:05:F6:E9" auth="WEPAUTO" linkquality="-58" signalstrength="81" ssid="2WIRE729" noiselevel="-79" />
 <ap mode="Managed" encryption="TKIP" channel="6" hwaddr="00:22:3F:9A:12:4D" auth="WPAPSK" linkquality="-72" signalstrength="67" ssid="BlueHillsCon" noiselevel="-79" />
 <ap mode="Managed" encryption="WEP" channel="11" hwaddr="00:0C:41:66:71:49" auth="WEPAUTO" linkquality="-48" signalstrength="91" ssid="shyster2" noiselevel="-79" />
</aps>

Re: Not automatically connecting to a previously configed wifi connection

Thanks again.

Note that we already have usbserial.ko in /drivers - did you have to build a special version?

Re: Not automatically connecting to a previously configed wifi connection

No problem...

So looks like it is ranking them by fastest first and best signal second. since our access point can only do 11Mbs it gets shoved to the bottom of the list? Of course this does not explain why it forgets what it was connected to in the first place hmm

Re: Not automatically connecting to a previously configed wifi connection

We're not sure what's going on - we've never seen a chumby associate with the wrong access point like this.

Re: Not automatically connecting to a previously configed wifi connection

I was hoping for a different answer smile

BTW it is not just one Chumby. At one point or another all of our Chumbys have done this. Right now we have about 6 that are doing it consistently.

Thanks again for digging into this
-Sam

Re: Not automatically connecting to a previously configed wifi connection

Hmm for what it's worth I (may) have seen the same problem on my chumby.

I run a secured wireless access point and my chumby generally connects to it just fine after reboots. However from time to time I get a transient wireless signal from another wireless point, and this stops the chumby from booting automagically as it stops on the wireless connection screen.

The other AP is running some sort of encryption, and has a name lexographically lower (before) mine, so it ends up as the top AP.

I think you guys might be on to something where you have suggested this issue may be due to the chumby trying to associate with the lowest (first) AP by name, rather than the last (or known) APs.

Happy to help debug but as this is only a transient issue for me that might be tricky...

hth
Clippy

Re: Not automatically connecting to a previously configed wifi connection

Well, in samkwitty's case the AP it's connecting to is not only lexigraphically lowest, it's also on the lowest numbered channel.

This is a bit of a mystery - I have to admit we're a bit stumped at the moment.  We're thinking hard on it though.

Re: Not automatically connecting to a previously configed wifi connection

Duane,

I guess I am confused... Should it not simply select the last access point it was connected too?

In other words what difference does it make that there are other access points in the area? Should it not simply ignore everything accept for the last one it connected too?

Also where is the info about the last access point connected too? Is that in network_configs?

-Sam

Re: Not automatically connecting to a previously configed wifi connection

Hi Sam,

/psp/network_config contains connection details for the last network used. The chumby will use the information from there to attempt the connection first. If it fails, the user is presented with the "New or existing connection" screen, from which you can select to use any of the previous successfully configured network connections.

/psp/network_configs contains these configurations, in your case, just the one that you were using. If you select that existing connection for "shyster2" and try to connect to it again, does it still fail?

Also, can you try switching to a WPA2 (or WPA if your access point does not support WPA2) authentication method for your wifi network and see if that helps with the connection matters?

Can you provide the content for the following after you have experienced a faulty connection?:

cat /proc/chumby-wifi/link-status
cat /proc/chumby-wifi/mlme-aux

BWT, what model is your access point?

Thanks.

Re: Not automatically connecting to a previously configed wifi connection

Levy,

Thanks for the clarification.

The AP in this case is a Linksys WAP11 which is an older access point. The one at my house is a Linksys WAP54G a more recent one and I can get this issue to happen at my house as well.

I can not switch that particular access point to WAP2 as it will effect too many people, I will see (on Tuesday) if I have an extra access point which I can use for that purpose).

When I manually issue the connection to shyster2 on the "New or existing connection" screen everything works fine and it connects back up.

I will not be able to get you the link-status and mlme-aux output until Tuesday since the Chumby(s) in question are in the office. I can probably get that info from my Chumby at home (also experiences this issue though less frequently) but that will be a different setup, not sure it matters.

Thanks
-Sam

Re: Not automatically connecting to a previously configed wifi connection

Here is the link status and mlme info.
Seems odd that it is trying to associate our WEP key with APs that are not ours (unless I am reading this print out incorrectly)

chumby:/mnt/usb# cat link-status.txt

3: STATUS=0 NETWORK=INFRA SSID=<2WIRE729> AUTH=UNKNOWN ENCRYPT=WEP KEY=wep128[OUR WEP KEY]
2: STATUS=16 NETWORK=INFRA SSID=<2WIRE775> AUTH=UNKNOWN ENCRYPT=WEP KEY=wep128[OUR WEP KEY]
1: STATUS=16 NETWORK=INFRA SSID=<shyster2> AUTH=UNKNOWN ENCRYPT=WEP KEY=wep128[OUR WEP KEY]

chumby:/mnt/usb# cat mlme-aux.txt

BssType=2 Bssid=[00:1f:b3:05:f6:e9] Ssid=<> AutoReconnectSsid=<>
Alg=0 ScanType=18 Channel=0 Aid=1 CapInfo=0x431
BeaconPeriod=100 BssIdx=2 RoamIdx=0 CurrReqIsFromNdis=0

24

Re: Not automatically connecting to a previously configed wifi connection

samkwitty wrote:

The AP in this case is a Linksys WAP11 which is an older access point. The one at my house is a Linksys WAP54G a more recent one and I can get this issue to happen at my house as well.

In addition to the model numbers, can you please provide the hardware version number and firmware version number for both access points  (e.g. Linksys WAP54G v1.1, firmware version: 3.04)?  We'd like to attempt to reproduce this in-house with your exact configuration.

samkwitty wrote:

When I manually issue the connection to shyster2 on the "New or existing connection" screen everything works fine and it connects back up.

Are you able to successfully connect on the second attempt 100% of the time?

Re: Not automatically connecting to a previously configed wifi connection

Ken,

Yes on second attempt it always connects up. 100%

I don't know the hardware version for the WAP11 (nothing on the access point).

The WAP11 has firmware v2.05
The WAP54G has firmware v3.04 -- I don't have the HW version here... I will get that to you later when I can get access to it.

Also (I think I mentioned this before) this occurs with more frequency on hard reboot then a soft one (hard being using the on/off switch in the back).

Thanks
-Sam