1

I have currently set-up the following for wifi connection

My wpa_supplicant.conf file just had these two lines:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

And my config.txt file I did this:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
   wpa-scan-ssid 1
   wpa-ap-scan 1
   wpa-key-mgmt WPA-PSK
   wpa-proto RSN WPA
   wpa-pairwise CCMP TKIP
   wpa-group CCMP TKIP
   wpa-ssid "My Secret SSID"
   wpa-psk "My SSID PSK"

iface default inet dhcp

The problem lies in the fact that the WiFi seems to disconnect after about an hour. I am using the raspery pi as a kiosk to connect to a website to display information.

Can I use the following below for this hidden network, link here?

Well, there is a very simple solution:

  1. Go to /etc/ifplugd/action.d/ and rename the ifupdown file to ifupdown.original
  2. Then do: cp /etc/wpa_supplicant/ifupdown.sh ./ifupdown
  3. Finally: sudo reboot

That's all. Test this by turning off/on your AP; you should see that your Raspberry Pi properly reconnects.

EDIT:

Can the above work fine with my custom config.txt file as when the raspery pi boots it gets an IP address from the router but I can not the wla0 in the Network GUI settings screen.

Dino
  • 131
  • 5
  • 1
    You are saying you *do* get an IP address for wlan0 just you cannot see it in the GUI tool? What does `ip addr show wlan0` output? – goldilocks Mar 16 '15 at 14:01
  • Yes correct and when it boots it shows 192.168.5.28 on the splash screen which it got from DHCP, I think. But in the GUI it is not there (the wlan0), But I don't mind it not being there. It seems to remain connected for most of the day and then occasionally connection drops forcing me to switch off then on again and then it connects when it boots and stays connect for some time. – Dino Mar 16 '15 at 14:39
  • At the moment I can not access the pi as I need to wait till the office closes and there is no one in the reception area of my work. It seems have stayed connected for a few hours now. Apologies about the delay, I'm typing this in a rush and only partly read your answer. – Dino Mar 16 '15 at 15:23
  • Keep in mind linux GUIs are heterogeneous, meaning there's a lot of different ways of doing more or less the same thing. So you should check what that "Network GUI" app is exactly -- see if there is an "About" option in the Help menu, or what the titlebar says. I've never used one so I don't know if it is something particular to LXDE (the desktop used on raspbian, presuming you are using raspbian) or something more generic. But if you can find that out you can search more broadly for information about it or ask a more specific question on [Unix & Linux](http://unix.stackexchange.com/). – goldilocks Mar 16 '15 at 15:55
  • The "Network GUI" is actually wpa_gui which you access from the menu like this picture here [wpa_gui](https://cdn.shopify.com/s/files/1/0176/3274/files/blog_pi-wpa-gui.png?6604) That picture has wlan0 as the adapter but in mine it is all blank. – Dino Mar 16 '15 at 16:08
  • Hmmph. So that's part of `wpa_supplicant` I guess. You can check if that's running (it should be, although things *might* continue to work without it, I'm not sure) with `ps -C wpa_supplicant`. Another issue I've seen here with that is multiple instances of it, which might create confusion. – goldilocks Mar 16 '15 at 16:29
  • When I type **ps -C wpa_supplicant** I get **PID TTY TIME CMD** and when I type **ip addr show wlan0** I get ** – Dino Mar 16 '15 at 17:11
  • Yeah, that's no `wpa_supplicant` running and wlan0 off line. – goldilocks Mar 16 '15 at 17:40
  • I did a **sudo /etc/init.d/networking restart** and it gave me a few lines and one ending in **... bound to 192.168.5.28 renewal in 117895 seconds** and I redid the `ps -C wpa_suplicant` command and got and extra line which said **2886 ? 00:00:00 wpa_supplicant** – Dino Mar 16 '15 at 17:51
  • Okay so that worked -- if you look at `ip addr show wlan0` you should get that IP address in there. – goldilocks Mar 16 '15 at 17:57
  • It gives me ** – Dino Mar 16 '15 at 18:22
  • "NO-CARRIER" seems odd, but I actually have no idea what it means. I think that part of the output indicates some things about the state and capabilities of the interface (e.g. "BROADCAST" capable). Does the connection work? – goldilocks Mar 16 '15 at 18:31
  • Yes it does but seems to time out after a bit. I have to close office so will work on it tomorrow morning. – Dino Mar 16 '15 at 18:44
  • does the wifi disconnect after an hour of idling? or do you actively send/receive data through wifi in that time? – notadam Mar 17 '15 at 01:52
  • Well there is our website that refreshes every 20 seconds to a new page that is all it does. Boots to Chromium in kiosk mode. I will be switching the giant monitor on and time how long it takes before it disconnects. – Dino Mar 17 '15 at 08:05

1 Answers1

2

Add this to the bottom of your /etc/network/interfaces file, as it prevents power-save modes in the wifi dongles.

wireless-power off