Description
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
Environment
- Development Kit: ESP-01
- IDF version: d48c4c1
- Development Env: Make
- Operating System: Ubuntu
- Power Supply: USB, AC-DC supply, tested with Battery too
Problem Description
TLDR: Many ESP8266 modules that work with NonOS SDK 2.2.x, don't work with RTOS SDK, until touching the chip. Asking to investigate internal RF parameters changes since that NonOS version.
Recently we found that some ESP-01 modules just wouldn't connect (prusa3d/Prusa-Firmware-Buddy#2303). Extensive testing included: speed changes (clock, flash freq, serial baudrate), flash parameters (qio/dout/etc), network changes (all parameters), power supply changes, erasing flash, etc. Prusa devs arranged a spreadsheet to annotate which modules work (spreadheet).
- The problem replicates with the bare RTOS SDK example "getting started/station". Simply running that example and audibly pinging from a computer
ping 192.168.1.11 -a -i 0.1
made evident that the connection only works when touching the module. The ping stops when removing the finger, and resumes instantly when touching the chip. - Exact setup using Arduino example, and also Platformio example, which rely on NonOS SDK 2.2.x, makes the same module perform flawlessly. So it's not a hardware issue.
Found that many projects are still using an old version of NonOS SDK because of connectivity problems esp8266/Arduino#6724. Moreover, @d-a-v and @Aircoookie pointed out it depends on hardware esp8266/Arduino#5736 (comment) and esp8266/Arduino#5784 (comment), fixed by using NonOS SDK 2.2.x.
Then found a discussion by @TD-er where he also noticed the module would work while touching it esp8266/Arduino#8163. He pointed to the RF calibration & antenna tuning, so I investigated the initialization routine and found some differences (see below). However, I have not been able to solve the problem by changing any RF parameters. Let me know your suggestions or any more testing needed.
Extra info
In case it was related to floating GPIO, also tested PRs #1071, #1024. Or to a rogue timer also tested #1102. Or SPI issues also tested #1128. They work but made no difference here :-/
Tried changing RF parameters. From Arduino to RTOS, there are a few changes in RF initialization:
- this byte is an 8 instead of 0 (RTOS SDK). Tried changing it.
- TX power settings have slightly different values. Tested this too.
rf_cal_use_flash
is the same (1) in arduino and RTOS. I've also tried setting it to 3 to force full RF calibration.freq_correct_en
is the same (0) in arduino and RTOS. I've also tried setting it to 1 and 3, to allow frequency correction as suggested by @TD-er.
Expected Behavior
Regular ping responses with ping 192.168.1.11 -a -i 0.3
Actual Behavior
No connection, no ping responses. It only works while keeping a finger on top of the ESP8226 chip.
Exact setup, compiling with NonOS SDK 2.2.x, works flawlessly.