decoupled wlan loop from user loop and added debug outputs on io d0 d1 d2