What Setting to get ESP-AT v2.2.1.0_esp8266 to work on ESP-01 ?

User avatar
DataDigger
Posts: 13
Joined: Sun Aug 20, 2017 1:58 am

Re: What Setting to get ESP-AT v2.2.1.0_esp8266 to work on ESP-01 ?

Postby DataDigger » Fri Apr 29, 2022 12:22 am

Today I got the bigger Flash-Devices "W25Q32BVSIG":

Code: Select all

$ esptool.py --port /dev/ttyUSB0 --baud 115200 flash_id
esptool.py v3.3
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: c8:c9:a3:6b:3b:9a
Uploading stub...
Running stub...
Stub running...
Manufacturer: ef
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...
$

$ esptool.py --port /dev/ttyUSB0 --baud 115200 erase_flash
Wohoo it works. Then I changed into ESP8266-AT-V2.2.1.0 folder.

Code: Select all

$ esptool --port /dev/ttyUSB0 write_flash --flash_mode dout --flash_freq 26m --flash_size 4MB 0x8000 partition_table/partition-table.bin 0x9000 ota_data_initial.bin 0x0 bootloader/bootloader.bin 0x10000 esp-at.bin 0xF0000 at_customize.bin 0xFC000 customized_partitions/client_ca.bin 0x106000 customized_partitions/mqtt_key.bin 0x104000 customized_partitions/mqtt_cert.bin 0x108000 customized_partitions/mqtt_ca.bin 0xF1000 customized_partitions/factory_param.bin 0xF8000 customized_partitions/client_cert.bin 0xFA000 customized_partitions/client_key.bin
Took a while, but no errors.

Nicer view:

Code: Select all

$ esptool --port /dev/ttyUSB0 write_flash --flash_mode dout --flash_freq 26m --flash_size 4MB 
0x8000 partition_table/partition-table.bin 
0x9000 ota_data_initial.bin 
0x0 bootloader/bootloader.bin 
0x10000 esp-at.bin 
0xF0000 at_customize.bin 
0xFC000 customized_partitions/client_ca.bin 
0x106000 customized_partitions/mqtt_key.bin 
0x104000 customized_partitions/mqtt_cert.bin 
0x108000 customized_partitions/mqtt_ca.bin 
0xF1000 customized_partitions/factory_param.bin 
0xF8000 customized_partitions/client_cert.bin 
0xFA000 customized_partitions/client_key.bin
But then it does not boot:

Code: Select all

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 6960, room 16 
tail 0
chksum 0x4f
load 0x3ffe8008, len 24, room 8 
tail 0
chksum 0xc6
load 0x3ffe8020, len 3196, room 8 
tail 4
chksum 0x03
csum 0x03
csum err
ets_main.c
What settings need the bigger Flash ?

User avatar
DataDigger
Posts: 13
Joined: Sun Aug 20, 2017 1:58 am

Re: What Setting to get ESP-AT v2.2.1.0_esp8266 to work on ESP-01 ?

Postby DataDigger » Sun May 01, 2022 7:13 am

I got it to work with an old version "AT-Firmware 1.1.0.0" from SDK 1.5.4.

Code: Select all

$ esptool --port /dev/ttyUSB0 write_flash --flash_mode dout --flash_freq 26m --flash_size 4MB 0x000000 boot_v1.5.bin 0x001000 512+512/user1.1024.new.2.bin 0x03fc000 esp_init_data_default.bin 0x07e000 blank.bin 0x3fe000 blank.bin

AT+GMR
AT version:1.1.0.0(May 11 2016 18:09:56)
SDK version:1.5.4(baaeaebb)
compile time:May 20 2016 15:06:44
OK
Woohoo, the Device ist working :D

For 2.2.1.0 with:

Code: Select all

$ esptool --port /dev/ttyUSB0 write_flash --flash_mode dout --flash_freq 26m --flash_size 4MB 0x8000 partition_table/partition-table.bin 0x9000 ota_data_initial.bin 0x0 bootloader/bootloader.bin 0x10000 esp-at.bin 0xF0000 at_customize.bin 0xFC000 customized_partitions/client_ca.bin 0x106000 customized_partitions/mqtt_key.bin 0x104000 customized_partitions/mqtt_cert.bin 0x108000 customized_partitions/mqtt_ca.bin 0xF1000 customized_partitions/factory_param.bin 0xF8000 customized_partitions/client_cert.bin 0xFA000 customized_partitions/client_key.bin
it boots with no errors, but no reaction to a command:

Code: Select all

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 6960, room 16 
tail 0
chksum 0x4f
load 0x3ffe8008, len 24, room 8 
tail 0
chksum 0xc6
load 0x3ffe8020, len 3196, room 8 
tail 4
chksum 0x3a
csum 0x3a
What is wrong ?

amileski
Posts: 1
Joined: Mon Sep 05, 2022 10:49 am

Re: What Setting to get ESP-AT v2.2.1.0_esp8266 to work on ESP-01 ?

Postby amileski » Mon Sep 05, 2022 11:53 am

DataDigger wrote:What is wrong ?

First kudos on getting anything to compile at all. That's a major achievement!

Moving on to your problem ...

Wild guess: you didn't read the manual? ;-)

Espressif changed the default UARTs in v2.0.0 so that they are no longer compatible with ESP-01/01S boards, or most anything else (like the ESP-12E/F, etc.) for that matter.

I suspect they did this so that the firmware couldn't be upgraded easily (or via some exploit), but that is just a wild guess.

So you have to swap the UARTs back to the 'old-style'.

https://docs.espressif.com/projects/esp ... t_pin.html
By default, the ESP32 AT firmware provided by Espressif uses the following UART0 pins to output log:
  • TX: GPIO1
  • RX: GPIO3
By default, UART1 is used to send AT commands and receive AT responses, and its pins are defined in Column uart_port, uart_tx_pin, uart_rx_pin, uart_cts_pin, and uart_rts_pin of the factory_param_data.csv.

You can change them directly in your factory_param_data.csv table:
  1. Open your local factory_param_data.csv file.
  2. Locate the row of your module.
  3. Set uart_port as needed.
  4. Set uart_tx_pin and uart_rx_pin as needed.
  5. Set uart_cts_pin and uart_rts_pin to be -1 if you do not use the hardware flow control function.
  6. Save the table.

The relevant code unabashedly ripped-out of:

https://github.com/espressif/esp-at/blo ... art_task.c

Code: Select all

#elif defined(CONFIG_IDF_TARGET_ESP8266)
#define CONFIG_AT_UART_PORT_TX_PIN_DEFAULT          15
#define CONFIG_AT_UART_PORT_RX_PIN_DEFAULT          13
#define CONFIG_AT_UART_PORT_CTS_PIN_DEFAULT         3
#define CONFIG_AT_UART_PORT_RTS_PIN_DEFAULT         1
#ifndef CONFIG_AT_UART_PORT
#define CONFIG_AT_UART_PORT                         UART_NUM_0
#endif
#define AT_UART_BAUD_RATE_MAX                  4500000
#define AT_UART_BAUD_RATE_MIN                       80


    int32_t tx_pin = CONFIG_AT_UART_PORT_TX_PIN_DEFAULT;	
    int32_t rx_pin = CONFIG_AT_UART_PORT_RX_PIN_DEFAULT;
    int32_t cts_pin = CONFIG_AT_UART_PORT_CTS_PIN_DEFAULT;
    int32_t rts_pin = CONFIG_AT_UART_PORT_RTS_PIN_DEFAULT;


            if ((data[16] != 0xFF) && (data[17] != 0xFF)) {
                tx_pin = data[16];
                rx_pin = data[17];
            }

            if (data[18] != 0xFF) {
                cts_pin = data[18];
            } else {
                cts_pin = -1;
            }

            if (data[19] != 0xFF) {
                rts_pin = data[19];
            } else {
                rts_pin = -1;
            }


    //Install UART driver, and get the queue.
    uart_driver_install(esp_at_uart_port, 1024, 2048, 16, &esp_at_uart_queue, 0);
    if ((tx_pin == 15) && (rx_pin == 13)) {         // swap pin
        uart_enable_swap();
        assert((cts_pin == -1) || (cts_pin == 3));
        assert((rts_pin == -1) || (rts_pin == 1));
    } else {
        assert((tx_pin == 1) && (rx_pin == 3));
    }

If you want a pre-compiled v2.2.0 firmware (read the README.md which also mentions the pin swap):

https://github.com/CytronTechnologies/esp-at-binaries

sigmdel
Posts: 2
Joined: Fri Mar 17, 2023 9:39 pm

Re: What Setting to get ESP-AT v2.2.1.0_esp8266 to work on ESP-01 ?

Postby sigmdel » Fri Sep 08, 2023 11:24 pm

There is no need to compile ESP-AT to install the latest version on an ESP-01S.
Thanks to ustccw who provided the information in a reply to issue 668 on the ESP-AT repository.

More info here: Installing the AT Firmware on an ESP-01S.

Who is online

Users browsing this forum: No registered users and 11 guests