Closed lowercasename closed 2 years ago
please use the 1.7.5 version of the AT firmware for esp8266. the link to it is in the README file
Thank you for the advice! I tried to load 1.7.5 but I'm currently unable to write the firmware due to a problem between esptool and the board which I'm trying to debug.
Do you know what it is in the v2 firmware which could be causing this problem? Perhaps there is a way I could work around it.
try a sketch without String
@lowercasename : as jandrassy cleverly pointed, try replacing Strings objects with char arrays (C-style strings) ..... i had similar problems in the past, and was because String objects eventually EAT ALL THE RAM ...
i wanna share a little replacement table with you, the only caution is c strings are fixed-size (must reserve memory previously) and must terminated with nul
(ascii 0)...
seriously.... c strings are actually arrays of bytes (ascii characters), c string functions detects the end of the char sequence when they find a 0 (the byte value not the ascii character '0'), if you dont terminate you could end reading or overwriting further memory blocks!!... dont overflow or bad things could happen, like server with insufficient ram returning earlier without clients xD
String.func() cstring equivalente
-------------------------------------------
(easy) (hard)
(dynamic size) (fixed size)
(fragments ram) (dont fragments ram)
(heavy library) (low level faint library (part of C))
String str char str[4]
str = "asd" str = {'a','s','d','\0'}
String str = "asd" char str[] = "asd" // auto dimension and terminates
String str char str[max + 1] // plus the final '\0'
str = "asd" strcpy(str, "asd")
strcpy_P(str, PSTR("asd")) // recommended for constants
str.length() strlen(str)
str + s2 strcat(str, s2) // str must have enough space
str.charAt(n) str[n]
str.setCharAt(n, c) str[n] = c
str.indexOf(c) strchr(str, c) - str
str.indexOf(c, n) strchr(str + n, c) - str
str.lastIndexOf(c) strrchr(str, c)
str.indexOf(s2) strstr(str, s2) - str
str.indexOf(s2, n) strstr(str + n, s2) - str
s2 = str.substring(l) strncpy(s2, str, l)
s2 = str.substring(f, l) strncpy(s2, str+f, n)
str.compareTo(s2) strcmp(str, s2)
comparar hasta n strncmp(str, s2, n)
... many more...
... find more string commands here ... if you dont reply maybe you fixed your problem
to update .... one time i didn't have my ftdi, and i used my arduino uno compatible to flash the esp-01s
just load the examples/basic/bare-minimum builtin sketch and connect straight to esp this way (see note below).... you need a 3.3v voltage regulator for esp, DONT CONNECT 3V3 TO 5V OR WILL BURN (however rx+tx are 5v tolerant)
[pc-usb] --> [arduino uno] --> [esp] <-- [regulator (3v3 + gnd)]
arduino esp
-----------------------
pin 0 (uart rx) --- rx
pin 1 (uart tx) --- tx
gnd (any) --- gnd
than you can use your virtual com port from your pc as if were an ftdi ... basically you are replacing the ftdi ft232 usb virtual com chip by an ch341ser usb virtual com chip (or the attiny xxx ?? in case of a genuino) ... you still need the usb virtual com port chip drivers installed on your pc
note below:
with this configuration you actually will bypass the arduino soc cpu (atmega328p), you wont need it in this case, you wont use it, just need the usb serial interface chip... that is because you must load the bare minimum sketch, to make the arduino doing nothing and leave the builtin usb-serial chip unmanaged by the arduino because you need to manage it by your pc through usb to use it like a bridge
I built a simple server using WiFiEspAT, a Challenger RP2040 WiFi board and Earle Philhower's Pi Pico Arduino Core.
The server is reverse proxied behind a larger server and exposed to the Internet.
After a variable amount of time (minutes, not hours), the server seems to simply stop accepting clients. I've tried stress testing the server by refreshing multiple times to try and trigger the behaviour, but am not convinced stress is what makes it stop accepting clients. The
loop()
function continues to run after the server cuts out.Here is my MWE, where this behavior occurs:
Here's some output:
No clients are accepted after that final
GET
, either from the internal IP or the external URL. The server does respond toping
.Am I simply hitting up against a limitation in the WiFiEspAT library? If not, could you recommend some steps to debug or log what is going on? And could this be an issue specifically with the Challenger RP2040 WiFi board?
Edit: AT firmware reported:
Edit: Here's a debugging log of the final two requests before the server stopped accepting clients: https://ttm.sh/i-g.txt