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

Create non-trivial example applications which encapsulate all required dependencies and configuration #2596

Open
jessebraham opened this issue Nov 25, 2024 · 7 comments
Labels
1.0 non-breaking Not needed for 1.0 and can be supported without breaking the driver. examples There is a problem with one or more of the examples

Comments

@jessebraham
Copy link
Member

This has been discussed internally, but I would like to open an issue to track progress on this and give a bit more visibility to the community regarding our plans here.

Our previous approach to examples was to create various applications per-peripheral, demonstrating their use. This resulted in a large number of examples, many of which were not particularly useful, and was a burden from a maintenance standpoint. Additionally, many of these examples were in reality more test-like in nature than they were useful examples. Many of these have been removed now, and converted to doctests where able.

We would like to create a number of non-trivial examples, each of which standalone projects. These should ideally demonstrate use of multiple peripherals in more real-world applications. We can take inspiration from ESP-IDF, for example. These applications should encapsulate all dependencies and configuration required to build them. This would alleviate the issues with our giant Cargo.toml containing dozens of dependencies, and hopefully make it a bit easier for users to get started. This will hopefully also help reduce the amount of duplication using our previous/current approach.

We should spend some time brainstorming what we would like these examples to look like. One idea would be something like reading one or more sensors, and sending the readings over the network to an MQTT broker, or something of this nature. Input is welcome (and encouraged) here.

Some relevant issues:

@jessebraham jessebraham added the examples There is a problem with one or more of the examples label Nov 25, 2024
@MabezDev
Copy link
Member

Just posting as an FYI, for some more interesting examples we can use m5stack devkits, as well as the official Espressif ones as they are a partner of ours.

@Dominaezzz
Copy link
Collaborator

If M5Stack is on the table I'm willing to contribute an example of an HTTP MJPEG Server using the Unit CamS3 5MP. It's SCCB/I2C API is very simple to work with compared to other cameras.

This example would use LCD_CAM, I2C and WiFi. (In theory one could make use of the microphone, led and SD card but that's out of scope for me).

@bjoernQ
Copy link
Contributor

bjoernQ commented Dec 4, 2024

Some topics I'd like to see covered by the new examples (in no particular order and incomplete) based on questions and discussions:

  • I2C + SPI displays via embedded-graphics
  • MQTT
  • TLS
  • Provisioning (SoftAP / BLE?) - includes persisting data
  • OTA
  • Sleep (deep + light)
  • I2S (e.g. a simple MP3 radio player?)
  • BLE HID keyboard
  • maybe using a REST API

Ideally as multi-target projects (if applicable)

@bjoernQ
Copy link
Contributor

bjoernQ commented Dec 4, 2024

Maybe when combined with good documentation the examples might replace https://github.com/esp-rs/no_std-training - since it's quite unpleasant to maintain (thanks to @SergioGasquez for always taking care of that btw)

@playfulFence
Copy link
Contributor

playfulFence commented Dec 4, 2024

I2C + SPI displays via embedded-graphics

For this, I think, we can (more or less) use one of our Wokwi examples. I'd also probably add some i2c sensor there
Or we can actually recreate esp-clock using esp-hal now

MQTT

Should be simple, I did it before, but tbh the most tedious part for me was to choose a good, reliable and relatively easy to use (optional, because all alone work, let's say, confusingly), but maybe it's only "me" issue though 😅

TLS

We can take the idea from https://github.com/sambenko/esp32s3-no-std-async-tls-mqtt/tree/main , but write it from scratch with current drivers (since esp32s3-hal is used there, I think, porting it will be more painful 😄 ) Might be potentially combined with MQTT or I2C example too though

@playfulFence
Copy link
Contributor

playfulFence commented Dec 10, 2024

Just in case, in the meantime, I started trying to convert the esp-clock example from Wokwi to the current version of our bare-metal drivers.

@JurajSadel
Copy link
Contributor

Regarding MQTT we can use our example from DevCon23: https://github.com/JurajSadel/esp32c3-no-std-async-mqtt-demo. We have one for C3, ESP32, and S3 at the moment. All of them need to be updated to latest hal - I will update them.

@tom-borcin tom-borcin added 1.0 non-breaking Not needed for 1.0 and can be supported without breaking the driver. and removed 1.0-blocker labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0 non-breaking Not needed for 1.0 and can be supported without breaking the driver. examples There is a problem with one or more of the examples
Projects
Status: Todo
Development

No branches or pull requests

7 participants