ESP2866 firmware to bridge EPOSMote III apps with LISHA IoT Platform. The firmware supports HTTPS, certificate-based authentication, and EDUROAM connection.
The code was meant to be flashed into an ESP2866 through Arduino IDE
(more info at: https://software.intel.com/en-us/get-started-arduino-install).
For the code to be supported by the Arduino IDE, ESP2866 library is needed (more info at: https://github.com/esp8266/Arduino).
Step-by-Step Code Configuration:
1. Look for the "Configuration Section" inside the code file (esp_wifi_firmware.ino)
2. Modify the variables as needed
2.1. DEBUG(x) x --> Enable Debug messages, remove "x" to disable Debug messages
2.2. IF WPA2 wifi conection is needed, set WPA2 to 1.
2.2.1. Finish the WPA2 configuration setting the login info (ssid, password, user, pass).
2.3. IF WPA2 wifi will not be used, set WPA2 to 0.
2.3.1. Finish the Wifi configuration setting the login info (ssid and password of wifi NOT WPA2).
2.4. Set the HTTP configuration (host address, host port, api_attach and api_put).
2.4.1. Config the acceptable retries to host connection (0 if unlimited).
2.4.2. Config the time out for a HTTP response from host (0 if ignored).
2.4.3. IF a certificate will be used to validate the connection with the server, set SSL_VERIFICATION to 1, else 0.
2.4.3.1. Fill the client_cert and private_key information to fully configure SSL certificate verification.
2.4.4. IF certificates are NOT being used and a Default credential will be used for every post set DEFAULT Credentials to 1 and configure client_credentials_json as needed.
2.5. Interactions by DEFAULT are done as follows: "++post(\"your smartdata here\")\0x255\0x255" for an API PUT and "--post("your series here")\0x255\0x255" for an API ATTACH, the -- and ++ and \0x255\0x255 can be modified as needed through PUT_CONTROL_CHAR, ATTACH_CONTROL_CAR and END_CONTROL_CHAR. Also the methods loop() and parse_post() configure the serial parsing state machine and can be modified as aswell.
How to flash:
- Required a FTDI connected both to the computer and the ESP
- ESP PIN configuration (FLASH boot mode):
-- FTDI TX in ESP8266 RX
-- FTDI RX in ESP8266 TX
-- FTDI GROUND in ESP8266 GROUND and GPIO 0
-- FTDI VCC in ESP8266 VCC, RESET and CH_EN
- To boot ESP8266 in RUN Mode, use the same configuration and disconnect ground from GPIO 0
Arduino IDE Recommended Configuration:
- Arduino IDE version used: 1.8.11
- Tools Menu:
-- Board: "Generic ESP8266 Module"
-- Upload Speed: "115200"
-- CPU Frequency: "160 MHz"
-- Crystal Frequency: "26 MHz"
-- Flash Size: "512K (no SPIFFS)"
-- Flash Mode: "DOUT (compatible)"
-- Flash Frequency: "40MHz"
-- Reset Method: "ck"
-- Debug Port: "Disabled"
-- Debug Level: "None"
-- lwIP Variant: "v2 Lower Memory"
-- VTables: "Flash"
-- Exceptions: "Disabled"
-- Builtin Led: "2"
-- Erase Flash: "Only Sketch"
-- SSL Support: "All SSL ciphers(most compatible)"