Good afternoon all
I tried to get OTA to work on the little 8266 – 01 sometimes it compiles with no errors but other times it comes up with:
15:19:54 [INFO]: Starting on 0.0.0.0:58007
15:19:54 [INFO]: Upload size: 382704
15:19:54 [INFO]: Sending invitation to: 192.168.1.111
15:19:54 [ERROR]: Bad Answer: ERR: ERROR[4]: Not Enough Space
I think I need to tell platformio to increase the memory size, I have had a good poke around Google and tried one or two examples but obviously I’m still doing something wrong.
If I keep an identical code and upload it to a standard 8266 it appears to work fine.
Please can somebody point me in the right direction.
Thank you in advance for your time.
[env:esp12e]
platform = espressif8266
;board = esp07s
board = esp01_1m
;board = esp12e
framework = arduino
;board_build.flash_mode = dout
upload_speed=921600
monitor_speed = 115200
upload_protocol = espota
upload_port=192.168.1.111
lib_deps=
TaskScheduler
sparkfun/SparkFun SHTC3 Humidity and Temperature Sensor Library @ ^1.1.3
ThingSpeak
ESP8266_SSD1306
#include <Arduino.h>
#include "Wifi_Setup.h"
#include "main_Setup.h"
#include <ArduinoOTA.h>
IPAddress ip(192, 168, 1, 111);
IPAddress gateway(192, 168, 1, 254); // Set your network Gateway usually your Router base address
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192,168,1,254);
const char* WLAN_SSID = "BTHub6";
const char* WLAN_PASSWD = "************************";
unsigned long myChannelNumber1 = 1**********So what is it might be;
const char *myWriteAPIKey1 = "**************";
String webpage="";
//long Rssi=0;
int SensorNumber =0;
String UploadData="";
bool rtcValid = false;
//WiFiClient client;
ESP8266WebServer server(80);
//###################### HTML INPUT ##########################################
void Web_Listen(){
server.handleClient();
}
//###########################################################################
//#####################################################################################################
void WiFi_ON(){
WiFi.forceSleepWake();
delay( 1 );
WiFi.config(ip, dns, gateway, subnet);
WiFi.persistent( false ); // Disable the WiFi persistence. The ESP8266 will not load and save WiFi settings unnecessarily in the flash memory.
WiFi.begin(WLAN_SSID,WLAN_PASSWD);
Rssi = WiFi.RSSI(); //Detect and print signal strength
Serial.print("RSSI:");
Serial.println(Rssi);
server.on("/", homepagePL);
server.on("/test", []() {server.send(200, "text/plain", "Server status is OK"); }); // Simple server test by providing a status response
server.on("/homepage", homepagePL);
server.begin();
ArduinoOTA.onStart([]() {
String type;
if (ArduinoOTA.getCommand() == U_FLASH)
type = "sketch";
else // U_SPIFFS
type = "filesystem";
// NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()
Serial.println("Start updating " + type);
});
ArduinoOTA.onEnd([]() {
Serial.println("\nEnd");
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
else if (error == OTA_END_ERROR) Serial.println("End Failed");
});
ArduinoOTA.begin();
Serial.println("Ready");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
//#################################################################################################
void OTA() {
ArduinoOTA.handle();
}
//###################################################################################################
void rssi(){
int xx=0;
Rssi = WiFi.RSSI();
Serial.print("RSSI:");
Serial.println(Rssi);
ThingSpeak.setField(7,Rssi );
xx=ThingSpeak.writeFields(myChannelNumber1, myWriteAPIKey1);
if(xx ==200){
t1_disable();
}
else{
t1_enable();
}
}