-
Notifications
You must be signed in to change notification settings - Fork 25
Initial implementation of no_std-training app parts #85
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
base: feat/overhaul
Are you sure you want to change the base?
Initial implementation of no_std-training app parts #85
Conversation
|
Awesome! Thanks for all the effort I think I would change a few things
|
MabezDev
left a comment
There was a problem hiding this 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 :)
There was a problem hiding this 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
.gitignoreand 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 😅
3072f3e to
709f882
Compare
bfd7bd0 to
678ff47
Compare
a072eac to
6dfe1ce
Compare
MabezDev
left a comment
There was a problem hiding this 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.
870826f to
873d4c2
Compare
ce4be65 to
a4d9623
Compare
7471acb to
a864403
Compare
MabezDev
left a comment
There was a problem hiding this 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.
|
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. |
There was a problem hiding this comment.
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)
4bed855 to
f7900ac
Compare
f7900ac to
a8d5cc4
Compare
Brief explanation of every project:
part1: Read sensor values and prints thempart2: Connects to wifi using env variables and does an http requestpart3: Creates an AP and wifi provisioning portal, once you enter the credentials on the portal it does an http requestpart4: Reads the sensor values and send them via mqtt (it doesnt have wifi provisioning)part5: Likepart4but with wifi provisioningpart6: Adds a small ota example topart5