Firmware - ridercz/HoneyESP GitHub Wiki
The firmware is written on Arduino platform and designed for Arduino IDE and the ESP8266 Arduino project.
There are two firmware versions:
- HoneyESP-SD uses SD/MicroSD card for storage,
- HoneyESP-SPIFFS uses embedded SPIFFS memory.
All required libraries are part of default installation of Arduino IDE. The code is fairly straightforward.
Configuration of SD Version
The only parameter you probably need to configure is SDCARD_CS_PIN
. It defaults to SS
, but on some boards you would need to manually specify pin where the CS
of SD card module is connected to.
If you define BLOCK_DATALOG_REQUEST
(off by default), requests to results data file (default datalog.txt
) will be blocked and the server would return 404 Not Found
. The only way to access the file would be by reading the SD card.
The BLOCK_SSID_REQUEST
(on by default) blocks requests to SSID configuration file (default ssid.txt
) in the same fashion.
#define
Configuration Options for SD Version
Full List of Name | Default | Comment |
---|---|---|
SDCARD_CS_PIN |
SS |
Chip select pin number for SD |
DNS_PORT |
53 |
DNS port |
HTTP_PORT |
80 |
Web server port |
BLOCK_SSID_REQUEST |
defined | If defined, requests to SSID configuration file are blocked |
BLOCK_DATALOG_REQUEST |
not defined | If defined, requests to results data file are blocked |
DEFAULT_SSID_PREFIX |
"HoneyESP-" |
Prefix of autogenerated SSID (MAC address is added) |
AP_ADDRESS |
"10.0.0.1" |
AP IP address |
AP_NETMASK |
"255.255.255.0" |
AP subnet mask |
AP_CHANNEL |
1 |
Wi-Fi channel (1 - 13) |
AP_MAX_CLIENTS |
8 |
Maximum number of Wi-Fi clients (8 is maximum of ESP8266) |
HOSTNAME |
"wifi-gateway.local" |
Captive portal host name |
FILENAME_SSID |
"ssid.txt" |
Name of SSID configuration file |
FILENAME_DATALOG |
"datalog.txt" |
Name of results data file |
Configuration of SPIFFS Version
There is no required configuration for SPIFFS version, as you don't have to specify the CS pin for SD card. But you do have to upload the files needed to SPIFFS memory.
Uploading Files
The files that are stored on SD card in the SD version are to be uploaded to SPIFFS using the following procedure:
The following instructions are intended for ESP8266. See ESP32 Notes if you are using ESP32-based board.
Install the Arduino ESP8266FS Plugin
You have to do this only once.
- Close all instances of Arduino IDE.
- Download the latest version of the Arduino ESP8266FS Plugin.
- Create folder
tools
in your Arduino folder (ie.C:\Users\username\Documents\Arduino\tools
). - Extract contents of the downloaded files there. It should extract to ie.
C:\Users\username\Documents\Arduino\tools\ESP8266FS\tool\esp8266fs.jar
). - Launch Arduino IDE.
- You should see new menu item Tools -> ESP8266 Sketch Data Upload (do not click it now).
Upload the Files to SPIFFS
You have to do this every time you'll modify the website contents. It will erase all previous data.
- Create
data
folder under your sketch folder location (ie.C:\Users\username\Documents\Arduino\HoneyESP-SPIFFS\data
). - Create/copy contents of what would be on SD card to this folder.
- Open the sketch
HoneyESP-SPIFFS
in Arduino IDE. - Choose in menu Tools -> Flash Size -> 4M (1M SPIFFS). The specific value depends on your board, but you have to select some other value than no SPIFFS and the selected value (here 1 MB) must be big enough to contain the web site. The smallest option (1 MB) is usually more than enough.
- Close the Serial monitor or Serial plotter window if its open.
- Click Tools -> ESP8266 Sketch Data Upload. The tool will upload contents of your
data
folder to SPIFFS area of memory.
#define
Configuration Options for SPIFFS Version
Full List of Name | Default | Comment |
---|---|---|
DNS_PORT |
53 |
DNS port |
HTTP_PORT |
80 |
Web server port |
BLOCK_SSID_REQUEST |
defined | If defined, requests to SSID configuration file are blocked |
DEFAULT_SSID_PREFIX |
"HoneyESP-" |
Prefix of autogenerated SSID (MAC address is added) |
AP_ADDRESS |
"10.0.0.1" |
AP IP address |
AP_NETMASK |
"255.255.255.0" |
AP subnet mask |
AP_CHANNEL |
1 |
Wi-Fi channel (1 - 13) |
AP_MAX_CLIENTS |
8 |
Maximum number of Wi-Fi clients (8 is maximum of ESP8266) |
HOSTNAME |
"wifi-gateway.local" |
Captive portal host name |
FILENAME_SSID |
"/ssid.txt" |
Name of SSID configuration file |
FILENAME_DATALOG |
"/datalog.txt" |
Name of results data file |
Serial Debugging
The device can be conected to computer USB port where it emulates serial port with 9600 bps speed. Status messages and captured credentials are printed to this port.