simple example of scanning wifi AP and sending to geolocation resolver on cloud

Dependencies:   mbed-http lr1110 sx12xx_hal

test Wifi geolocation with resolving using HTTP POST.

Use with mbed board with internet access and arduino form factor.
With HTTPS, the RAM requirement is minimum 128Kbytes.

and, use with radio shield for europe
or radio shield for USA
which is programmed with trx firmware from updater tool.

This project presents to user mbed STDIO serial port at 115200bps, which lets you perform wifi access point scan on LR1110 and send the resulting access point list to a geolocation provider on the cloud.

Use the project by itself to run wifi scan on the serial terminal (at 115200bps), or use with lr1110_wifi_geolocation_device to receive wifi list from remote device (over LoRa) to resolve location of that device using gelocation provider on cloud.

On serial terminal, use ? question mark to see list of commands. ws to run wifi scan, or ws p to wifi scan and resolve location with cloud provider via HTTP POST.

project setup

Edit main.h to uncomment which geolocation provider you wish to use, and get API key from them:

notice

This project is not using LoRaWAN, instead just LoRa transceiver directly to geolocation provider

Committer:
Wayne Roberts
Date:
Tue Feb 09 10:49:02 2021 -0800
Revision:
1:4a05f91c9c38
add source files

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wayne Roberts 1:4a05f91c9c38 1 #include "select-demo.h"
Wayne Roberts 1:4a05f91c9c38 2
Wayne Roberts 1:4a05f91c9c38 3 #include "mbed.h"
Wayne Roberts 1:4a05f91c9c38 4 #if DEMO == DEMO_HTTPS
Wayne Roberts 1:4a05f91c9c38 5 #include "https_request.h"
Wayne Roberts 1:4a05f91c9c38 6 #elif DEMO == DEMO_HTTP
Wayne Roberts 1:4a05f91c9c38 7 #include "http_request.h"
Wayne Roberts 1:4a05f91c9c38 8 #endif
Wayne Roberts 1:4a05f91c9c38 9
Wayne Roberts 1:4a05f91c9c38 10 #define GOOGLE 1
Wayne Roberts 1:4a05f91c9c38 11 #define COMBAIN 2
Wayne Roberts 1:4a05f91c9c38 12 //#define GEOLOCATION_PROVIDER GOOGLE
Wayne Roberts 1:4a05f91c9c38 13 //#define GEOLOCATION_PROVIDER COMBAIN
Wayne Roberts 1:4a05f91c9c38 14
Wayne Roberts 1:4a05f91c9c38 15 #define HEADER_LENGTH 10 /* for chipEUI and extra reserved */
Wayne Roberts 1:4a05f91c9c38 16
Wayne Roberts 1:4a05f91c9c38 17 int post_scan_result(const char*, float*, float*, int*);
Wayne Roberts 1:4a05f91c9c38 18 void wifi_result_to_json(bool first, const uint8_t *result, unsigned macStart, unsigned rssi_idx);
Wayne Roberts 1:4a05f91c9c38 19 void json_start(void);
Wayne Roberts 1:4a05f91c9c38 20 void json_end(void);
Wayne Roberts 1:4a05f91c9c38 21 extern char json[];
Wayne Roberts 1:4a05f91c9c38 22 extern bool wifiResultFormatBasic;
Wayne Roberts 1:4a05f91c9c38 23 extern NetworkInterface* network;
Wayne Roberts 1:4a05f91c9c38 24 void dump_response(HttpResponse* res);
Wayne Roberts 1:4a05f91c9c38 25