No DHCP Server in AP mode after RESET

Hi Everybody,

I am having problems accessing my yun in its AP-mode, after either a WLAN_RST or calling /etc/bin/wifi-reset-and-reboot directly. I have also tried powering the yun off/reset after switching to AP-mode.

While I can still see and connect to the interface (eg. Arduino Yun-MACXXX), but the yun won’t give me a IP address. I suspect an openwrt dhcp server problem.

This is because I can still manually configure an IP address (eg. IP= SUBNET= GATEWAY= to see the yun at its default IP (eg.

Any ideas?

Ok. so I just tried resetting openwrt's dhcp server by excuting "/etc/init.d/dnsmasq restart" ...

And everything works great for like 2 mins, new clients are able to connect and get leases. However after 2 mins they get kicked off / dropped ...

what gives? :frowning:

Reset to factory default settings, will bring Yun into AP mode (static IP and no dhcp service). Backup your own data!

Turn on AP encryption and Setup Wifi DHCP Service

Thanks @sonnyyu. I took your advice and reset-to-factory, and debugged my project from there.

In the case it might help somebody, my problem was a cron script for checking internet connectivity. It would reset the network service if it couldn't ping the yun's default gateway, which of course isn't defined in it's ap-mode

Here's the final correct code


# ping default wifi gateway and direct stdout stderr to null
# check exit status: $?. note whitespace in conditionals important

# IF ap-mode do not check default gateway because
#    will always fail and network will endlessly be reset 
WIFIMODE=$(uci get wireless.@wifi-iface[0].mode)
if [ $WIFIMODE == 'ap' ]; then
   exit 0

# determine and attempt to ping default gateway
DEFAULT_GATEWAY=$(route | awk '/default/ { print $2 }')
ping -c 1 $DEFAULT_GATEWAY &>/dev/null

if [ $? -eq 0 ]; then

  # wifi ok


  # wifi down  
  # restart
  /etc/init.d/network restart