Quantcast
Channel: Seeedstudio Forum
Viewing all articles
Browse latest Browse all 6612

standalone Wifi Bee disconnecting

$
0
0
Ok here is what I found, if someone encounter the same issue :
I software-reset the controller in case of a disconnection. The connection state is available by the zg_get_conn_state() function returning 1 if connected, 0 otherwise. The software reset is possible when defining a null function.
Code:extern "C" {
#include <g2100.h>
}
[...]
void setup() {
  WiServer.init(sendMyPage);
}
[...]
void(* resetFunc) (void) = 0; //declare reset function @ address 0
void loop(){
  if (zg_get_conn_state() == 0){ // disconnected
    resetFunc();  //call reset   
  }
  // Run WiServer
  WiServer.server_task();

  delay(10);
}


Trying to call WiServer.init in case of a disconnection was not sufficient.

I don't know if that solution is good enough in the long run but it seems to work on a small test (reset after a while and see if the connection comes back)

EDIT: I does NOT work, still loosing connection after some time Image

Statistics : Posted by matthieu.cargnelli • on Thu Feb 20, 2014 8:39 pm • Replies 3 • Views 70

Viewing all articles
Browse latest Browse all 6612

Trending Articles