Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1752655548, "reponame":"lws-esp32-factory", "desc":"ESP32 LWS factory image", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/lws-esp32-factory", "f":3, "items": [ {"schema":"libjg2-1", "cid":"6af266af4feed34c632418aecf69c37e", "commit": {"type":"commit", "time": 1494645159, "time_ofs": 480, "oid_tree": { "oid": "5022e39b8277420a17cef82fd3a2b8ddb81af7fd", "alias": []}, "oid":{ "oid": "426e7ad90b636ce7cef1df2441f0bc0b881c1e00", "alias": []}, "msg": "working ap slots", "sig_commit": { "git_time": { "time": 1494645159, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1494645159, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": "working ap slots" , "diff": "diff --git a/README.md b/README.md\nindex efd97f7..902c642 100644\n--- a/README.md\n+++ b/README.md\n@@ -3,17 +3,28 @@ lws-esp32-factory\n \n This is a standalone \u003c1MB image intended for the 1MB \u0022factory\u0022 slot on ESP32.\n \n+This image is designed to look after two cases\n+\n+ - Factory bringup, where you push PEM SSL certs to the device and set \u0022factory options\u0022\n+\n+ - Common user setup, for example teaching the device about your AP passphrase, updating\n+ your OTA or the factory application, and user setup like device grouping name\n+\n+Your actual \u0022OTA\u0022 application is something completely different, and has its own 2.9MB\n+flash area. This -factory app is designed to take care of all common setup stuff and\n+put it in nvs to be shared with the OTA app.\n+\n It has the following capabilities:\n \n ### Initial Factory Setup Page\n \n-Allows overriding default serial, setting device options string, and uploading SSL certs\n+Allows overriding default serial, setting device options string, and uploading PEM SSL certs\n \n ![Factory Setup](https://libwebsockets.org/setup3.png)\n \n-With an empty nvs, the first time this will come up at http://192.168.4.1 in AP mode, ie at port 80 without SSL since no certs.\n+With an empty nvs, the first time this will come up at http://192.168.4.1 in AP mode, ie at port 80 without SSL, since no SSL certs configured yet.\n \n-After the DER format SSL certs have been uploaded, everything subsequently is in https.\n+After the PEM format SSL certs have been uploaded, everything subsequently is in https on port 443.\n \n ### User configuration Setup Page\n \n@@ -23,7 +34,8 @@ If no AP information is in the nvs, this page comes up automatically at https://\n \n The user can reach it subsequently programmatically or by grounding a GPIO (ie, by a button), the default GPIO is IO14.\n \n-The page allows you to select an AP from a scan list and give a passphrase.\n+The page allows you to select an AP from a scan list and give a passphrase. It supports four AP slots,\n+for, eg, home and work environments, and it handles the scan and acquire of the APs.\n \n Once it connects, the DHCP information is shown, and it autonomously connects to a configurable server over https to check for updates. The user can select to have it autonomously download the update and restart.\n \n@@ -33,13 +45,13 @@ The user can also upload images by hand. The factory image understands how to u\n \n It's not required, but the default code expects\n \n- - pushbutton to 0V connected on IO14\n+ - pushbutton to 0V connected on IO14, with pullup to 3.3V\n \n If the pushbutton is held down at boot, the user is forced into the factory / Setup mode rather than the OTA application.\n \n - LED connected via, eg, 330R 3.3V ---|\u003e|-----/\u005c\u005c/\u005c\u005c/\u005c\u005c---- IO23\n \n-While in factory / OTA mode, the LED flashes on and off at 500ms. When you press \u0022ID Device\u0022 button in the UI, the LED flashes rapidly for 5s.\n+While in factory / OTA mode, the LED flashes dows a PWM sine cycle at about 1Hz. When you press \u0022ID Device\u0022 button in the UI, the LED does the since cycle rapidly for 10s, so you can be sure which physical device you are talking to.\n \n \n ## Building and using\n@@ -54,11 +66,6 @@ For Ubuntu / Debian and Fedora at least, the distro package is called \u0022genromfs\u0022\n \n CMake v2.8 is too old... v3.7+ are known to work OK and probably other intermediate versions are OK.\n \n-### 0.3: recent GNU Make\n-\n-3.8.1 is known to be too old. 4.2.1 is known to work well. The point at which\n-it works is likely to be somewhere inbetween those. If it builds but you get errors related to not being able to find the ROMFS at runtime, update your GNU make.\n-\n \n ### Step 1: Clone and get lws submodule\n \n@@ -132,3 +139,16 @@ requires it to not only be flashed, but marked as bootable.\n \n Subsequently you can just reflash the OTA partition with `make flash_ota` or use the upload or autonomous update stuff in the -factory app.\n \n+## Note for Firefox users\n+\n+Firefox has a longstanding, unfixed bug dealing with selfsigned certs. As you add more exceptions for them,\n+firefox bogs down processing the validity of the certs. Symptoms are slow (eventually very slow) browser\n+performance sending data on the accepted SSL connection.\n+\n+https://bugzilla.mozilla.org/show_bug.cgi?id\u003d1056341\n+\n+Symptom is your browser box's cpu burns while it sits there. Workaround is to delete the cert8.db file in\n+your firefox user config, on my box it was `~/.mozilla/firefox/blah.default/cert8.db`.\n+\n+This isn't related to lws but affects all firefox usage with selfsigned certs...\n+\ndiff --git a/components/libwebsockets b/components/libwebsockets\nindex 54236bd..b2f8bc5 160000\n--- a/components/libwebsockets\n+++ b/components/libwebsockets\n@@ -1 +1 @@\n-Subproject commit 54236bd437a71ddb85151756d1fb09cb0090533f\n+Subproject commit b2f8bc56385344d2fc77e4dda7f611bbda5cf537\ndiff --git a/main/main.c b/main/main.c\nindex 4592bad..603c398 100644\n--- a/main/main.c\n+++ b/main/main.c\n@@ -23,9 +23,6 @@\n #include \u0022soc/ledc_reg.h\u0022\n #include \u0022driver/ledc.h\u0022\n \n-void (*lws_cb_scan_done)(void *);\n-void *lws_cb_scan_done_arg;\n-\n /* protocol for scan updates over ws and saving wlan setup */\n #include \u0022protocol_esp32_lws_scan.c\u0022\n /* protocol for OTA update using POST / https / browser upload */\n@@ -119,17 +116,7 @@ void lws_esp32_leds_timer_cb(TimerHandle_t th)\n \n esp_err_t event_handler(void *ctx, system_event_t *event)\n {\n-\tswitch(event-\u003eevent_id) {\n-\tcase SYSTEM_EVENT_SCAN_DONE:\n-\t\tif (lws_cb_scan_done)\n-\t\t\tlws_cb_scan_done(lws_cb_scan_done_arg);\n-\t\tbreak;\n-\n-\tdefault:\n-\t\treturn lws_esp32_event_passthru(ctx, event);\n-\t}\n-\n-\treturn ESP_OK;\n+\treturn lws_esp32_event_passthru(ctx, event);\n }\n \n #define GPIO_ID 23\ndiff --git a/romfs-files/ap/index.html b/romfs-files/ap/index.html\nindex bfae154..eff1cf5 100644\n--- a/romfs-files/ap/index.html\n+++ b/romfs-files/ap/index.html\n@@ -301,6 +301,8 @@ function get_appropriate_ws_url()\n \t\t\tif (once \u003d\u003d 0) {\n \t\t\t\tdocument.getElementById(\u0022model\u0022).textContent \u003d jso.model+\u0022-\u0022+jso.serial+\u0022-\u0022+jso.opts;\n \t\t\t\tdocument.getElementById(\u0022region\u0022).value \u003d jso.region;\n+\t\t\t\tdocument.getElementById(\u0022role\u0022).value \u003d jso.role;\n+\n \t\t\t\tif (jso.forced_button !\u003d 1)\n \t\t\t\t\tdocument.getElementById(\u0022access\u0022).innerHTML \u003d \u0022\u003cspan style\u003d\u005c\u0022font-size:10pt;\u005c\u0022\u003euse physical button\u003c/span\u003e\u0022;\n \n@@ -308,29 +310,23 @@ function get_appropriate_ws_url()\n \t\t\t\ts \u003d \u0022\u003ctable\u003e\u003ctr\u003e\u003ctd\u003eSel\u003c/td\u003e\u003ctd\u003eSlot\u003c/td\u003e\u003ctd\u003eAP\u003c/td\u003e\u0022;\n \t\t\t\ts +\u003d \u0022\u003ctd\u003eUse\u003c/td\u003e\u003ctd\u003eClear\u003c/td\u003e\u003c/tr\u003e\u0022;\n \t\t\t\tfor (n \u003d 0; n \u003c 4; n++) {\n-\t\t\t\t\tif (!n)\n \t\t\t\t\ts +\u003d \u0022\u003ctr\u003e\u003ctd align\u003dcenter style\u003d\u005c\u0022overflow:hidden;\u005c\u0022\u003e\u0022+\n \t\t\t\t\t \u0022\u003cinput type\u003dradio name\u003dslot value\u003d\u005c\u0022\u0022 + parseInt(n) + \u0022\u005c\u0022 \u0022 +\n \t\t\t\t\t \u0022onchange\u003d\u005c\u0022slch(\u0022 + parseInt(m) + \u0022);\u005c\u0022\u003e\u003c/td\u003e\u003ctd\u003e\u0022 +\n \t\t\t\t\t parseInt(n + 1) + \u0022\u003c/td\u003e\u0022;\n-\t\t\t\t\telse\n-\t\t\t\t\ts +\u003d \u0022\u003ctr\u003e\u003ctd align\u003dcenter style\u003d\u005c\u0022overflow:hidden;\u005c\u0022\u003e\u0022+\n-\t\t\t\t\t \u0022\u003cinput disabled type\u003dradio name\u003dslot value\u003d\u005c\u0022\u0022 + parseInt(n) + \u0022\u005c\u0022 \u0022 +\n-\t\t\t\t\t \u0022onchange\u003d\u005c\u0022slch(\u0022 + parseInt(m) + \u0022);\u005c\u0022\u003e\u003c/td\u003e\u003ctd\u003e\u0022 +\n-\t\t\t\t\t parseInt(n + 1) + \u0022\u003c/td\u003e\u0022;\n \n \t\t\t\t if (jso.known[n])\n \t\t\t\t\t s +\u003d \u0022\u003ctd width\u003d50% id\u003dslotap\u0022 + parseInt(n) + \u0022\u003e\u0022 +\n \t\t\t\t\t\t jso.known[n].ssid + \u0022\u003c/td\u003e\u0022 +\n-\t\t\t\t\t \u0022\u003ctd\u003e\u0022 + jso.known[n].use + \u0022\u003c/td\u003e\u0022;\n+\t\t\t\t\t \u0022\u003ctd id\u003d\u005c\u0022use\u0022+n+\u0022\u005c\u0022\u003e\u0022 + jso.known[n].use + \u0022\u003c/td\u003e\u0022;\n \t\t\t\t else\n \t\t\t\t\t s +\u003d \u0022\u003ctd width\u003d50% id\u003dslotap\u0022 + parseInt(n) +\n \t\t\t\t\t\t \u0022\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u0022;\n-\t\t\t\t\tif (!n)\n-\t\t\t\t\t s +\u003d \u0022\u003ctd\u003e\u003cbutton style\u003d\u005c\u0022font-size:8pt;\u005c\u0022 onclick\u003d\u005c\u0022clr(\u0022 +\n+\t\t\t\t\tif (jso.known[n].ssid.length)\n+\t\t\t\t\t s +\u003d \u0022\u003ctd\u003e\u003cbutton id\u003d\u005c\u0022clr\u0022+n+\u0022\u005c\u0022 style\u003d\u005c\u0022font-size:8pt;\u005c\u0022 onclick\u003d\u005c\u0022clr(\u0022 +\n \t\t\t\t\t\t\tparseInt(n) + \u0022)\u005c\u0022\u003eClear\u003c/button\u003e\u003c/td\u003e\u003c/tr\u003e\u0022;\n \t\t\t\t\telse\n-\t\t\t\t\t s +\u003d \u0022\u003ctd\u003e\u003cbutton disabled style\u003d\u005c\u0022font-size:8pt;\u005c\u0022 onclick\u003d\u005c\u0022clr(\u0022 +\n+\t\t\t\t\t s +\u003d \u0022\u003ctd\u003e\u003cbutton disabled id\u003d\u005c\u0022clr\u0022+n+\u0022\u005c\u0022 style\u003d\u005c\u0022font-size:8pt;\u005c\u0022 onclick\u003d\u005c\u0022clr(\u0022 +\n \t\t\t\t\t\t\tparseInt(n) + \u0022)\u005c\u0022\u003eClear\u003c/button\u003e\u003c/td\u003e\u003c/tr\u003e\u0022;\n \n \t\t\t\t}\n@@ -480,11 +476,13 @@ function slch(n)\n \n \tdocument.getElementById(\u0022join\u0022).value \u003d \u0022Set slot \u0022 + parseInt(parseInt(get_radio('slot')) + 1);\n \tdocument.getElementById(\u0022scanlist\u0022).style.opacity \u003d \u00221.0\u0022;\n+\tdocument.getElementById('clr' + parseInt(n)).disabled \u003d false;\n }\n \n function clr(n)\n {\n-\tvar s \u003d \u0022{\u005c\u0022ssid\u0022 + parseInt(n) +\u0022\u005c\u0022:\u005c\u0022\u005c\u0022,\u005c\u0022pw\u0022 + parseInt(n) + \u0022\u005c\u0022:\u005c\u0022\u005c\u0022}\u0022;\n+\tvar s \u003d \u0022{\u005c\u0022ssid\u0022 + parseInt(n) +\u0022\u005c\u0022:\u005c\u0022\u005c\u0022,\u005c\u0022pw\u0022 + parseInt(n) + \u0022\u005c\u0022:\u005c\u0022\u005c\u0022,\u005c\u0022slot\u005c\u0022:\u005c\u0022\u0022 +\n+\t\t\t\t\tparseInt(n) + \u0022\u005c\u0022}\u0022;\n \ttry {\n \t\tws.send(s);\n \t} catch(exception) {\n@@ -493,6 +491,8 @@ function clr(n)\n \ts \u003d \u0022slotap\u0022 + n;\n \tif ( document.getElementById(s))\n \t\tdocument.getElementById(s).textContent \u003d \u0022\u0022;\n+\tdocument.getElementById(\u0022clr\u0022 + parseInt(n)).disabled \u003d true;\n+\tdocument.getElementById(\u0022use\u0022 + parseInt(n)).textContent \u003d \u00220\u0022;\n }\n \n function chgroup()\n@@ -532,8 +532,7 @@ function do_join()\n \tvar s \u003d \u0022{\u005c\u0022ssid\u0022 + parseInt(get_radio('slot')) +\u0022\u005c\u0022:\u005c\u0022\u0022 + get_radio('ap') + \u0022\u005c\u0022,\u005c\u0022pw\u0022 +\n \t\tparseInt(get_radio('slot')) + \u0022\u005c\u0022:\u005c\u0022\u0022 +\n \t\t\tdocument.getElementById(\u0022pw\u0022).value + \u0022\u005c\u0022,\u005c\u0022region\u005c\u0022:\u005c\u0022\u0022 +\n-\t\t\tdocument.getElementById(\u0022region\u0022).value + \u0022\u005c\u0022, \u005c\u0022slot\u005c\u0022:\u005c\u0022\u0022 + parseInt(get_radio('slot')) + \u0022\u005c\u0022}\u0022, h;\n-\tconsole.log(s);\n+\t\t\tdocument.getElementById(\u0022region\u0022).value + \u0022\u005c\u0022,\u005c\u0022slot\u005c\u0022:\u005c\u0022\u0022 + parseInt(get_radio('slot')) + \u0022\u005c\u0022}\u0022, h;\n \ttry {\n \t\tws.send(s);\n \t} catch(exception) {\n@@ -560,7 +559,6 @@ function regch()\n \tvar s \u003d \u0022{\u005c\u0022setting\u005c\u0022:\u005c\u00221\u005c\u0022,\u005c\u0022region\u005c\u0022:\u005c\u0022\u0022 +\n \t\t\tdocument.getElementById(\u0022region\u0022).value + \u0022\u005c\u0022}\u0022, h;\n \ttry {\n-\t\tconsole.log(s);\n \t\tws.send(s);\n \t} catch(exception) {\n \t\talert('Sorry, there was a problem' + exception);\n@@ -572,7 +570,6 @@ function set_access_pw()\n \tvar s \u003d \u0022{\u005c\u0022setting\u005c\u0022:\u005c\u00221\u005c\u0022,\u005c\u0022access_pw\u005c\u0022:\u005c\u0022\u0022 +\n \t\t\tdocument.getElementById(\u0022access_pw\u0022).value + \u0022\u005c\u0022}\u0022, h;\n \ttry {\n-\t\tconsole.log(s);\n \t\tws.send(s);\n \t} catch(exception) {\n \t\talert('Sorry, there was a problem' + exception);\ndiff --git a/sdkconfig b/sdkconfig\nindex 84eba93..d60edaa 100644\n--- a/sdkconfig\n+++ b/sdkconfig\n@@ -112,14 +112,11 @@ CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE\u003dy\n # CONFIG_ESP32_APPTRACE_DEST_UART is not set\n CONFIG_ESP32_APPTRACE_DEST_NONE\u003dy\n # CONFIG_ESP32_APPTRACE_ENABLE is not set\n-CONFIG_BASE_MAC_STORED_DEFAULT_EFUSE\u003dy\n-# CONFIG_BASE_MAC_STORED_CUSTOMER_DEFINED_EFUSE is not set\n-# CONFIG_BASE_MAC_STORED_OTHER_CUSTOMER_DEFINED_PLACE is not set\n-# CONFIG_TWO_MAC_ADDRESS_FROM_EFUSE is not set\n-CONFIG_FOUR_MAC_ADDRESS_FROM_EFUSE\u003dy\n-CONFIG_NUMBER_OF_MAC_ADDRESS_GENERATED_FROM_EFUSE\u003d4\n+# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set\n+CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS\u003dy\n+CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS\u003d4\n CONFIG_SYSTEM_EVENT_QUEUE_SIZE\u003d32\n-CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE\u003d4096\n+CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE\u003d6144\n CONFIG_MAIN_TASK_STACK_SIZE\u003d16384\n CONFIG_NEWLIB_STDOUT_ADDCR\u003dy\n # CONFIG_NEWLIB_NANO_FORMAT is not set\n@@ -137,10 +134,12 @@ CONFIG_ESP32_PANIC_GDBSTUB\u003dy\n CONFIG_ESP32_DEBUG_OCDAWARE\u003dy\n CONFIG_INT_WDT\u003dy\n CONFIG_INT_WDT_TIMEOUT_MS\u003d300\n+CONFIG_INT_WDT_CHECK_CPU1\u003dy\n CONFIG_TASK_WDT\u003dy\n # CONFIG_TASK_WDT_PANIC is not set\n CONFIG_TASK_WDT_TIMEOUT_S\u003d5\n CONFIG_TASK_WDT_CHECK_IDLE_TASK\u003dy\n+CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1\u003dy\n # CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set\n CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1\u003dy\n # CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set\n@@ -204,7 +203,7 @@ CONFIG_FATFS_MAX_LFN\u003d255\n #\n # FreeRTOS\n #\n-CONFIG_FREERTOS_UNICORE\u003dy\n+# CONFIG_FREERTOS_UNICORE is not set\n CONFIG_FREERTOS_CORETIMER_0\u003dy\n # CONFIG_FREERTOS_CORETIMER_1 is not set\n CONFIG_FREERTOS_HZ\u003d100\n","s":{"c":1752655548,"u": 1648}} ],"g": 4095,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}