Getting the following logs. Takes about 40 seconds to join a Wifi Network on a P1. Is there something that blocks this to cause this?
Serial connection closed. Attempting to reconnect...
Serial monitor opened successfully:
0000004788 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1006
0000004788 [hal.wlan] INFO: Joining Divs hotspot
0000004788 [hal.wlan] TRACE: Free RAM connect: 46416
0000008044 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1006
0000008044 [hal.wlan] INFO: Joining Divs hotspot
0000008044 [hal.wlan] TRACE: Free RAM connect: 46416
0000011301 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1006
0000011447 [hal.wlan] INFO: Joining Divs hotspot
0000011447 [hal.wlan] TRACE: Free RAM connect: 46416
0000014705 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1006
0000014705 [hal.wlan] INFO: Joining Divs hotspot
0000014705 [hal.wlan] TRACE: Free RAM connect: 46416
0000017964 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1006
0000017964 [hal.wlan] INFO: Joining Divs hotspot
0000017964 [hal.wlan] TRACE: Free RAM connect: 46416
0000021219 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1006
0000021365 [hal.wlan] INFO: Joining Divs hotspot
0000021365 [hal.wlan] TRACE: Free RAM connect: 46416
0000024629 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1006
0000024629 [hal.wlan] INFO: Joining Divs hotspot
0000024629 [hal.wlan] TRACE: Free RAM connect: 46416
0000027886 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1006
0000027886 [hal.wlan] INFO: Joining Divs hotspot
0000027886 [hal.wlan] TRACE: Free RAM connect: 46416
0000031146 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1006
0000031292 [hal.wlan] INFO: Joining Divs hotspot
0000031292 [hal.wlan] TRACE: Free RAM connect: 46416
0000034547 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1006
0000034547 [hal.wlan] INFO: Joining Divs hotspot
0000034547 [hal.wlan] TRACE: Free RAM connect: 46416
0000037560 [hal.wlan] INFO: Bringing WiFi interface up with DHCP
Here is my code:
#include <math.h>;
#include <vector>;
#include "OneButton.h"
#include "Particle.h"
#include "SPI_tft.h"
#include "application.h"
#include "graphics.h"
#include "photon-thermistor.h"
#include "pid.h"
#define TFT_DC P1S4
#define TFT_CS P1S5
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);
SerialLogHandler logHandler(Serial, LOG_LEVEL_TRACE);
unsigned long time1;
unsigned long time2;
bool timeChecked = true;
SPI_tft tft = SPI_tft(TFT_CS, TFT_DC, 0);
void setup() {
tft.begin();
tft.setRotation(2);
tft.clear(BLACK);
tft.setTextColor(WHITE, BLACK);
time1 = millis();
Particle.connect();
}
void loop() {
if (Particle.connected() && timeChecked) {
time2 = millis();
Serial.println(time2 - time1);
timeChecked = false;
}
}