WLED icon indicating copy to clipboard operation
WLED copied to clipboard

added ble & wifi switch

Open johne opened this issue 1 year ago • 10 comments

johne avatar Dec 05 '22 09:12 johne

Is platformio_override.ini really needed? The _override.ini is usually for custom build environments, so should not be a requirement to overwrite an existing override file. Also you run into a risk that WLED build targets evolve, and some day your override is outdated and will not work anymore.

I think it would be better to describe in the readme.md what are the changes needed to use this usermod, like

  • Additions to build_flags
  • Additions to lib_deps If you are looking for an example, check the (exhaustive) readme of audioreactive usermod https://github.com/Aircoookie/WLED/blob/main/usermods/audioreactive/readme.md

If you still think that an override is needed, you could use the extends keyword like this:

[env:esp32dev_ble]
extends = env:esp32dev_qio80
build_flags = ${env:esp32dev_qio80.build_flags}
    -D your_special_flags
lib_deps = ${env:esp32dev_qio80.lib_deps}
      espressif/stuff_you_need @ version
board_build.partitions = tools/WLED_ESP32_4MB_for_BLE.csv

[env:esp32S3_ble]
extends = env:esp32s3dev_8MB
build_flags = ${env:esp32s3dev_8MB.build_flags}
    -D your_special_flags
lib_deps = ${env:esp32s3dev_8MB.lib_deps}
      espressif/stuff_you_need_more @ OtherVersion
board_build.partitions = tools/WLED_ESP32_8MB_for_BLE.csv

softhack007 avatar Dec 05 '22 17:12 softhack007

I am wondering if this is just a prototype or a fully functional usermods as I do not understand where do you handle JSON input (which is normally done using HTTP requests and is handled by AsyncWebServer). If so please change it to draft so we can discuss. If I am missing the point and this is a functional PR then please add regular JSON processing as well as configuration.

Same question from my side. It seems that this usermod allows to create a BLE connection, can it also do other things, or maybe can it be configured to do things when a JSON file is provided, similar to IR remote maybe?

softhack007 avatar Dec 05 '22 18:12 softhack007

btw, great work, thanks 👍 The fact I'm making so many requests means I really like what you did, and I'm curious to see how this will evolve 😃

softhack007 avatar Dec 05 '22 18:12 softhack007

@johne please provide more information about your PR. And change it to draft as it seems you are still working on it.

blazoncek avatar Dec 09 '22 08:12 blazoncek

Converted to draft

softhack007 avatar Dec 09 '22 15:12 softhack007

I am so sorry.. I did not mean for this to become a pr yet... I guess just pushing to my branch automatically created it... that said, it is pretty close to done now... the only part of the json api I haven't implemented yet is palette details... the front end degrades very nicely without that data though... my plan is to implement that and be done with it... in the app I wrote: https://github.com/johne/WledAppV2 I just hide the "config" tab... but there is a way in the app to switch back to wifi. meaning you just switch back and then you can get to the config tab... the ble doesn't support the syncing through udp, which is why, for my home, I want to find a > 4mb esp32 with ethernet... so I can have ota and syncing... I don't need it for my trailer, however, cause when i'm home I can just switch to wifi to configure, but access all other front end features through ble... I will address the comments above inline.

johne avatar Dec 30 '22 14:12 johne

I am wondering if this is just a prototype or a fully functional usermods as I do not understand where do you handle JSON input (which is normally done using HTTP requests and is handled by AsyncWebServer). If so please change it to draft so we can discuss. If I am missing the point and this is a functional PR then please add regular JSON processing as well as configuration.

Same question from my side. It seems that this usermod allows to create a BLE connection, can it also do other things, or maybe can it be configured to do things when a JSON file is provided, similar to IR remote maybe?

yeah... this is due to the fact that I accidentally opened this PR too early... now, if you look at it, you will see the (almost) full implementation of the json api... the only thing it isn't supporting yet (but will soon) is the palette details... I even have a front end that supports all the features (but config) the current website does (in fact, the react-native app I wrote downloads the matching release from github to use the exact same interface)

johne avatar Dec 30 '22 14:12 johne

here are some screenshots of the app working in ble mode... as I was gathering the shots, I realized the "info" tab doesn't work... so i'll have to figure out why (i'm guessing I just missed handling one of the json api endpoints in the app)... other than that, every screens works as normal to control the lights....

johne avatar Dec 30 '22 15:12 johne

the app also works in wifi mode as well (very similar to the current wled app)

johne avatar Dec 30 '22 15:12 johne

also, it supports the "websocket" type mode of getting updates to state based on changes from other sources (another connected ble device, a playlist that makes timed changes, etc)

johne avatar Dec 30 '22 15:12 johne

Please remove platformio_override.ini from the PR. It is intentionally not included in main (or any other) branch.

blazoncek avatar Mar 08 '23 15:03 blazoncek

I consider disabling wifi and/or ble a core functionality and would like to see both in WLED rather than a usermod.

We use buttons to control our device. At times we want to disable wifi and/or ble, also with buttons. Since we have buttons to steer the device, we don't need any other remote means for controlling WLED but sometimes we want to use the web ui or mobile app. So we use a button to switch it on again

So saying this would render WLED unusable is certainly not right. WLED works perfectly fine without a wireless connection and valid use cases exist

Further on the plus side it does reduce both attack surface and power consumption While reduction of power consumption is always a worthwhile goal also consider that some devices run on battery

bbusse avatar Apr 06 '23 19:04 bbusse

this seems so close to completion, can I help?

Funkelfetisch avatar Nov 28 '23 02:11 Funkelfetisch

Have you considered using NimBLE for BLE library? it seems more efficient

Moustachauve avatar Dec 04 '23 00:12 Moustachauve

Hey! This pull request has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs. Thank you for contributing to WLED! ❤️

github-actions[bot] avatar Apr 15 '24 12:04 github-actions[bot]