With help from @Juraj I've managed to get my Mega 2560 to connect with the on board ESP8266. I've flashed the ESP8266 with Jiri Bilek's firmware as I need to connect to an API using TLS1.2. I think the Flashing has worked as the ESP8266 firmware is showing 1.7.0 whereas I think it was 1.7.5 before.
My first problem seems to be connecting with the WiFi. I've run the SetupPersistentWiFiConnection sketch and that has successfully connected to my WiFi. I then run the WiFiSSLClient sketch but it doesn't connect to the WiFi.
I'll have another go tomorrow but for now I thought I'd open a thread to get some tips for what to look for.
Below is the Serial monitor output. The first half is output from the Setup sketch and the second half is from the WiFiSSLClient sketch.
Attempting to connect to SSID: KE Net
Connected to WiFi network.
SSID: KE Net
BSSID: [redacted]
MAC: [redacted]
IP Address: 192.168.15.14
signal strength (RSSI):-75 dBm
Waiting for connection to WiFi
......................................................................Waiting for connection to WiFi
....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
I ran SetupPersistentWiFiConnection several times after replacing the firmware with Jiri's.
Attaching a pic of my tools menu settings.
I only changed Serial1 to Serial3 in the sketch.
Oh, all I did when flashing JB's firmware was to switch the Tools > Board setting to Generic ESP8266 Module, (see below). I think switched the Tools > Board back to "Arduino Mega or Mega 2560" and ran the WiFiEspAT example sketches.
I changed the Flash size to 4mb (FS 1mb), and reuploaded the firmware. I then switched the Arduino Tools back to Arduino Mega and ran SetupPersisterntWifiConnection. The connection was successful so I can the WiFiSSLClient sketch but once again no connection.
Executable segment sizes:
ICACHE : 32768 - flash instruction cache
IROM : 425420 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 27873 / 32768 - code in IRAM (IRAM_ATTR, ISRs...)
DATA : 1716 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 3540 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 28296 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 458549 bytes (43%) of program storage space. Maximum is 1044464 bytes.
Global variables use 33552 bytes (40%) of dynamic memory, leaving 48368 bytes for local variables. Maximum is 81920 bytes.
esptool.py v3.0
Serial port COM5
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 40:f5:20:28:93:03
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 462704 bytes to 338215...
Writing at 0x00000000... (4 %)
Writing at 0x00004000... (9 %)
Writing at 0x00008000... (14 %)
Writing at 0x0000c000... (19 %)
Writing at 0x00010000... (23 %)
Writing at 0x00014000... (28 %)
Writing at 0x00018000... (33 %)
Writing at 0x0001c000... (38 %)
Writing at 0x00020000... (42 %)
Writing at 0x00024000... (47 %)
Writing at 0x00028000... (52 %)
Writing at 0x0002c000... (57 %)
Writing at 0x00030000... (61 %)
Writing at 0x00034000... (66 %)
Writing at 0x00038000... (71 %)
Writing at 0x0003c000... (76 %)
Writing at 0x00040000... (80 %)
Writing at 0x00044000... (85 %)
Writing at 0x00048000... (90 %)
Writing at 0x0004c000... (95 %)
Writing at 0x00050000... (100 %)
Wrote 462704 bytes (338215 compressed) at 0x00000000 in 29.8 seconds (effective 124.2 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
I tried the same on my second board but I get the same result.
I had set the Serial switch to TX0 and Dip switches to OFF-OFF-OFF-OFF-ON-ON-ON when uploading JBs firmware and then back to TX3 and Dip switches to ON ON ON ON OFF OFF OFF when uploading the Arduino sketches.
Hi,
I have stayed on the old core for a long time not wanting to test the app over and over. "If it ain't broken, don't fix it"
But now, I suppose, the Arduino 8266 Core 3.x is stable and reliable enough and just yesterday I started to migrate the ESPAT app.
The changes will be first posted to a separate branch. There is also an issue related to this (Migration to Arduino Core 3.x · Issue #23 · JiriBilek/ESP_ATMod · GitHub), please feel free to post your comments and recommendations there.
Thanks
Jiri
I tried to send the commands by serial line - with success.
AT+RST
OK
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
Inizializing FS failed.
ERROR
ready
AT+CIPMUX=1
OK
AT+CIPRECVMODE=1
OK
AT+CWMODE?
+CWMODE:1
OK
AT+CIPSTATUS
STATUS:5
OK
AT+CWJAP_CUR="xxxx","xxxx"
WIFI CONNECTED
WIFI GOT IP
OK
AT+CIPSTATUS
STATUS:2
OK
AT+CIPSTART=4,"SSL","api.github.com",443
4,CONNECT
OK
4,CLOSED
Tested on this version:
AT+GMR
AT version:1.7.0.0 (partial)
SDK version:2.2.2-dev(38a443e)
Compile time:Oct 14 2022 13:14:43
Version ESP_ATMod:0.3.6
Arduino core version:2.7.4
@rcx467 could you please do the same and post the result here?
I checked that my AT version, ESP ATMod, and Arduino Core versions match yours and they do. But I don't know where I check the SDK?
I've opened the serial monitor in Arduino IDE to see if I can send the same AT commands and get the same responses. But all I get in response to any AT command is ERROR (see screenshot).