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

Determine which baud rates work well across platforms (Mac, Windows, Linux) (i.e. "baud rate 1552000 does not work") #5

Open
zjc17 opened this issue Feb 17, 2021 · 24 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@zjc17
Copy link

zjc17 commented Feb 17, 2021

Hardware: NodeMCU ESP32 version

Connecting.....
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: a8:03:2a:68:69:bc
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 1552000
Changed.
Configuring flash size...

A fatal error occurred: Failed to write target memory. Only got 1 byte status response.
make: *** [flash] Error 2

@StevenMHernandez
Copy link
Owner

Have you tried any other baud rates? Does flashing the esp32 work in general?

@zjc17
Copy link
Author

zjc17 commented Feb 18, 2021

Have you tried any other baud rates? Does flashing the esp32 work in general?

baud rate 115200 works and other buad rates can be used to flash but the output is wrong, even if I've set the same rate to read the serial port...

@StevenMHernandez
Copy link
Owner

To help solve this, I need more information. I need to know more details about the problem including what steps you tried to solve the issue (Did you find anybody else with a similar problem with the esp32?). From my perspective, I am looking at the problem blind. You mention that the output is "wrong", but there are many ways that the output could be wrong.
What is wrong about the output with baud rate of 115200?

Thanks.

@zjc17
Copy link
Author

zjc17 commented Feb 21, 2021

To help solve this, I need more information. I need to know more details about the problem including what steps you tried to solve the issue (Did you find anybody else with a similar problem with the esp32?). From my perspective, I am looking at the problem blind. You mention that the output is "wrong", but there are many ways that the output could be wrong.
What is wrong about the output with baud rate of 115200?

Thanks.

It works when I use baud rate of 115200.
But for other baud rates, the output is garbled, it should be that the baud rate setting does not take effect, causing the encoding and parsing error

@StevenMHernandez
Copy link
Owner

Oh ok. We have been seeing this issue. Do you happen to use a windows computer? I am unable to test with windows myself. Can you try with a baud rate of 1500000 and report back? Alternatively, try 1000000.

@roger-
Copy link

roger- commented Feb 22, 2021

1552000 failed for me too during flashing (in Ubuntu):

Running stub...
Stub running...
Changing baud rate to 1552000
Changed.
Configuring flash size...

A fatal error occurred: Timed out waiting for packet header

I assumed at first you meant 115200 (which does work).

@StevenMHernandez
Copy link
Owner

On linux, I have tried 1500000 and it seems to work. If this is true (maybe you can confirm?), I should update the readme to match.

@roger-
Copy link

roger- commented Feb 22, 2021

Nope, same issue.

