-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
280 changed files
with
76,899 additions
and
667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "components/libwebsockets"] | ||
path = components/libwebsockets | ||
url = https://github.com/warmcat/libwebsockets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +1,28 @@ | ||
lws-esp32 | ||
========= | ||
lws-esp32-test-server-demos | ||
=========================== | ||
|
||
## Status | ||
## For use with lws-esp32-factory | ||
|
||
- Station mode provides the full lws test server on port 443 over htps, all working | ||
This relies on setup capability provided by | ||
|
||
- ESP32 becomes an AP and serves dynamic websocket-based scan / config page, | ||
so you can set up your AP and password. Initially comes up in this since | ||
the AP details are not set yet. | ||
https://github.com/warmcat/lws-esp32-factory | ||
|
||
 | ||
which runs from the "factory" partition on ESP32. This app is | ||
designed to run from the since 2.9MB OTA partition. | ||
|
||
- Integration to new projects hugely simplified by moving common lws support code | ||
into lws directly. Non-library parts licensed are CC0. | ||
## Build | ||
|
||
|
||
## Customizing to your build setup | ||
|
||
### 0) Set the right serial device in menuconfig | ||
|
||
### 1) Patch esp-idf | ||
|
||
You can either use the already-patched esp-idf at | ||
|
||
$ git clone --init --recursive https://github.com/lws-team/lws-esp-idf | ||
|
||
or you can apply this patch to your own esp-idf | ||
|
||
```diff | ||
Apply this patch on esp-idf, then | ||
|
||
|
||
diff --git a/.gitmodules b/.gitmodules | ||
index 6a6af0e..897992d 100644 | ||
--- a/.gitmodules | ||
+++ b/.gitmodules | ||
@@ -13,3 +13,7 @@ | ||
[submodule "components/coap/libcoap"] | ||
path = components/coap/libcoap | ||
url = https://github.com/obgm/libcoap.git | ||
+[submodule "components/libwebsockets"] | ||
+ path = components/libwebsockets | ||
+ url = https://[email protected]/warmcat/libwebsockets | ||
+ branch=master | ||
diff --git a/components/libwebsockets b/components/libwebsockets | ||
new file mode 160000 | ||
index 0000000..3a09c3b | ||
--- /dev/null | ||
+++ b/components/libwebsockets | ||
@@ -0,0 +1 @@ | ||
+Subproject commit 102d40e6b6486076f37a46708604ec387834f16c | ||
``` | ||
|
||
and then do | ||
|
||
$ make all flash_ota monitor | ||
``` | ||
$ git submodules update --recursive | ||
``` | ||
|
||
from the esp-idf | ||
|
||
### 2) Partitioning the device | ||
|
||
Clear down the partitioning since we write a custom table and the bootloader | ||
will choke if the OTA parts are not initialized like this | ||
|
||
``` | ||
$ make erase_flash | ||
``` | ||
|
||
## Writing the ROMFS to flash | ||
|
||
A ROMFS contains the files to be served, stored at a partition at the end | ||
of the flash. | ||
|
||
There's currently space for ~900KiB there. | ||
|
||
The ROMFS is generated automatically from files in `./romfs-files` every make. | ||
|
||
Write it and update it in the flash like this: | ||
|
||
``` | ||
$ make all flash-romfs | ||
``` | ||
|
||
## General build and flash | ||
|
||
``` | ||
$ make all flash monitor | ||
``` | ||
|
||
## Using the AP config | ||
|
||
- connect your wifi to the ap "lws-config-...." | ||
|
||
- In a browser, go to https://192.168.4.1 | ||
|
||
- set a serial number, like 1234 | ||
|
||
- Select your normal AP from the list | ||
|
||
- Give the AP password and click the button | ||
|
||
- Your ESP32 resets into Station mode and associates with the AP | ||
|
||
## Using the lws test apps | ||
|
||
See what IP your ESP32 got from your AP, the visit it in your browser | ||
using, eg https://192.168.2.249 | ||
|
||
If your dhcp server provides your dns, you can also reach the device | ||
using lws-serial, eg, https://lws-1234 | ||
using lws-serial, eg, https://lws-1234 or https://lws-1234.local | ||
|
||
- dumb increment should be updating at ~20Hz | ||
|
||
|
@@ -123,3 +35,7 @@ using lws-serial, eg, https://lws-1234 | |
|
||
- POST tests should pass the string and upload the file if one given | ||
|
||
- The button at the bottom should reset you into the setup / factory app | ||
|
||
- The "War and Peace" demo should load the 4MB text from the 1.2MB gzipped zip | ||
file directly, using gzipped data to the browser. |
Submodule libwebsockets
added at
53f897
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
*.diff | ||
*.patch | ||
*.orig | ||
*.rej | ||
|
||
*~ | ||
*.a | ||
*.lo | ||
*.o | ||
*.dylib | ||
|
||
*.gcda | ||
*.gcno | ||
*.gcov | ||
|
||
/example | ||
/example64 | ||
/examplesh | ||
/libz.so* | ||
/minigzip | ||
/minigzip64 | ||
/minigzipsh | ||
/zlib.pc | ||
/configure.log | ||
|
||
.DS_Store |
Oops, something went wrong.