TcMenu / tcMenu

Menu library for Arduino, mbed and ESP with designer UI and remote control capabilities.
https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/
Apache License 2.0
295 stars 25 forks source link

Remote server plugin #491

Closed vzahradnik closed 1 month ago

vzahradnik commented 3 months ago

Is your feature request related to a problem? Please describe. Create a new TcMenu plugin which provides remote server support.

Describe the solution you'd like Allow the plugin to set either IP or DNS domain. Also allow to override this config using build flags, similarly how users can override project name. This is required as users might want to connect to different services based on the build configuration - a staging server for testing and a production server for release.

davetcc commented 2 months ago

Can you try it @vzahradnik and see if it works OK for you, I tested it on ESP32 and it built and worked.

vzahradnik commented 2 months ago

I will try it and report back here. Thanks!

vzahradnik commented 2 months ago

My first observation is regarding the IP address. Is there a way to use a compile flag instead of hardcoding the ip address in the field?

For example, I want to set one IP address for the debug environment and another one for production environment.

DNS resolver where I could type domain name would be even better but we can explore this feature later.

I will have a detailed look at the plugin during the week.

vzahradnik commented 2 months ago

Another observation: TcMenu tries to connect to remote even though the IP is not reachable. As part of the optimization, we should implement something like this:

This solution will - I believe - save some energy when running from battery and will reduce the clutter in logs a lot. image

Alternatively, respect the heartbeat global config and initiate the session not sooner than the HEARTBEAT_INTERVAL value.

vzahradnik commented 2 months ago

Long term, I'd like to have a networking module/library ready to handle this for the whole system.

vzahradnik commented 2 months ago

TcMenuJavaAPI in Maven Central is still on version 4.2.2 and doesn't have support for this feature.

vzahradnik commented 2 months ago

I will check the encryption code during the weekend. Besides those small optimization issues, the plugin works great!

davetcc commented 1 month ago

My first observation is regarding the IP address. Is there a way to use a compile flag instead of hardcoding the ip address in the field?

For example, I want to set one IP address for the debug environment and another one for production environment.

DNS resolver where I could type domain name would be even better but we can explore this feature later.

I will have a detailed look at the plugin during the week.

You can now set the address either to be hardwired, variable, or compile flag

davetcc commented 1 month ago

TcMenuJavaAPI in Maven Central is still on version 4.2.2 and doesn't have support for this feature.

It is now updated, this was due to the account needing an update.

davetcc commented 1 month ago

Alternatively, respect the heartbeat global config and initiate the session not sooner than the HEARTBEAT_INTERVAL value.

For now let's do this, and look into a proper networking library as discussed.

davetcc commented 1 month ago

I think most of the immediate issues are now resolved by 4.4, I'm going to close for now, and we can open issues for anything new that we find.