mavishak / cnss-embedded

1 stars 0 forks source link

Sending HTTP request from STM32 to Weather API via ESP8266 #14

Open mavishak opened 3 years ago

mavishak commented 3 years ago

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

mavishak commented 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

mavishak commented 3 years ago

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

mavishak commented 3 years ago

Problem with AT command

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

mavishak commented 3 years ago

18/02/2021:

Bottom Line

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.

In Detail

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: