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

port to a generic ESP32-S3 board with no lcd (headless mode) #107

Open
eadmaster opened this issue Aug 2, 2024 · 5 comments
Open

port to a generic ESP32-S3 board with no lcd (headless mode) #107

eadmaster opened this issue Aug 2, 2024 · 5 comments
Assignees

Comments

@eadmaster
Copy link
Contributor

eadmaster commented Aug 2, 2024

In this branch i am trying to port Bruce for use with a generic ESP32-S3 board ("headless"=without LCD and buttons). Currently i'm using this one.

To keep the build as generic as possible, i'm planning to use:

  • a virtual display simulated on a smartphone using this lib. It allows to use the touchscreen for input, so no extra buttons are needed.
  • generic IR modules like these (should be compatible with the ones on M5Stack products, 0 code changes needed)
  • single-pinned modules like the FS1000A for RF (CC1101 should be easy to add in the future via SPI). Still 0 code changes needed.
  • builtin wifi and BT (should work without changes)
  • SD card disabled by default, maybe in the future could access storage from the smartphone directly
  • badusb may need reworking, maybe it's possible to use the 2nd usb port for it (need to investigate)

So the only parts that needs reworking actually are: the display, keyboard input, and badusb.

So far i'm getting the firmware bulding and drawing on my smartphone. Unfortunately the Vectordisplay lib lacks some drawing functions used by Bruce, so it is not rendering 100% correctly:

bruce

I also have to rewrite the input system to make use of the touchscreen, so this will take a while.

Another option is to expose all the firmware features via serial commands or the WebUI, and then write a custom Android app to use them for remote control, so no virtual display is needed.

Once i got this working correctly, it should make easier to extend support for other headless ESP32 boards from M5Stack, like the AtomS3 Lite, Capsule Kit, and even other generic ESP32 boards.

eadmaster added a commit to eadmaster/Bruce that referenced this issue Aug 2, 2024
eadmaster added a commit to eadmaster/Bruce that referenced this issue Aug 2, 2024
@bmorcelli
Copy link
Collaborator

Niiice!!!

This morning I will work on the porting to other devices, so I will chage platformio.ini and use flags to allow the features per device...

With it, core devices and CYD will come together

@eadmaster
Copy link
Contributor Author

eadmaster commented Aug 3, 2024

After experimenting with the vectordisplay lib, i've found the easiest route for headless devices should be adding more features for remote control directly to the webUI.

After checking your PR here, i've added back my esp32-s3-devkitc-1 target, and made another branch for this solution.

vectordisplay.h is now just a mock class, and the board autostarts in AP mode.
I've added a new function to send ir files from the webUI:

ir_test

Can also be tested with curl -XPOST "http://bruce.local/ir" -d "filePath=/AC_LG_SX122CL_on.ir"

Currently WIP:

  • not sure how to add a new custom icon into the webui
  • add a function to send sub and rubbeducky files.
  • transmit ir/sub files directly from the browser without uploading to the fs first (passed in the body request)
  • move the client-side code of the webui on the flash storage: (1) to save space on the app prtition, (2) for easier development and customization
  • add ECM/RNDIS mode as alternative to AP mode , so wifi features are still usable

eadmaster added a commit to eadmaster/Bruce that referenced this issue Aug 3, 2024
eadmaster added a commit to eadmaster/Bruce that referenced this issue Aug 4, 2024
@eadmaster
Copy link
Contributor Author

eadmaster commented Aug 4, 2024

update: i've refactored the serialcmds module, so that the same commands can also be sent via the webUI. e.g.:

curl -XPOST "http://bruce.local/cm" -d "cmnd=ir tx nec 04000000 08000000"

i've also added 3 new serial cmds :

	subghz tx_from_file  plug1_off_key.sub
	ir tx_from_file  LG_AKB72915206_power.ir
        badusb tx_from_file   Jitter-example1.txt

eadmaster added a commit to eadmaster/Bruce that referenced this issue Aug 4, 2024
eadmaster added a commit to eadmaster/Bruce that referenced this issue Aug 4, 2024
eadmaster added a commit to eadmaster/Bruce that referenced this issue Aug 4, 2024
@eadmaster
Copy link
Contributor Author

OT: in the branch i'm working on i've also added another keyboard shortcut for the cardputer only: quick select options using the top row number keys 1-9. Then press again the same number to confirm. Should be a quicker alternative to the usual arrow keys+enter combo.

@eadmaster
Copy link
Contributor Author

eadmaster commented Aug 4, 2024

Quick recap on this:

for any target, if HAS_SCREEN is not defined, the board will autostart in 'headless' mode, which imply:

  • webui and wifi in AP mode started soon after boot
  • no menu is rendered and no hardware buttons are checked, the board will only process commands sent via the webui or the serial port
  • not all firmware features are available in this mode. To expose a new one: add a serial cmd, then modify the webui frontend for easier access.

@eadmaster eadmaster changed the title port to a headless ESP32-S3 board port to a generic ESP32-S3 board (headless mode) Aug 4, 2024
@eadmaster eadmaster changed the title port to a generic ESP32-S3 board (headless mode) port to a generic ESP32-S3 board with no lcd (headless mode) Aug 4, 2024
eadmaster added a commit to eadmaster/Bruce that referenced this issue Aug 4, 2024
pr3y added a commit that referenced this issue Aug 5, 2024
added headless mode, numbered keyboard shortcuts, added boot sound (#107) (#113)
eadmaster added a commit to eadmaster/Bruce that referenced this issue Aug 6, 2024
pr3y added a commit that referenced this issue Aug 7, 2024
eadmaster added a commit to eadmaster/Bruce that referenced this issue Aug 20, 2024
pr3y added a commit that referenced this issue Aug 20, 2024
headless fixes (#107), added some serial cmds (#64), initial encrypted files support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants