Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By polymorph2
#5872 I tried to compile your sourcecode with the gcc-toolchain and SDK 0.9.2. It does compile, but program does not work on the esp8266. I cannot connect to any service requiring encryption. However, your binaries enable me to connect to google's smtps service. So I guess it's a problem of the libs in the SDK. Would you be so kind and tell us which SDK and which toolchain you use.

Best regards

polymorph
User avatar
By turconi
#5900 hi polumorph ...

The version of AT software is 0.20 and the SDK is 0.9.3 the at+cipstartssl is only for ssl connection not for connection that not requery ssl encryption .... for this connection you must use at+cipstart command ... if you need the complete project I can attach this here the next time....

Best regards

Asimov
User avatar
By polymorph2
#5907 Thanks for your kind reply. Of course, CIPSTART+SSL is only for ssl connections.

I will try to compile it against the SDK 0.9.3, but the complete project would definitely help. How do you compile it? Do you use the virtual machine with provided by expressif? I checked the source code in the IoT example for the ssl stuff. espconn_secure_connect is basically a wrapper for espconn_ssl_client. Is there any reason why you preferred the latter to the former in your code?
User avatar
By polymorph2
#5945 Still no success. Your binary works perfectly with gmail's smpts. I ran it on esp8266 and removed the empty lines:
Code: Select allready
AT+CWMODE=1
OK
AT+CWJAP="#############","#################"
OK
AT+CIPMUX=1
OK
AT+CIPSTART=1,"TCP","google.com",80
1,CONNECT
OK
AT+CIPSEND=1,6
> bad
busy s...
SEND OK
+IPD,1,1430:HTTP/1.0 400 Bad Request
Content-Type: text/html; [shortened]
OK
1,CLOSED
OK
AT+CIPSTARTSSL=2,"TCP","64.233.186.108",465
2,CONNECT
OK
+IPD,2,52:220 mx.google.com ESMTP w9sm19933661qab.18 - gsmtp
OK
AT+CIPSEND=2,6
> QUIT
busy s...
SEND OK
+IPD,2,57:221 2.0.0 closing connection w9sm19933661qab.18 - gsmtp
OK
2,CLOSED


While the firmware I compiled from your source (using SDK 0.9.3) freezes when I connect:
Code: Select allready
AT+CWMODE=1
OK
AT+CWJAP="##############","###################"
OK
AT+CIPMUX=1
OK
AT+CIPSTART=1,"TCP","google.com",80
1,CONNECT
OK
AT+CIPSEND=1,6
> bad
busy s...
SEND OK
+IPD,1,1430:HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8 [shortened ......................]
OK
1,CLOSED
OK
AT+CIPSTARTSSL=2,"TCP","64.233.186.108",465
at
busy p...
at
busy p...


I played around with the functions espconn_ssl_client/espconn_secure_connect in my own programs. There the same problem occurs. The esp freezes when espconn_ssl_client or espconn_secure_connect is called. Whether I include "ssl/app/espconn_ssl.h" and "ssl/app/espconn_secure.h" or not, it makes no difference. I use the gcc and link against the following libs:
LIBS = c gcc hal pp phy net80211 lwip wpa main ssl upgrade
At the moment, I have no idea on how to proceed.