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

Expander improvements I #74

Merged
merged 21 commits into from
Nov 8, 2024
Merged

Expander improvements I #74

merged 21 commits into from
Nov 8, 2024

Conversation

JensOgorek
Copy link
Contributor

@JensOgorek JensOgorek commented Sep 30, 2024

This is from #18

  • Wait for full ESP Boot Dump to be written -> Delay at start.
  • Move "Ready." msg infront of main loop
  • Added reboot command to 2-pin-expander
  • Added "is_ready" property for expander
  • Added indefinite waiting from expander module for waiting msg [1. Point from Improve integration of expander module #18]
  • Added "boot_wait_time" Parameter for indefinite waiting or waiting with timeout [3. Point from Improve integration of expander module #18]
  • Added new Property to proxy, to see if proxied properties were created. The older "hotfix" properties could not get used for safe checks, but this one is.[2. Point from Improve integration of expander module #18]
  • fix crashes
  • fix expander module not reading the "ready" signal.
  • Added check for Proxy if Expander is ready, without stopping the program execution

@JensOgorek JensOgorek added the enhancement New feature or request label Sep 30, 2024
@JensOgorek JensOgorek self-assigned this Sep 30, 2024
@JensOgorek JensOgorek linked an issue Sep 30, 2024 that may be closed by this pull request
7 tasks
@JensOgorek JensOgorek added this to the 0.6.0 milestone Oct 23, 2024
@JensOgorek JensOgorek changed the title Expander improvements Expander improvements I Oct 23, 2024
@JensOgorek
Copy link
Contributor Author

Delaying the main task is generally not a good idea. If it is delayed too long, the esp watchdog will trigger and will reset the esp.
The solution is to initiate the expander module and not wait for the expander in the initialization. But check regularly if the expander itself is ready. If it is, the expander module will be set ready, and will be able to handle proxies, for example.

@JensOgorek
Copy link
Contributor Author

What's changed (overall)

  • We delay the start by 2 sec for the log dump to fully complete
  • The expander itself will also restart the esp32 with the core.restart() command on 2 pin mode
  • The initialization of the expander module is handled on the loop (step), rather of the initialization, since we need the esp32 to be restarted.
  • The initialization uses states to handle the current module state (init, waiting, restart, ready)
  • It is possible to see if the expander module is ready and the esp32 is set up by checking the "is_ready" property
  • The proxy module does not set up the broadcast on creation
  • The proxy module does not "bypass" the expander module and just uses its serial connection
  • The proxy module will add the proxy to a list inside the expander module for the expander module to set up, when the esp32 is ready.
  • The proxy module can be checked with the "is_ready" property, if it is set up and running
  • With these changes, you can load a start script without the expander esp running and activating it later - and it will still be set up correctly.
  • A lot of these changes will also aim for further implements like recovery of the expander on crash.

@JensOgorek JensOgorek marked this pull request as ready for review October 29, 2024 15:31
@JensOgorek
Copy link
Contributor Author

I also tested the expander changes with the current main version. Seems to work as expected.

JensOgorek and others added 3 commits November 8, 2024 10:09
* update: is alive

* update: add heartbeat handling (proxy & nonproxy) and recovery

* move call to the buttom

* update: improved proxy handling

* update: improved "is_ready" handling with step and expander module's ready signal

* update: fix timeout logic, fix casting, refactor

* update: directly use pointer to expander is_ready
@JensOgorek
Copy link
Contributor Author

JensOgorek commented Nov 8, 2024

It seems to be working. But I muted the "__PONG__" answer, since it leads to a lot of unnecessary spam.

@JensOgorek JensOgorek merged commit d650b59 into main Nov 8, 2024
@JensOgorek JensOgorek deleted the expander_improvements branch November 8, 2024 14:32
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

Successfully merging this pull request may close these issues.

Improve integration of expander module
2 participants