-
Notifications
You must be signed in to change notification settings - Fork 3k
Enable json overriding ESP8266 default baud rate #11302
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
Enable json overriding ESP8266 default baud rate #11302
Conversation
This should fix #11300 (same as url reported above) |
@desmond-blue, thank you for your changes. |
Thanks for the PR @desmond-blue ! @VeijoPesonen , what do you think? |
It would make sense to add entry to mbed_lib.json and define there the default baudrate. |
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.
Please use mbed_lib.json instead
@@ -33,7 +33,9 @@ | |||
|
|||
#define TRACE_GROUP "ESPA" // ESP8266 AT layer | |||
|
|||
#ifndef ESP8266_DEFAULT_BAUD_RATE |
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.
Modify https://github.com/ARMmbed/mbed-os/blob/master/components/wifi/esp8266-driver/mbed_lib.json
to have one extra config like:
"baudrate": { "help": "Baudrate for ESP8266, defaults to 115200", "value": 115200 }
Then in code you can use "MBED_CONF_ESP8266_BAUDRATE" instead of defining "ESP8266_DEFAULT_BAUD_RATE"
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.
To avoid confusion perhaps this config could be called uart_baudrate
or serial_baudrate
, to avoid an impression that this directly influences the WiFi communication speed, which might be a primary interest of many users.
I realize that the serial baudrate in fact throttles the module's communication speed, but I think we should be specific with the naming, whenever we can afford it :).
Could this override setting go in the same area as the ESP8266 tx and rx pin settings to keep things nice and tidy? Perhaps an update on the ESP8266 firmware update page would be an idea, I have been using the ESP8266 at 921600 on all targets above 100Mhz for some months now, its a considerable speed improvement even without hardware control. |
ab76025
to
77d403b
Compare
Really appreciate the comments, I've modified it accordingly, would you review it again? Thanks. |
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.
Thanks, @desmond-blue , that's exactly what I meant :)
CI started |
CI started |
Test run: FAILEDSummary: 3 of 11 test jobs failed Failed test jobs:
|
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Has this fix been merged with the latest Mbed-os (online version 5.14) yet? |
Hi @star297 , yes, it is available in mbed-os 5.14. Online version should be just the same. This diagnosis is just my blind guess. If I guessed wrong and you still get "no luck", please provide your mbed_app.json file and a more detailed description of the exact error you are getting (such as compilation output. I am sure we'll work it out :) . |
Hi Michal, yes, I have that set to serial-baudrate but not working, if you scroll down to the bottom of my question you will see the the mbed_app.json file in detail. https://os.mbed.com/questions/86806/How-to-change-ESP8266-default-WiFi-baud-/ It may simply be I have that in the wrong section. Terminal output: Mbed OS version 5.13.4 [NWKH] Connecting to network... That Mbed OS version is a bit odd, I have updated and checked version is 5.14 in the Revision History. (Side tracking, Jimmy Brisson has an issue with his PC clock his entries are always 14 Feb 2017, I do find that a bit confusion when switching revisions.) Compilation output: Warning: L3912W: Option 'legacyalign' is deprecated. |
Sorry, I didn't catch where the mbed_app.json was... To use this option you need to add it like this:
This will configure the baudrate for all targets. You can put it under any of your targets instead (for example under |
I get this compile error: Error: Attempt to override undefined parameter 'esp8266.serial-baudrate' in 'application[*]' |
Are you sure you are compiling for a platform that uses esp8266? I tried it on my setup and compilation for K64F + ESP8266 worked fine... |
mbed-os revision 6691 is the problem, switch to revision 6698 and it does work, I can set the baud rate. However, unfortunately, Mbed's ESP8266 driver is not fast enough to work at 921600, it will connect but struggles handling HTTPS, but it does work fine at 460800 which is a vast improvement over 115200. I have also tried this: Thank's for your time Michal :) |
Description
Got a question here about configuring ESP8266_DEFAULT_BAUD_RATE in mbed_app.json, I think a small modification is able to achieve that.
Pull request type
Reviewers
Release Notes