Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By danbicks
#16290 Thanks buddy,

Are you using the later Arduino IDE tweaks, I.E. SDK 1.0 Version?

I get a compile error:

volatile IO_REG_TYPE *basereg;

Like the hacked Solar unit :) Yep these units are not what they say on the tin lol.

Cheers Dans
User avatar
By torntrousers
#16293
danbicks wrote:Thanks buddy,

Are you using the later Arduino IDE tweaks, I.E. SDK 1.0 Version?

I get a compile error:

volatile IO_REG_TYPE *basereg;

Like the hacked Solar unit :) Yep these units are not what they say on the tin lol.

Cheers Dans


Actually, that sketch i posted is the wrong one and includes reading from a temperature sensor, and i think that error you get is from the OneWire library - you've probably got OneWire in your Arduino libraries folder so its using that instead of the one modified for ESP8266, and thats where the error comes from. But as this isn't about the temperature sensor just delete all that stuff -
Code: Select all#include <ESP8266WiFi.h>
extern "C" {
  #include "user_interface.h"
  uint16 readvdd33(void);
}

const char* ssid = "BTHub5-72W5";
const char* password = "xxx";

const char* host = "data.sparkfun.com";
const char* streamId   = "EJ2omGv548HjV6mx3Njp";
const char* privateKey = "xxx";

const unsigned long SLEEP_INFTERVAL = 5 * 60 * 1000 * 1000; // 1 minutes
//const unsigned long SLEEP_INFTERVAL = 20 * 1000 * 1000; // 20 sec

float vdd;

void setup() {
 
  vdd = readvdd33() / 1000.0;

  Serial.begin(115200);
  Serial.println();

  Serial.print("Vdd: ");
  Serial.println(vdd);

  initWifi();

  sendHello();

  Serial.print("up time: ");
  Serial.print(millis());

  Serial.print(", deep sleep for ");
  Serial.print(SLEEP_INFTERVAL / 1000000);
  Serial.println(" secs...");
  system_deep_sleep_set_option(1);
  system_deep_sleep(SLEEP_INFTERVAL - micros()); // deep sleep for 15 minutes minus how long this reading was up for

  delay(1000);
}

void loop() {
   // should never get here
}

void sendHello() {
  Serial.print("connecting to ");
  Serial.println(host);
 
  WiFiClient client;
  const int httpPort = 80;
  while (!client.connect(host, httpPort)) {
    Serial.println("connection failed, retrying...");
  }

  String url = "/input/";
  url += streamId;
  url += "?private_key=";
  url += privateKey;
  url += "&vdd=";
  url += vdd;
 
  Serial.print("Requesting URL: ");
  Serial.println(url);
 
  client.print(String("GET ") + url);
  client.print(String(" HTTP/1.1\r\n") +
               "Host: " + host + "\r\n" +
               "Connection: close\r\n\r\n");
  delay(10);
 
  while(client.available()){
    String line = client.readStringUntil('\r');
    Serial.print(line);
  }
 
  Serial.println();
  Serial.println("closing connection");
  client.stop();
}

void initWifi() {
   Serial.print("current connect:{ ");
   Serial.println(WiFi.SSID());
   if (strcmp (WiFi.SSID(),ssid) != 0) {
      Serial.print("Connecting to ");
      Serial.println(ssid);
 
      WiFi.begin(ssid, password);
      wifi_station_set_auto_connect(true);
 
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
      }
  }

  Serial.println("");
  Serial.print("WiFi connected in: "); 
  Serial.println(millis());

  Serial.println();
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}
User avatar
By torntrousers
#16829 More battery powered fun...

The solar powered one is done now. I mean really done. I was checking it with a multimeter and the power connections slipped off and i reconnected them the wrong way around. There was a little smoke. It doesn't work now. But it ran for almost a week and the graph - http://imp.guru/f7z - shows the battery voltage went up not down, and its not been very sunny and its position was only in direct sun for a few hours a day anyway, so i think those £8 solar power packs could be a good thing to try for a long term power supply for sunlit position.

The 2 x AA cells one is still running - http://imp.guru/f7y. The battery voltage dropped about 0.16v in 3 days so if the ESP can keep working down to around 2.4v it might last for just over 2 weeks.

I saw a blog post where someone used a couple of CR2450's with an ESP8266. Skeptical they would work but i saw some of those button cells for sale so bought some to give it a try. Flashed an ESP-12 with the send vdd then sleep for 15 minutes sketch and connected up one CR2450 while it was still connected to the ftdi so i could see what was happening on serial monitor. It just crashed right away. Added a 4700 microfarad capacitor, still crashed. Added another CR2450 in parallel - it works!

Here it is, publishing to: http://imp.guru/f85

Place you bets on how long it lasts for ...

The button batteries blog post reminded me i had a little 120mAh LIPO cell in a box somewhere. So i've also hooked that up to an ESP-12 to see how long it goes for, publishing here: http://imp.guru/f84

No idea why its started off for a day saying the voltage was 4.9v, a multimeter was showing just 4.12v. But it seems to be going ok and after a day a multimeter showed 3.9v and now its staying within about 0.1v of what a multimeter shows.

Those little LIPO batterers are really cheap too, 80 pence on aliexpress if you buy 10.
You do not have the required permissions to view the files attached to this post.