forked from warmcat/libwebsockets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements a carousel rendering and displaying remote HTML + JPEG + PNGs on a variety of display devices, including several EPDs.
- Loading branch information
Showing
65 changed files
with
31,398 additions
and
5 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
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
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
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,81 @@ | ||
# lhp (HTML renderer) embedded demos | ||
|
||
These are demos for various ESP32 + display combinations. A lot of | ||
the code is common between the demos and is in the toplevel dir | ||
(where this README lives). | ||
|
||
Notice that although the demos are for ESP32 currently, there is no | ||
ESP32-specific code in the common part. Only `main/devices.c` in the | ||
combination-specific directories has the platform-specific init. | ||
|
||
The demo visits some sites using h2 and renders them on the device + | ||
display combination, with a 10s wait between, in a carousel. | ||
|
||
ESP32 WROVER KIT, and ESP32S2 Kaluga boards and displays are | ||
supported, along with Waveshare ESP32 dev board and a variety of | ||
E-ink displays. | ||
|
||
## Setting up wifi | ||
|
||
Edit ./main/devices.c in your platform-specific subdir, enable this section | ||
and set your wifi SSID and passphrase in the `xxx` strings. This will store | ||
the information on flash on the device. | ||
|
||
Boot once with that and then remove your information and disable the code | ||
section again and rebuild. | ||
|
||
``` | ||
#if 0 | ||
/* | ||
* This is a temp hack to bootstrap the settings to contain the test | ||
* AP ssid and passphrase for one time, so the settings can be stored | ||
* while there's no UI atm | ||
*/ | ||
{ | ||
lws_wifi_creds_t creds; | ||
memset(&creds, 0, sizeof(creds)); | ||
lws_strncpy(creds.ssid, "xxx", sizeof(creds.ssid)); | ||
lws_strncpy(creds.passphrase, "xxx", sizeof(creds.passphrase)); | ||
lws_dll2_add_tail(&creds.list, &netdevs->owner_creds); | ||
if (lws_netdev_credentials_settings_set(netdevs)) { | ||
lwsl_err("%s: failed to write bootstrap creds\n", | ||
__func__); | ||
return 1; | ||
} | ||
} | ||
#endif | ||
``` | ||
|
||
Eventually there will be a better way to set this up. | ||
|
||
## Building | ||
|
||
Set up for esp-idf, enter the platform-specific subdir and edit | ||
`build.sh` to point to the correct USB device path. | ||
|
||
The first time we need to erase the whole flash and blow the whole | ||
image and partition table | ||
|
||
``` | ||
$ ./build.sh erase-flash | ||
$ ./build.sh | ||
``` | ||
|
||
Afterwards you can force-build like this which flashes both OTA | ||
partitions with the new imahe | ||
|
||
``` | ||
$ ./build.sh f | ||
``` | ||
|
||
After you have changed `./build.sh` to your own OTA keys and upload path, and adapted the | ||
policy to look at your firmware server, you will typically build via uploading to that, | ||
which resets the board so it can find and install the update and reboot | ||
|
||
``` | ||
$ ./build.sh u | ||
``` | ||
|
53 changes: 53 additions & 0 deletions
53
minimal-examples/embedded/lhp/esp32-heltec-128-64/CMakeLists.txt
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,53 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
if (ESP_PLATFORM) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(lws-minimal-esp32 C) | ||
enable_testing() | ||
|
||
target_link_libraries(lws-minimal-esp32.elf websockets) | ||
|
||
option(LWS_WITH_DRIVERS "With generic drivers for gpio, i2c, display etc" ON) | ||
set(LWS_WITH_DRIVERS ON) | ||
option(LWS_WITH_SECURE_STREAMS "With secure streams" ON) | ||
set(LWS_WITH_SECURE_STREAMS ON) | ||
option(LWS_WITH_LWSAC "With lwsac" ON) | ||
set(LWS_WITH_LWSAC ON) | ||
option(LWS_WITH_STRUCT_JSON "With lws_struct JSON" ON) | ||
set(LWS_WITH_STRUCT_JSON ON) | ||
option(LWS_WITH_SYS_NTPCLIENT "With ntpclient" ON) | ||
set(LWS_WITH_SYS_NTPCLIENT ON) | ||
option(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY "Static policy" OFF) | ||
set(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY OFF) | ||
option(LWS_WITH_TLS_JIT_TRUST "With JIT Trust" ON) | ||
set(LWS_WITH_TLS_JIT_TRUST ON) | ||
option(LWS_WITH_COMPRESSED_BACKTRACES "Build with support for compressed backtraces" ON) | ||
set(LWS_WITH_COMPRESSED_BACKTRACES ON) | ||
set(LWS_COMPRESSED_BACKTRACES_SNIP_PRE 2 CACHE STRING "Amount of callstack to snip from top" FORCE) | ||
set(LWS_COMPRESSED_BACKTRACES_SNIP_POST 2 CACHE STRING "Amount of callstack to snip from bottom" FORCE) | ||
|
||
option(LWS_WITH_ALLOC_METADATA_LWS "Build lws_*alloc() with compressed backtraces (requires WITH_COMPRESSED_BACKTRACES)" OFF) | ||
set(LWS_WITH_ALLOC_METADATA_LWS OFF) | ||
|
||
option(LWS_WITH_OTA "Build with support for Over The Air update download and validation" ON) | ||
set(LWS_WITH_OTA ON) | ||
|
||
set(LWS_OTA_VARIANT "esp32-heltec-128-64" CACHE STRING "Build variant for OTA filtering" FORCE) | ||
set(LWS_OTA_PUBLIC_JWK_FILE "$ENV{HOME}/.lws_ota/libwebsockets.org-ota-v1.public.jwk" CACHE STRING "JWK path" FORCE) | ||
|
||
set(CMAKE_BUILD_TYPE RELEASE) | ||
|
||
add_subdirectory(libwebsockets) | ||
|
||
add_test(NAME flashing COMMAND idf.py flash) | ||
set_tests_properties(flashing PROPERTIES | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
TIMEOUT 120) | ||
|
||
add_test(NAME boot COMMAND /usr/local/bin/sai-expect) | ||
set_tests_properties(boot PROPERTIES | ||
DEPENDS flashing | ||
TIMEOUT 60) | ||
|
||
endif() |
1 change: 1 addition & 0 deletions
1
minimal-examples/embedded/lhp/esp32-heltec-128-64/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../.. |
8 changes: 8 additions & 0 deletions
8
minimal-examples/embedded/lhp/esp32-heltec-128-64/main/CMakeLists.txt
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,8 @@ | ||
idf_component_register(SRCS | ||
../../main.c | ||
../../lhp-ss.c | ||
devices.c | ||
INCLUDE_DIRS "../libwebsockets/include;${IDF_PATH}/components/spi_flash/include;${IDF_PATH}/components/nvs_flash/include;${IDF_PATH}/components/mdns/include") | ||
|
||
target_link_libraries(${COMPONENT_LIB} websockets) | ||
include_directories(../build/libwebsockets) |
Oops, something went wrong.