Go Down

Topic: Wifi connection lost, do I have some logs? (Read 3540 times) previous topic - next topic

mantissa00

Jul 14, 2014, 10:17 am Last Edit: Jul 14, 2014, 10:47 am by mantissa00 Reason: 1
Hi!
I have an arduino yun connected to my wifi with upgraded image and sd boot.
Everything working properly but sometimes the connection is lost and the yun resets the wifi configuration and opens the access point.

I don't know exactly why it happens: I think that during the night time the network goes in my home router and the arduino do not find the correct wifi and reset itself.

It seems to me (but my linux knowledge are very limited) that logging is disabled due to flash limitation memory (/var/log contains empty files).. isn't it?
I just found log read, but nothing helps..

Is there any log I can check?
How can I understand where the problem is?
How can disable the wifi configuration reset? Is it sane?
Can the sd-boot be the cause of the problem?
How can I enable the logs again to understand when and why the wifi connection is resetted?
Any kind of helps?

I have an OpenWRT router so I can also write something in the router to see if something goes wrong.. but.. what? (sorry I'm a beginner in the openwrt-network linux side)

It is a very strange situation.. The yun works properly with both processors for days but sometimes the dark side of the stars throw this black spell over my yun and nothing works, I have to connect to the ArduinoYun, set again the wireless password, and reboot it. Kind of annoying.

sonnyyu

Make your Yun wifi bulletproof;-

1. To confirm wifi Signal level:

http://forum.arduino.cc/index.php?topic=188101.msg1583665#msg1583665

My Signal: 100%

2. Check wifi channel spectrum:



The less  neighbors is ,the better is.  Use channel  9 for best result.

further wifi issues reading

http://forum.arduino.cc/index.php?topic=242136.msg1735765#msg1735765





sonnyyu


...
It is a very strange situation.. The yun works properly with both processors for days but sometimes the dark side of the stars throw this black spell over my yun and nothing works, I have to connect to the ArduinoYun, set again the wireless password, and reboot it. Kind of annoying.


Only work arround:

Code: [Select]
nano /etc/rc.local

Code: [Select]
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

#wifi-live-or-reset
boot-complete-notify


exit 0


mantissa00

ok thank you, very helpful.

So, I'd like to replace `wifi-live-or-reset` with `wifi-live-or-log-and-reboot`

could it be something like that?:

Code: [Select]

#!/bin/sh

blink-start 200

IFACE="wlan0"
SLEEP_TIME=2
MAX_SLEEP=60

slept=0

iface_exists=""
iface_is_managed=""
iface_has_ssid=""
iface_is_access_point=""

update_vars() {
    iface_exists=`/usr/sbin/iwconfig $IFACE`
    iface_has_no_ssid=`/usr/sbin/iwconfig $IFACE | grep ESSID\:off\/any`
    iface_is_access_point=`/usr/sbin/iwconfig $IFACE | grep Mode\:Master`
}

wait_for_iface() {
    if [ $slept -gt $MAX_SLEEP ]
    then
        /bin/dmesg > /last_dmesg_with_wifi_errors.log
        /bin/sync
#        /sbin/uci set "arduino.@arduino[0].wifi_reset_step=timed_out"
#        /sbin/uci commit arduino
#        /usr/bin/wifi-reset-and-reboot
        exit 1
    fi

    sleep $SLEEP_TIME
    slept=$(($slept + $SLEEP_TIME))

    update_vars
}

update_vars

while [ true ]
do
    if [ "$iface_exists" = "" ]
    then
        wait_for_iface
#    elif [ "$iface_is_access_point" != "" ]
#    then
#        blink-stop
#        exit 0
#    elif [ "$iface_has_no_ssid" != "" ]
#    then
#        wait_for_iface
    else
        blink-stop

        # log down and reboot!
        now=$(date)
        cp /last_dmesg_with_wifi_errors.log "/www/log/last_dmesg_with_wifi_errors_$now.log"
        echo "$now : wifi down, rebooting."

        rm -f /last_dmesg_with_wifi_errors.log
        exit 0
    fi
done


is it correct?

sonnyyu

Should not be hurt. Why not give it try.

mantissa00


mantissa00

ok there is something very strange happening..

The yun is up, I can ping it and ssh into it, because I remember its ip
BUT

In the configuration page of my router (an old to-link with openwrt on it) I can not see the ip address:


(I know that is that machine because I know the mac address and I can ping and ssh because I know the ip it had yesterday via dhcp)

So.. what can it be?

sonnyyu

#7
Jul 17, 2014, 07:14 pm Last Edit: Jul 17, 2014, 07:23 pm by sonnyyu Reason: 1
-74 dBm, signal is poor.

http://forum.arduino.cc/index.php?topic=188101.msg1597553#msg1597553


Your Link Quality= 35%, mine is 100%.

mantissa00

Also with the new workaround script (do not reset configuration) after some days the yun lost the connection and the white led in the board is off.

I have tried to move the router and now
if I go in the router control panel the mac address of the yun has
Signal           Noise   RX Rate                                           TX Rate
-88 dBm   0 dBm   28.9 Mbit/s, MCS 3, 20MHz   21.7 Mbit/s, MCS 2, 20MHz

if I go in the yun luci (advanced panel) I can see the ip of the router with those values:
-71 dBm   -88 dBm   13.0 Mbit/s, MCS 1, 20MHz   28.9 Mbit/s, MCS 3, 20MHz

The router is ~7-8 meter. Honestly I don't think it is really a problem of wifi strength. Am I wrong?

It has to say that I'm using yun openwrt sys upgrade 1.2 (I have installed a bunch of things and if it is possible I won't format everything) and bootable sd card.
Can it be a problem?

In the previous post I realised that I have done a useless log, In my log I have only "wifi down, rebooting."
What kind of more useful information can I log down?

NewLine

Just to confirm that I also see the white led going off when wifi is lost sometimes. Maybe it is a more serious problem than just the wifi link.

mantissa00


NewLine

yes, do you think it has something to do with it?

sonnyyu

#12
Jul 25, 2014, 05:00 pm Last Edit: Jul 25, 2014, 05:02 pm by sonnyyu Reason: 1

...
Signal           Noise   RX Rate                                           TX Rate
-88 dBm   0 dBm   28.9 Mbit/s, MCS 3, 20MHz   21.7 Mbit/s, MCS 2, 20MHz

if I go in the yun luci (advanced panel) I can see the ip of the router with those values:
-71 dBm   -88 dBm   13.0 Mbit/s, MCS 1, 20MHz   28.9 Mbit/s, MCS 3, 20MHz
...


-88 dBm  as Noise  is too high, your s/n (Signal-to-noise ratio) is too low ( only 17 dBm) .  check your wifi channel spectrum,  select less crowded channel.

mantissa00

sonnyyu: why do you think that the wifi low signal makes the system crash?

Go Up