Any reason for the higher baud rate? It flashes and runs with 115200 (but I'm having other issues getting CSI data).

@StevenMHernandez
Copy link
Owner

Higher baud rate is useful to allow more data through serial. More data throughput ensure that CSI frames aren't dropped due to buffer overflow issues. (In general this translates to: higher baud rate means more CSI throughput as discussed in our paper http://www.people.vcu.edu/~ebulut/wowmom20-WiFiSensing.pdf)

How many places did you set the baud rate? There should be 3 distinct places in make menuconfig where you set this value.

Are you sure the time out is not related to you needing to press and hold the "FLASH" button. Some ESP32s require this extra step (https://randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/)

@roger-
Copy link

roger- commented Feb 23, 2021

I think I set the baud in all the right places. My dev board flashes correctly at other rates, not sure if it that issue is baud dependent.

I also just upgraded to the latest IDF because I was getting a weird message before (wpa: PTK has been installed, it may be an attack) that might be a bug in the recommended IDF.

@StevenMHernandez
Copy link
Owner

Actually when I was using the higher baud rate on Linux, I was using stty (as allowed here: /~https://github.com/wertarbyte/coreutils/blob/master/src/stty.c#L1772). But maybe it won't work with the ESP-IDF. You can try one of the lower values until it works: 1152000, 921600, and 576000 are good candidates I think

I don't know about the PTK thing. What version of IDF did you upgrade to?

@roger-
Copy link

roger- commented Feb 23, 2021

Thanks I'll give it another shot and see.

I upgraded to the latest stable version (4.1). The changes were trivial, think I just had to comment out an include statement.

The PTK thing might have been related to a KRACK mitigation bug, I read. Might not have been necessary to upgrade though.

@zjc17
Copy link
Author

zjc17 commented Feb 23, 2021

One more thing...
The packet rate is at about only 25 every second, even if I commented on the delay part in sockets_component.h.
I used the default csi output format to write into the serial port.
Is it caused by the low baud rate or other reason ( I'm not good at ROS development and thanks for your help again

@StevenMHernandez
Copy link
Owner

@Jiachen-Zhang You are correct. You will need high baud rate for high packet rate. Your welcome, I am glad you are working with my tool :)

@zjc17
Copy link
Author

zjc17 commented Mar 1, 2021

I was able to change the different baud rate by keep
Serial flasher config > 'make monitor' baud rate be 115200 and then successfully flash into it!

I think I can use make monitor after flashing and with changeing this parameter (As I read the serial port by python with the same baud rate 921600

@StevenMHernandez StevenMHernandez added the documentation Improvements or additions to documentation label Jul 29, 2021
@StevenMHernandez
Copy link
Owner

I need to figure out what baud rate works best across platforms. It sounds like 921600 worked in this case, but will other people have problems with that?
After figuring out a better baud rate, the documentation should be updated to reflect the new value.

@StevenMHernandez StevenMHernandez changed the title baud rate 1552000 does not work Determine which baud rates work well across platforms (Mac, Windows, Linux) (i.e. "baud rate 1552000 does not work") Aug 11, 2021
@merkurer
Copy link

merkurer commented Oct 4, 2022

hi everyone. can someone contact me from instagram for this project. i need help and i have some questions. I am computer engineering student and i want to work with csi data. i have an esp-wroom-32 device. I followed all the instructions but i couldn't flash.
Instagram: merkurer

@xiaokangkang6
Copy link

Higher baud rate is useful to allow more data through serial. More data throughput ensure that CSI frames aren't dropped due to buffer overflow issues. (In general this translates to: higher baud rate means more CSI throughput as discussed in our paper http://www.people.vcu.edu/~ebulut/wowmom20-WiFiSensing.pdf)

How many places did you set the baud rate? There should be 3 distinct places in make menuconfig where you set this value.

Are you sure the time out is not related to you needing to press and hold the "FLASH" button. Some ESP32s require this extra step (https://randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/)

Excuse me, which three places, I only see two places to fill in 1552000.

@StevenMHernandez
Copy link
Owner

StevenMHernandez commented Jan 15, 2023

@xiaokangkang6 I think the information from that message is old (the message was from 2021). In the current version of esp-idf, it should only be two places. You are correct. Please see (/~https://github.com/StevenMHernandez/ESP32-CSI-Tool/#configuration-esp-idf)

I will also mentioned that the old method was make menuconfig and the current method is idf.py menuconfig.

@satya2891
Copy link

@StevenMHernandez

  1. How to reduce the number of packets recieved?
  2. By changing the tickrate it affects the packets recieved?
    Can u pls clarify this.
    Currently I am getting at around 1000 packets / min. I want to reduce it to 100 - 200.

@mtijan
Copy link

mtijan commented Mar 8, 2024

@StevenMHernandez

hai, i can not found this
Component config > Common ESP32-related > Channel for console output > Custom UART

i just find
Component config > Common ESP-related >

there is something wrong or not i don't know, but i use
version (v4.4) of ESP-IDF.

@mtijan
Copy link

mtijan commented May 13, 2024

i'm know what is problem, but i've question, how do I set the sample rate for esp32, is it by changing the

Component config > FreeRTOS > Tick rate (Hz) > 1000

thanks

@Ash96wani3
Copy link

i'm know what is problem, but i've question, how do I set the sample rate for esp32, is it by changing the

Component config > FreeRTOS > Tick rate (Hz) > 1000

thanks

did you got it ? same issue this side

@mtijan
Copy link

mtijan commented Feb 18, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants