Open mavishak opened 3 years ago
08.02.2021: SSID - It seems that it is the local WiFi name Firebase API keys - How to reach Firebase API keys and other information console -> select project name -> Project Overview -> gear -> Project Settings
12.02.2021: AT_RST works after that stuck in while loop of AT+CWJAP !TODO: Need to debug Note: DO NOT PUT NULL AS FAIL DEFAULT - causes problems
AT+CWMODE in regular run results in the next output:
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x40100000, len 27728, room 16
tail 0
chksum 0x2a
load 0x3ffe8000, len 2124, room 8
tail 4
chksum 0x07
load 0x3ffe8850, len 9276, room 4
tail 8
chksum 0xba
csum 0xba
âîp
ò
When running in Debug mode all seems fine
18/02/2021:
We managed t connect to "open weather map" API and get Londons weather 🥇 There is a problem with the AT+RST command that we must solve. And we need to find a refind way to deal with server responses once we know what the firebase response looks like.
This is what happens as of now: When debugging - everything seems to run fine... In run mode: AT+RST causes the output to be:
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x40100000, len 27728, room 16
tail 0
chksum 0x2a
load 0x3ffe8000, len 2124, room 8
tail 4
chksum 0x07
load 0x3ffe8850, len 9276, room 4
tail 8
chksum 0xba
csum 0xba
âîp
ò
When commenting out AT+RST the output is:
AT+CWMODE=1
OK
AT+CWJAP="SSID","PSW" WIFI CONNECTED WIFI GOT IP
OK
AT+CIPSTART="TCP","api.openweathermap.org",80 CONNECT
OK AT+CIPSEND=115
OK
busy s...
Recv 115 bytes
SEND OK
BUFFER_OVERFLOW name":"London","cod":200}CLOSED AT+CIPCLOSE
ERROR
Notes:
We think AT+RST is important because in some cases when the program got stuck it helped reboot it, and it looks like we need it from examples online.
After a few runs, we understood that we need to wait for a response before ending the connection
The buffer overflow occurs because the response length is sometimes longer than the buffer size - you can see still see the end of the response after resetting the buffer.
It seems that AT+CIPCLOSE fails because the TCP connection is closed by the server right after sending a response. We think this happens because we are using HTTP 1.0 (that allows sending only one request to a server at a time)
This chain of comments will serve the purpose of connecting the STM32 and Firebase.
Links and documents we have found useful: esp8266_at_instruction_set_en.pdf esp8266_at_command_examples_en.pdf Technical Document | Espressif Systems ESP8266-Firebase-AVR-ThingSpeak