bool radioControlInit() { bool result = true; if (WiFi.status() == WL_NO_SHIELD) { printf( "WiFi shield not present\n"); result = false; } String fv = WiFi.firmwareVersion(); if (fv != "1.1.0") { printf( "Please upgrade the firmware\n"); } while (status != WL_CONNECTED) { printf( "Attempting to start AP with SSID: %s\n",ssid); status = WiFi.apbegin(ssid, channel); delay(10000); } printf( "AP mode already started\n"); printWifiData(); printCurrentNet(); printf( "Establish WiFi Server\n"); Udp.begin(localPort); memset(receiverBuffer, '\0', sizeof(receiverBuffer)); memset(transceiverBuffer, '\0', sizeof(transceiverBuffer)); radio_last_tv=millis(); return result; }
/* * ======== apSetup ======== */ __extern void apSetup() { Serial.begin(9600); /* set priority of this task to be lower than other tasks */ Task_setPri(Task_self(), 1); /* toggle LED when clients connect/disconnect */ pinMode(MAIN_LED_PIN, OUTPUT); digitalWrite(MAIN_LED_PIN, LOW); System_printf(" apSetup.\r\n"); Serial.print("Setting up Access Point named: "); Serial.print(ssid); Serial.print(" with password: "******" firmware version: "); Serial.println(WiFi.firmwareVersion()); Serial.println("AP active."); /* startup the command server on port PORTNUM */ Serial.print("Starting dataserver ... "); server.begin(); Serial.print("dataserver started on port "); Serial.println(PORTNUM); }
/* * ======== apSetup ======== */ __extern void apSetup() { Serial.begin(9600); System_printf(" apSetup.\r\n"); Serial.print("Setting up Access Point named: "); Serial.print(ssid); Serial.print(" with password: "******" firmware version: "); Serial.println(WiFi.firmwareVersion()); Serial.println("AP active."); /* start a data server on port number PORTNUM */ Serial.print("Starting dataserver on port: "); Serial.println(PORTNUM); server.begin(); Serial.println("dataserver started."); }
void setup() { WiFi = WiFiClass(); client = WiFiClient(); delay(500); // Waiting for initialization // SPI.begin(); //Initialize Serial5 and wait for port to open: Serial5.begin(9600); while (!Serial5) { ; // wait for Serial5 port to connect. Needed for Leonardo only } // check for the presence of the shield: if (WiFi.status() == WL_NO_SHIELD) { Serial5.println("WiFi shield not present"); // don't continue: while(true); } // attempt to connect to Wifi network: while ( status != WL_CONNECTED) { Serial5.print("Attempting to connect to WPA SSID: "); Serial5.println(ssid); // Connect to WPA/WPA2 network: status = WiFi.begin(ssid, pass); // wait 10 seconds for connection: delay(10000); } // you're connected now, so print out the data: Serial5.print("You're connected to the network"); printCurrentNet(); printWifiData(); }