Skip to content

Conversation

@SergioGasquez
Copy link
Member

@SergioGasquez SergioGasquez commented Nov 18, 2025

Brief explanation of every project:

  • part1: Read sensor values and prints them
  • part2: Connects to wifi using env variables and does an http request
  • part3: Creates an AP and wifi provisioning portal, once you enter the credentials on the portal it does an http request
  • part4: Reads the sensor values and send them via mqtt (it doesnt have wifi provisioning)
  • part5: Like part4 but with wifi provisioning
  • part6: Adds a small ota example to part5

@bjoernQ
Copy link
Contributor

bjoernQ commented Nov 18, 2025

Awesome! Thanks for all the effort

I think I would change a few things

  • part1: Read sensor values and prints them
  • part2: Connects to wifi using env variables and does an http request => maybe use an http library like edge-http or reqwless to make things a bit simpler - manual http is a lot of noise
  • part3: Creates an AP and wifi provisioning portal, once you enter the credentials on the portal it does an http request => I would move this to part5 (well it's there but maybe just leave this part out, might be confusion at this point)
  • part4: Reads the sensor values and send them via mqtt (it doesnt have wifi provisioning)
  • part5: Like part4 but with wifi provisioning
  • part6: Adds a small ota example to part5

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I'll probably take a few iterations on this, but this is some initial feedback for you to address :)

Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also going to recommend getting rid of lib.rs, but looks like @MabezDev beat me to it. To build on this though, we should just move src/bin/main.rs to src/main.rs for each project to simplify the directory structure a bit, and then we can remove the [[bin]] sections from each Cargo manifest as well.

Additionally:

  • Do we want to de-duplicate .gitignore and just move it to the root or something?
  • Do we want to use a Cargo workspace so we can avoid duplicating the configuration for each part?

Still have more reviewing to do, will likely have more comments 😅

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really starting to come together!

I really like how part 6 has turned out, I think we should apply that separation as we go, in other words, we should teach specific part in main, then moving on the next part should consolidate the previous part by organizing it nicely into its own module or moving to a relevant place.

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the tools/server required for this training? The MQTT server, the possible HTTP server for serving OTA images (and if we want to send the values from here somewhere: #85 (comment)) should be available locally, ideally a one command run (could be xtask like) to spin up both servers, which the user can just leave in the background and check the outputs periodically as they go through the training.

I don't like the idea of relying on external services for a training, we're not in a control and it also rules out the possibility of doing the training offline. If you've been using external services to do the training so far, don't worry we don't have to have that stuff ready for this PR, but it is something I want.

@MabezDev
Copy link
Member

MabezDev commented Dec 3, 2025

Ah, of course I missed the instructions right in front of me: https://github.com/esp-rs/no_std-training/pull/85/files#diff-d8fcf6558a895bf2a076bea6f782b8a4934e59db40be7e849d287225a89cbe88R1-R12 :D.

Okay, so I can see these are done with external tools. That's fine I think for the purposes of this PR, but I'll file an issue to implement the "server" side of this for the reasons I outlined above.

// BROKER_HOST="<IP>" BROKER_PORT="1884" HOST_IP=<IP> cargo r -r
// 8. Join the AP network and navigate to http://<MCU_IP>/ the wifi credentials
// Once the device stops the AP mode and starts the STA mode connected to the wifi, it will start sending sensor data to the MQTT broker and wait for the button press to trigger OTA update.
// 9. Press the button to trigger OTA update. Ctrl+R to reset the device after the fimrware is downloaded.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not now probably but in the end we want the application to check for new firmware at some configurable interval - then automatically perform the update and reset automatically.

we can also use the addressable LED to show the status of the app - e.g. some color for "in provisioning mode", another for "performing update"

we can still make use of the button to implement a "reset to factory defaults" - i.e. get back to provisioning-mode (e.g. a real product might need this when the user changes the wifi credentials)

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

Successfully merging this pull request may close these issues.

4 participants