logo elektroda
logo elektroda
X
logo elektroda

ESP8266 (ESP12) - how to increase baudrate above 115200?

Pocieszny 3390 16
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16239863
    Pocieszny
    Level 38  
    I have an ESP8266 (ESP12) which has a default baudrate of 115200 . Apparently this is somehow not very little, but I need to transfer relatively large amounts of data, so the faster the better. I found information on the web that up to 4Mbps and more can be achieved. I tried to do this with the command AT+IPR , but I messed up the module. I had to upload new firmware to it to revive it. The command AT+ UART_DEF seems to work, but only when I set the baudrate below the default value. Any higher value (e.g. 256000) causes the chip to send bushes to the terminal. Interestingly, it still seems to understand what I'm sending it at the time and I've managed to reduce the baudrate to the previous value this way.

    I don't know if the above symptoms are the fault of the ESP module or maybe the USB-UART converter (PL2303HX, fake) is not coping. Have any of you managed to achieve any higher speeds than the default 115200?
  • ADVERTISEMENT
  • #2 16240772
    dondu
    VIP Meritorious for electroda.pl
    I have not tried it, but it may be related:

    Quote:
    When real RS232 signaling is not required, baud rates higher than 115200 bps could be used for even higher performance.
    The flexible baud rate generator of PL-2303HXD could be programmed to generate any rate between 75 bps to 12M bps


    http://www.prolific.com.tw/UserFiles/files/ds_pl2303HXD_v1_4_4.pdf
  • ADVERTISEMENT
  • #3 16241233
    Pocieszny
    Level 38  
    I connected the Rx and Tx of the converter and tried to find the limit to which it works. I even set the bitrate in the terminal to 1000000000 (9 zeros) and it still works. This is a bit suspicious, as I doubt such a transfer would go through USB 2.0. The implication is that either the terminal or the driver is cheating. It's probably setting the default baudrate outside the acceptable range. At least this happens when I set it to, say, 10bps. Without an oscilloscope I probably won't know what the upper limit is....

    As a terminal I use this program: https://sites.google.com/site/terminalbpp/
  • #4 16241254
    Anonymous
    Anonymous  
  • #5 16241876
    Pocieszny
    Level 38  
    Piotrus_999 wrote:
    Write a program in c# and see what you get out

    I understand that I am to measure the amount of data sent/received per second? There is a solution to this, I will give it a try.
  • #6 16242218
    funak
    Level 27  
    That doesn't quite capture the point.
    Because how much can be set depends on the ESP of course, but also on the converter.

    E.g. FT232RL
    http://www.ftdichip.com/Products/ICs/FT232R.htm
    you can set max. 3Mbps,

    And such a CH340G
    https://www.olimex.com/Products/Breadboarding/BB-CH340T/resources/CH340DS1.PDF
    You can set max. 2Mbps

    which is exactly what it is:
    CH340 supports common baud rate: 50,75,100,110,134.5,150,300,600,900,1200,1800,2400,3600,4800,9600,14400,19200,28800, 
    33600,38400, 56000,57600,76800,115200,128000,153600,230400,460800,921600,1500000,2000000 and so 
    on. The baud rate error of serial transfer signal is less than 0.3%, and permission baud rate error of serial 
    receive signal is not less than 0.2%. 


    Now back to the topic at hand: ESP what speed can the UART have?
    Here we already find out from:
    http://espressif.com/sites/default/files/documentation/0a-esp8266ex_datasheet_en.pdf

    Quote:
    Data transfers to/from UART interfaces can be implemented via hardware. The data transmission speed via UART interfaces reaches 115200 x 40 (4.5 Mbps). 


    Which means, more or less, that you might be able to establish communications at 1500000 or 3000000 bps already with just the FT232RL.

    So much for theory, but how about in practice?

    Added after 13 [minutes]:

    In practice 921600 I can calmly get on CH340G, unfortunately at 1.5Mbps I failed to establish communication.

    I checked this just now:
    
    
    UART ==> 115 200 bps
    
    [2017-01-31 13:31:44:379_S:] AT+GMR
    [2017-01-31 13:31:44:386_R:] AT+GMR
    
    [2017-01-31 13:31:44:386_R:] AT version:0.60.0.0(Feb  2 2016 18:43:31)
    [2017-01-31 13:31:44:389_R:] SDK version:1.5.2(80914727)
    [2017-01-31 13:31:44:393_R:] compile time:Feb  2 2016 18:59:50
    [2017-01-31 13:31:44:395_R:] OK
    [2017-01-31 13:32:37:913_S:] AT+UART_CUR=921600,8,1,0,0
    [2017-01-31 13:32:37:925_R:] AT+UART_CUR=921600,8,1,0,0
    
    
    [2017-01-31 13:32:37:925_R:] OK
    
    UART ==> 921 600 bps
    
    [2017-01-31 13:32:52:089_S:] AT+GMR
    [2017-01-31 13:32:52:097_R:] AT+GMR
    
    [2017-01-31 13:32:52:097_R:] AT version:0.60.0.0(Feb  2 2016 18:43:31)
    [2017-01-31 13:32:52:097_R:] SDK version:1.5.2(80914727)
    [2017-01-31 13:32:52:097_R:] compile time:Feb  2 2016 18:59:50
    [2017-01-31 13:32:52:100_R:] OK
    


    I used the AT+UART_CUR command here in case something failed and I lost the connection to the ESP, in which case a power restart and we're back to 115200.
  • #7 16242346
    Anonymous
    Anonymous  
  • #8 16242380
    Pocieszny
    Level 38  
    I ordered an adapter on the CH340G chip from allegro today, I will have a comparison. I will try some more with other programs. The target ESP is to work with the STM32F411 microcontroller, but I wanted to do some tests with a computer beforehand - because it's easier. I will also test it on the target chip soon.

    funak wrote:
    AT+UART_CUR

    I had overlooked the existence of this command, and it is very useful.
  • ADVERTISEMENT
  • #9 16242409
    Anonymous
    Anonymous  
  • ADVERTISEMENT
  • #10 16242453
    funak
    Level 27  
    Piotrus_999 wrote:
    And did you think it's not a problem of the adapter but of the lift, or the terminal program? You are drawing conclusions too fast. connect esp to some ARM with fast uart and test > 1M there, otherwise your whole methodology and analysis is not worth much.
    I disagree here, FT232RL as well as FT245RL work above 1Mbps. Verified :) And this is in the form of VCP - Virtual Com Port.
  • #11 16242468
    Anonymous
    Anonymous  
  • #12 16242501
    Pocieszny
    Level 38  
    funak wrote:
    T232RL as well as FT245RL work above 1Mbps

    I wanted to buy one, but on allegro most are fakes that probably work similarly to the infamous PL2303HX.

    Piotrus_999 wrote:
    communication can only be tested with uart <=> uart, not uart <=> adapter <=> driver <=> windows <=> libraries of the language used <=> program

    Right.

    I'm only playing with the adapter for now because I wanted to test the operation of some AT commands, and it's simply easier for me to write them on the fly in the terminal.
  • #13 16242530
    Anonymous
    Anonymous  
  • #14 16242571
    piotrva
    VIP Meritorious for electroda.pl
    Pocieszny wrote:
    I wanted to buy one, but on allegro most are fakes that probably work similarly to the infamous PL2303HX.


    Well then don't buy one for £5, just spend £40 on it. On PW I can give you the contact details of proven adapters with original FT232.

    Besides - you can load the program into the ESP and not play with AT commands ;)
  • #15 16242662
    Pocieszny
    Level 38  
    piotrva wrote:
    the software can be uploaded to the ESP and not play around with AT commands

    Of course you can, but tell me how on an ESP you can handle a memory card, USB OTG, PWM, UART, 1-wire, I²C at the same time and still have some free GPIO pins :)
  • #16 16242800
    jnk0le
    Level 18  
    Pocieszny wrote:
    ...Any higher value (e.g. 256000) causes the chip to send bushes to the terminal. Interestingly, it still seems to understand what I am sending it at the time and I have managed to reduce the baudrate to the previous value this way.

    I don't know if the above symptoms are the fault of the ESP module or maybe the USB-UART converter (PL2303HX, fake) is not coping. Has anyone of you managed to achieve any higher speeds than the default 115200?

    The problem with these fakes is that the working standard baudrates end at 115200 or 230400 (as in the case of the ft232), further on speeds such as e.g. 250k, 500k, 1M, 2M remain.
  • #17 16242880
    piotrva
    VIP Meritorious for electroda.pl
    @funny , very simply - on the ESP I pack all the communication, control of connections, protocols, decoding of received data, their assembly into a logical whole, while to the executive I pack as I like only what I need. E.g. a simple counter - the processor counts the pulses on some GPIO, then sends only a few bytes to the ESP, and the ESP appropriately encodes them and sends them e.g. over TCP/IP or HTTP. The saving even in such a simple transfer over the UART is enormous, because instead of many AT commands, e.g. HTTP headers etc., I send only a few bytes.

    I'm not saying to pack everything onto ESP, because ESP lacks a lot to any uC (timers, interrupts, usb, ...), but by packing dedicated software into ESP we are able to split the project logically as well - ESP takes care of the network and our CPU takes care of the hardware.

    I've done a few projects of this type myself recently - in the last one ESP had a device configuration page over HTTP, the possibility to send data via UDP / TCP/IP (also with TLS protocol) / HTTP(S) - as an HTTP request, in addition ESP could update its own and the processor's software using batch files available on the client's server (I'll add that this is also in safe mode, so that it is not possible to copy the batch). Transmission over the UART - almost none. Doing it on AT commands - I can't imagine.
ADVERTISEMENT