Commit 7dc9c812 authored by PhiBo's avatar PhiBo 🚀

Initial web config

parent a83ed496
#include "ArduRPC.h"
#include "sensor_node.h"
#include "sensor_node_file.h"
//#include <ESP8266mDNS.h>
// the serial port, it's also possible to use software serial
......@@ -65,6 +66,19 @@ void setup() {
server->on("/action/wifi/ssids", handleScanSSID);
server->on("/config/wifi/sta/ssid", handleSSID);
server->on("/config/wifi/sta/password", handlePassword);
server->on("/setup", []() {
server->sendHeader("Content-Encoding", "gzip");
server->send(200, "text/html", "");
submitFile(PAGE_setup, sizeof(PAGE_setup));
server->on("/setup/js.js", []() {
server->sendHeader("Content-Encoding", "gzip");
server->send(200, "application/javascript", "");
submitFile(FILE_js, sizeof(FILE_js));
const uint8_t FILE_js[] PROGMEM = {0x1f, 0x8b, 0x08, 0x08, 0x25, 0x09, 0x51, 0x56, 0x02, 0x03, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x6d, 0x69, 0x6e, 0x2e, 0x6a, 0x73, 0x00, 0xdd, 0x96, 0x5d, 0x4f, 0xdb, 0x30, 0x14, 0x86, 0xff, 0x4a, 0x67, 0x10, 0xb2, 0xd7, 0xb4, 0x01, 0xb6, 0x2b, 0xaa, 0xac, 0x1a, 0x08, 0x0d, 0x24, 0x18, 0x88, 0x75, 0x1a, 0x52, 0xd7, 0x21, 0xd7, 0x39, 0x6d, 0x83, 0x12, 0x3b, 0xb3, 0x9d, 0x96, 0x0a, 0xfa, 0xdf, 0x77, 0x9c, 0x26, 0x2d, 0x85, 0x22, 0xda, 0xee, 0xae, 0x77, 0xb1, 0x8f, 0x73, 0x3e, 0x9e, 0xf3, 0xfa, 0xa3, 0x97, 0x49, 0x61, 0x23, 0x25, 0x2b, 0xb1, 0xe2, 0x21, 0x65, 0x8f, 0x43, 0xae, 0x2b, 0xbc, 0xc1, 0x03, 0x09, 0xa3, 0xca, 0xbd, 0xc7, 0xeb, 0x2a, 0x05, 0x49, 0xc9, 0xb7, 0xd3, 0x16, 0xf1, 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, 0x7f, 0xd3, 0x9f, 0x80, 0x41, 0xfb, 0x88, 0x6d, 0xe5, 0xaf, 0xf5, 0x92, 0xa5, 0xc7, 0xe5, 0x8b, 0x82, 0x26, 0xe2, 0x45, 0xc7, 0xe4, 0xea, 0x96, 0xe0, 0x73, 0xb5, 0x86, 0xcb, 0xd7, 0xf8, 0xf6, 0x98, 0x58, 0xc2, 0xb8, 0x37, 0xb7, 0x69, 0xf5, 0xd3, 0x54, 0x71, 0xb3, 0x49, 0x7f, 0x1b, 0xfb, 0xab, 0xd9, 0xdf, 0xe5, 0x1f, 0xa0, 0x87, 0xe8, 0xd7, 0xd2, 0x03, 0x00, 0x00};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment