Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homepoint 2.0 Announcement #155

Open
sieren opened this issue Feb 24, 2021 · 7 comments
Open

Homepoint 2.0 Announcement #155

sieren opened this issue Feb 24, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@sieren
Copy link
Owner

sieren commented Feb 24, 2021

I am currently working on Homepoint 2.0 which will be a complete rewrite based on https://github.com/lvgl/lvgl, allowing to more easily support new platforms and a more responsive UI.

@sieren sieren added the enhancement New feature or request label Feb 24, 2021
@sieren sieren changed the title Rewrite Homepoint using LVGL Homepoint 2.0 Announcement Apr 23, 2021
@sieren sieren pinned this issue Apr 23, 2021
@sieren
Copy link
Owner Author

sieren commented May 7, 2021

Beta versions for AZTouchMod and M5Stack Core 2

homepoint_m5core2_aztouchmod_betas.zip

@Girgitt
Copy link

Girgitt commented Jan 17, 2022

Initial impressions on M5Core2 are very good. The lvgl-based version seems stable (at least no unexpected reboots experienced).

However with the screen layout copied from the example config the initial screen is gray with IP address appearing after a couple of seconds. To get proper screen content one must tap to change screen and then move back manually triggering redraw/refresh.

Do you have plans to continue development?

Your approach to navigation seems better compared to the much simpler code of cfGUI library which I extended to support M5core2 but any other development is probably worthless given how functional and eye-candy your design is.

EDIT: Actually the initial gray screen does not always happen. On some occasions reset results in a properly drawn initial screen. Maybe the issue results from the lack of topics on my test MQTT server.

@sieren
Copy link
Owner Author

sieren commented Jan 18, 2022

Thanks for your assessment @Girgitt :) There are still tons of bugs in there and the code is still somewhat messy as I've been trying to do performance improvements to increase FPS.

It's true, I haven't contributed much to the repo recently, but I have not abandoned the project. It's just that I had very little time to work on side projects in the past 6 months but I hope to return sometime soon.

@Girgitt
Copy link

Girgitt commented Jan 18, 2022

That's some good news :) Thank you for reaching back. I wish my Cpp skills were much better to be able to provide some valuable contribution but who knows, maybe it's a good enough reason to at least try when M5core2 becomes the supplemental HMI to my Homematic IP network in the next couple of months.

@Girgitt
Copy link

Girgitt commented Aug 27, 2022

Hi @sieren would find time to update/add building steps for homepoint-2.0-lvgl branch?

Instructions from wiki are obsolete as esp-idf version changed to v4.4 (at least this is what I found based on arduino-esp32 submodule's history for version committed to the homepoint-2.0-lvgl branch) but even with an updated esp-idf the compilation using /scripts/build_all.sh fails due to error:
homepoint/components/ESPAsyncWebServer/src/WebAuthentication.cpp:74: undefined reference to `mbedtls_md5_starts'

Maybe some specific tag of esp-idf should be used?

(There are other issues like code from /scripts/merge_bin_esp.py being written in py2 while esp-idf uses py3 with virtualenv which makes the environment difficult to initialize. Fortunately, a trivial fix is to call python2 in build_all.sh instead of python),

EDIT: with esp-idf v4.4.1 the mentioned error is gone. M5Stack2 boots but shows error: "could not pares failsafe file".
The homepoint.bin fails to build for targets M5Stack and ESP32 without any specific error - just file not found exception is thrown by merge_bin_esp.py.
`

@greiner11
Copy link

I concur with @Girgitt opinion. I am also enthusiastic about the project - it's a pity that it has not been developed further for some time.
It would also help me if I could compile it myself. However, I also failed with several errors.
The branch from Homepoint 2.0 has a VSC-Workspace. Is it possible to compile the code with Visual Code and the extension espressif (esp-idf extension)?

@Girgitt
Copy link

Girgitt commented Jan 15, 2024

So I tried to re-visit the project after a year and OMG what an adventure. First of all, despite what I wrote earlier, it is impossible that esp-idf version required to compile it is v4.4.1. IT IS NOT. it is something between 4.4.0 and 4.4.1. The proper version should be the esp-idf master at the time of arduino-esp32. Good luck in finding that - there is a version in submodule components/arduino-esp32 but it is Sieren's fork. Anyway by trying to use esp-idf v.4.4.1 and following error about missing reference to mbedtls_md5_starts i found commit that defines mbedtls_md5_starts_ret:

zbig@TX1320-1:~/repos/priv/esp/esp-idf_4_4_1$ git log -S "define mbedtls_md5_starts"
commit e87c64dc4443d973b784c9674a79259493abf9c0
Author: liuhan <liuhan@espressif.com>
Date:   Tue Apr 6 14:21:28 2021 +0800

    mbedtls: Add CONFIG_MBEDTLS_ROM_MD5 to use ROM MD5 in mbedTLS
zbig@TX1320-1:~/repos/priv/esp/esp-idf_4_4_1$ git show e87c64dc4443d973b784c9674a79259493abf9c0 | grep esp_md5_init
+int esp_md5_init_ret( mbedtls_md5_context *ctx );
+void esp_md5_init( mbedtls_md5_context *ctx );
+#define mbedtls_md5_init                        esp_md5_init
+#define mbedtls_md5_starts_ret                  esp_md5_init_ret
+int esp_md5_init_ret( mbedtls_md5_context *ctx )
+void esp_md5_init( mbedtls_md5_context *ctx )
+    esp_md5_init_ret(ctx);

One commit earlier 1f54d17503ff17d830de75eed4eb47bc6a3aafc3 was a good candidate and it works - at least Homepoint from branch homepoint-2.0-lvgl compiles. To avoid issues one needs to:
esp-idf# rm -rf ~/.esspressif
esp-idf# git checkout 1f54d17503ff17d830de75eed4eb47bc6a3aafc3
esp-idf# git submodule update --init --recursive
(make sure to install python3 requirements fromvim install guide: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html )
edit ./tools/idf_tools.py line 13385 and remove --user arg to pip; at least on py3.10 this breaks install.sh
esp-idf# ./install.sh
esp-idf# . ./source.sh

Then (after setting up python2 in your environement and modifying build_all.sh to use python2 instead of python and optionally commenting out steps for platforms you don't need) compile Homepoint with
homepoint/scripts/# ./build_all.sh

At this point I am not sure if the resulting build works but size seems correct. Time to look for USB A to C cable.. and build loaded with
sudo esptool -b 921600 write_flash -fs 4MB -fm dout 0x0 ./homepoint_m5stackcore2_full.bin
doesn't work (black screen).
serial debug shows error:
E (1214) i2c: i2c_master_cmd_begin(1394): i2c driver not installed
ESP_ERROR_CHECK_WITHOUT_ABORT failed: esp_err_t 0x103 (ESP_ERR_INVALID_STATE) at 0x4008991b

Before that I tried many esp-idf versions and here is other way that resulted in compilation but M5Core2 did not start after flashing with esptool:

  1. checkout esp-idf to v.4.4-beta1
  2. change Homepoint/components/ESPAsyncWebServer/src/WebAuthentication.cpp:74 mbedtls_md5_starts to mbedtls_md5_starts_ret
  3. add values from undefined reference to `MD5Update' in arduino as component espressif/arduino-esp32#5925 (comment) to esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld

[EDIT]
Tried different approach - Sieren's PR (espressif/arduino-esp32@e30b821) was merged to esspressif/arduino-esp32 and relesed in all v2.0.X tags.
test 1: arduino-esp32 v2.0.0 + esp-idf v4.4 = compilation successful but initialization fails with E (1214) i2c: i2c_master_cmd_begin(1394): i2c driver not installed

the lowest possible arduino-esp32 version to use: v.2.0.2

test 2: arduino-esp32 v2.0.2 + esp-idf v4.4.1 =
E (1214) i2c: i2c_master_cmd_begin(1398): i2c driver not installed
ESP_ERROR_CHECK_WITHOUT_ABORT failed: esp_err_t 0x103 (ESP_ERR_INVALID_STATE) at 0x4008998b
file: "./components/esp_i2c_helper/i2c_helper.c" line 100

another option is to take idf version from debugger output of the working beta build by Sieren:
I (667) cpu_start: ESP-IDF: v4.0.2-206-g5630b17e1-dirty
however this idf version is not compatible with commited version of arduino-esp32 submodule

build arduino-esp32 v2.0.2 + esp-idf v4.4.1 is promissing but 3 issues exist:

  1. i2c driver is not loaded; it can be loaded manually in main.c:app_main and seems to work as voltages are logged in debug output
  2. SPI MOSI pin (19) is different than in debugging output of beta image (38) logged by lvgl_helpers; not sure if the debug output with pin numbers used is for touch or display
  3. SPIFFS fails to mount with error -10025 but build from master shows the same error and icons are displayed
    FIX: in lvgl branch application binary size increased but spiffs offset was not updated in /scripts/build_all.sh script in arguments passed to merge_bin_esp.py. SPIFFS offset should be 0x310000 and not 0x2b0000:
    --bin_address 0x8000 0xd000 0x1000 0x10000 0x310000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants