Hello All,
We have recently purchased Tindie Teensy board from https://www.tindie.com/products/cburgess129/arduino-teensy-3-with-wifibluetoothnrf24l01/
I'm using the example code "HTTP GET" provided in the link specified in the same website.
The code works fine for HTTP sites but it shows "301 Moved Permanently" error for HTTPS requests.
So I tried changing its library files for handling https requests but during program compilation it says few header files are missing though the missing header files are already available in the library files.
Please help me out to sort this issue
#include "ESP8266TEENSYNEW.h"
ESP8266 wifi(Serial1 , 115200);
const char* ssid = "xxxx";
const char* password = "xxxx";
const char* hostName = "cmti-iiot.online";
const uint16_t hostPort = 443;
const char* fingerprint = "68 2E AF EC 81 6E 3D F2 70 C7 81 D5 D1 D4 81 77 F6 4C C3 24";
void setup() {
Serial.begin(115200);
delay(10);
Serial.println("setup begin");
Serial.print("FW Version:");
Serial.println(wifi.getVersion().c_str());
if (wifi.setOprToStationSoftAP()) {
Serial.println("to station + softap ok");
} else {
Serial.println("to station + softap err");
}
if (wifi.joinAP(ssid, password)) {
Serial.println("Join AP success");
Serial.print("IP:");
Serial.println(wifi.getLocalIP().c_str());
} else {
Serial.println("Join AP failure");
}
if (wifi.disableMUX()) {
Serial.println("single ok");
} else {
Serial.println("single err");
}
Serial.println("setup end");
}
void loop() {
uint8_t buffer[1024] = {0};
if (wifi.createTCP(hostName, hostPort)) {
Serial.println("create tcp ok");
} else {
Serial.println("create tcp err");
}
if (wifi.createTCP(hostName, hostPort)) {
Serial.println("connected to server");
const char* hello = "GET / HTTP/1.1\r\nHost:cmti-iiot.online\r\nConnection: close\r\n\r\n";
wifi.send((const uint8_t*)hello, strlen(hello));
uint32_t len = wifi.recv((char*)buffer, sizeof(buffer), 10000);
if (len > 0) {
Serial.print("Received:[");
for (uint32_t i = 0; i < len; i++) {
Serial.print((char)buffer[i]);
}
Serial.println("]");
}
if (wifi.releaseTCP()) {
Serial.println("release tcp ok");
} else {
Serial.println("release tcp err");
}
delay(1000);
}
}
Google drive link for the header files