Code to run on the ground
char* HOST = http://www.nooler.com
- IP address of Nooler's server.int hostPort = 80
- Port used by host.
bool
LOCAL_SETUP_COMPLETE
bool
SERVER_REGISTRATION_COMPLETE
bool
BLE_WAITING
bool
BLE_CONNECTED
bool
WIFI_CONNECTING
bool
WIFI_CONNECTED
char*
WIFI_SSID
- Wifi SSIDchar*
WIFI_PW
- Wifi password
Serial.begin(115200)
- Init BLE server
- Init Wifi
- Init reset/pair button
- Start advertising BLE server.
- Receive data(user uuid, Wifi information, etc.) from user through BLE.
- Attempt to connect to provided Wifi.
- Sync with server.
- Subscribe to MQTT.
INIT |
WAITING_BLE |
USER_PAIRED |
WAITING_WIFI |
WAITING_SERVER_SETUP |
OPERATIONAL |
|
---|---|---|---|---|---|---|
LOCAL_SETUP_COMPLETE |
false |
false |
false |
true |
true |
true |
SERVER_REGISTRATION_COMPLETE |
false |
false |
false |
false |
false |
true |
BLE_WAITING |
false |
true |
false |
false |
false |
false |
BLE_CONNECTED |
false |
false |
true |
false |
false |
false |
WIFI_CONNECTING |
false |
false |
false |
true |
false |
false |
WIFI_CONNECTED |
false |
false |
false |
false |
true |
true |