Mabez
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    ## esp-rs esp32s3 training help Drop questions down below on a new line and check back for answers & help. # Questions ## Flashing error × Communication error while flashing device ╰─▶ Timeout while running WriteReg command I've tried different cables, checking my serial port, I'm getting the same error on two different computers (linux and M1 mac) - What cargo-espflash version are you using? > cargo-espflash 1.5.1 - Try updating to `1.7`: `cargo install cargo-espflash --force` - That fixed it! Thanks! ## Monitoring withouth flashing If you only want to open a serial monitor withouth reflashing the board you can run `cargo espflash monitor /dev/SERIAL_DEVICE` - If no serial device is specified, `cargo-espflash` will list the available targets, so you can choose from the list. ## Project ``` git clone -b esp32s3 git@github.com:SergioGasquez/espressif-trainings.git ``` ## cfg.toml editing When changing values in cfg.toml, must one `cargo clean` afterward for the changes to be picked up by a `cargo build`? - I think this might be the case, can't hurt to do a clean build if its not picking up the new details - ~~It shouldn't be required to clean to pick up `cfg.toml` changes (the `build.rs` exists for our `http-client` crate, but doesn't emit any rerun-if-changed statements, so cargo defaults to considering all files within the crate to be relevent for a rebuild, and will rebuild things when it sees file timestamps change).~~ (except I overlooked that cfg.toml is in the gitignore, so it won't be considered as long as one has a valid git repo. `touch main.rs` is enough to get a rebuild though, no need to clean) - Just ran a quick test, no `cargo clean` is required. I built a simple project which prints the SSID, flashed it, changed the `cfg.toml`, flashed again with no cleaning and the modification of the `cfg.toml` was shown. I asked because I built the project, flashed it, and was told "Error: missing WiFi name." Then I updated cfg.toml with my wifi SSID/password, rebuilt the project, reflashed it, and was told the same thing. Then I `cargo clean`-ed, rebuilt and flashed the project, and it didn't give me that error. ## The http server exercise doesn't build - Remove any reference to the temperature sensor, the s3 devkit doesn't have one - sorry we forgot to remove it before hand! - ## HTTP Server typo [The instructions to run the example](https://espressif-trainings.ferrous-systems.com/03_4_http_server.html#setup) have a small typo, a missing "r" at the end of `http_server`. It should be: ``` cargo espflash --release --example http_server --monitor $SERIALDEVICE ``` ## HTTP Server troubleshoot ### Implementation of `FnOnce` is not general enough Any tips for troubleshooting this compilation error: ```rs server.set_handler("/", Method::Get, |request, response| { Ok(()) })?; ``` ``` error: implementation of `FnOnce` is not general enough --> src/main.rs:40:5 | 40 | / server.set_handler("/", Method::Get, |request, response| { 41 | | Ok(()) 42 | | })?; | |______^ implementation of `FnOnce` is not general enough | = note: closure with signature `fn(esp_idf_svc::http::server::EspHttpRequest<'2>, esp_idf_svc::http::server::EspHttpResponse<'_>) -> Result<(), HandlerError>` must implement `FnOnce<(esp_idf_svc::http::server::EspHttpRequest<'1>, esp_idf_svc::http::server::EspHttpResponse<'1>)>`, for any lifetime `'1`... = note: ...but it actually implements `FnOnce<(esp_idf_svc::http::server::EspHttpRequest<'2>, esp_idf_svc::http::server::EspHttpResponse<'_>)>`, for some specific lifetime `'2` ``` I change the original suggestion of `server.set_inline_handler()` to `server.set_handler()` since this method doesn't seem to exist? - Using `.handle_get()` from the [book](https://espressif-trainings.ferrous-systems.com/03_4_http_server.html) seems to work for me. - I have had success with `handle_get()` as well. - Looking at type signatures, I'd guess that something about type coercion of the closure makes `handle_get()` work while `set_handler()` is unhappy. Joe: I'll give a +1 to the suggestion to use `handle_get`. I was also following the guidance in the code and tripped, but following the guidance in the book entry set me on the path to success. ### Missing Wifi name I am getting this error when trying to run the skeleton code in intro/http-server. ``` I (319) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM I (326) spi_flash: detected chip: generic I (330) spi_flash: flash io: dio I (335) sleep: Configure to isolate all GPIO pins in sleep state I (341) sleep: Enable automatic switching of GPIO sleep configuration I (349) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. Error: missing WiFi name ``` If I copy/paste the same code in the intro/http-client folder I am able to run it. Any resolution? Resolved by changing the crate name. Copy/paste error. - Check the section name in your `cfg.toml` file. The text in the `[]` square brakets. It needs to match the crate name in the `Cargo.toml` ### Alternative to a temp sensor I declared an identifier named `counter` in the main function, and implemented a hit counter at `/counter`. It forced me to deal with shared mutable data much like the temp sensor would have. ## MQTT publish troubleshoot Joe: I tried using an empty `Vec<u8>` for the payload, and found that I was getting an apparent crash and reboot. Switching to an empty slice per the example fixed this. Why? - I think this maybe because an empty Vec may not have any data associated with it. Internally within the Mqtt client it uses to slice pointer to calculate the length of the message (this is happening in esp-idf side of things). I believe someone has already submitted a fix here: https://github.com/esp-rs/esp-idf-svc/issues/146 but isn't included in the version we're using for the training. ## Wokwi - [Rust on ESP](https://wokwi.com/rust) - Some exercise from the training (for esp32c3) are also available: - [intro/hardware-check](https://wokwi.com/projects/334080865809203794) - [intro/http-client](https://wokwi.com/projects/333372159510446675) - [intro/http-server](https://wokwi.com/projects/334083021941506642) - [intro/mqtt](https://wokwi.com/projects/333374379294458451) - [GDB Debugging](https://docs.wokwi.com/gdb-debugging)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully