Your Arduino went offline

Costas I’m working on the new hardware (ESP standalone) and discoverd a new problem…

First I did my setup with a Wemos D1 but got alternating temerature readings. I soon discovered it was the ADC reading different values even with fixed voltage at the analog pin. It has a range of around 10 (of 1024) where it dififfers.

Now I thought the board must be messy and took an ESP-12F but that’s even worse, that has a range of around 50 where it differs!

The huge differencies are seldom and look like the Chip is doing something at an interval which interferes with the ADC.

BTW. not using WiFi for now in my sketch…

void setup()
{
  Serial.begin(115200);
}

void loop()
{
  Serial.println(analogRead(0));
  delay(100);
}

Any Idea?
You’re using the Wemos, what about your readings?

The WeMos can only read 3.2V on the analogue pin, the regular ESP’s are limited to 1.0V.

You need to set up a voltage divider for the WeMos / ESP to accept 3.3V.

For the ESP a resistor pair of 220K and 68K should be fine.

I did, thats not the problem. At the moment it’s around 0.2V at ADC but jumping around…

Is the 0.2V with a WeMos or a regular ESP and what device are you connecting to the analogue port?

For reference the ESP has a builtin voltage API in the SDK that can be accessed without use of the analogue port. To use the API you need to ensure you don’t have anything connected to the analogue port.

Use ADC_MODE(ADC_VCC); as a defined global and ESP.getVcc() gives voltage as an integer in mV.

We found the AO port readings do bounce a little and rather than mess about with capacitors and the like we now use the API call. It’s also another circuit we realised we didn’t need when we found the API.

I did try that and it was stable but I need to read sensor data so I need the analog Pin right? I read the Voltage functions are only for internal reference?

Now … When I put ADC to GND i get 0-7 readings no matter what I do.
As soon as I disable Wifi it reads correctly.

But I cant disable Wifi when trying to use Blynk…

So what do I do?

Another remark about my original problem with the AT Firmware - Blynk connection…

Someone in the Espressif Forum replied because I asked about “Busy p…:”

Re: use AT+CIPCLOSE=0 cannot close the connection
Unread postby dax » Thu Jun 09, 2016 8:11 am

Gorkde wrote:
I got this "busy p..." message as well and it seems to mess up the Arduino or Blynk buffers therefore me getting an buffer overflow after some seconds. 

What is the reason for the message and is there a way to avoid it?

Maybe the data you send exceed the number of character you set?

So maybe the invisible Chars Blynk sends as heartbeat aren’t correctly counted sometimes??
Possible bug in the Blynk Lib?

You don’t specifically need an analogue port to read sensor data. Almost all sensors are available in digital form so personally that is the way I would go.

When we were using the AO port with our ESP’s and WeMos the readings were acceptable.

Are you using a regular ESP or a WeMos and what sensors are you trying to read?

You can actually disable WiFi and still use Blynk, it just comes down to the timing, but you shouldn’t have to do this. Provide more details and we will see if we can fix a fix for you.

Thanks but I do need analog since my homemade sensors are not available in digital form :wink:

But I found 2 ways

a) Disable and enable WiFi if this works with Blynk

b) Calculating a middle of many readings (done but takes half a second to get to a stable result)

c) I noticed the correct reading is always the lowest. So I could check 50 then use the lowest of them.

But I got another Problem I’m not even getting my Wemos to connect.
As soon as I try it does a WDT reset for some reason.

wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ld

/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 *
 **************************************************************
 * This example runs directly on ESP8266 chip.
 *
 * You need to install this for ESP8266 development:
 *   https://github.com/esp8266/Arduino
 *
 * Please be sure to select the right ESP8266 module
 * in the Tools -> Board menu!
 *
 * Change WiFi ssid, pass, and Blynk auth token to run :)
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "***";

void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, "***", "***");
}

void loop()
{
  Blynk.run();
}

Main cause of WDT reset is bad power supply.

Then bad coding and finally bad memory settings.

We use 4M, 3M SPIFFS for the WeMos.

Are you selecting WeMos D1 R2 & Mini from available boards or Generic ESP8266?

Is the WDT with all your sensors disconnected?

I’m pretty pissed off by all my time I lost because of Blynk.
Trying to get this work for weeks now!

AT had disconnects Standalone resets…

I dont have such problems when connecting to the boards without Blynk!

I did now try to power it with additional 9V Battery and it’s the same…
All cables disconnected.

As soon as I add the Blynk to my sketch I get this problem…

Also something since I tried to add Blynk: After reset there’s a line of garbage in serial monitor that wasnt there before…

Even if I now upload a sketch without Blynk

You must have the line of garbage for the ESP to work. It’s Chinese for everything is fine, OK I lied about that and nobody knows what it means with the possible exception of Espressif. It means you have successfully flashed the device with ESP Arduino.

Flash this sketch to your WeMos with no connections and let us know what you get:

void setup() {
  Serial.begin(115200);
}

void loop() {
  Serial.println("My WeMos is working just fine");
  delay(1000);
}

I dont need but will… I did other test sketches for reading the analog pin and they upload well and execute as normal (except the adc difference because of wifi)

one Moment…

But I’m really sure I had’nt this “chinese” line before starting to test Blynk…

Please do not infer the garbage has anything to do with Blynk, because it does not.

When you were doing the old skool AT stuff you wouldn’t get the garbage but you get it with all Arduino sketches for all ESP’s.

Your WeMos looks to be fine.
Now try the Blynk sketch again with nothing connected.

What memory settings are you using for the WeMos?

Ok, I just can’t remember this at all and I was working with that board all day…

With the same sketch I get:

[17941] Connecting to MTN WIFI 19996
[24686] Connected to WiFi
[24686] IP: 192.168.10.172
[24686] Blynk v0.3.7 on NodeMCU
[24686] Connecting to blynk-cloud.com:8442
[24840] Ready (ping: 2ms).

The only difference being my NodeMCU reference and your ESP8266.
I don’t know why my WeMos shows as a NodeMCU and I have asked Blynk but it works fine as is.

Are you still getting WDT resets or does it run ok with the basic standalone sketch now?

The WeMos can’t run from a 9V battery so you might have damaged it and surely you should be using a USB cable with a 5V feed? The voltage regulator is rated up to about 5.5V on the WeMos and I think I tested it up to around 7V for a very brief period but 9V is far too heavy.

As far as I khnow this works at least my Arduino clone and the wemos did until now…

But anyway I cant have damaged it because without blynk it connects fine to my wifi and stays connected.

It also connects to my Wifi with Blynk on it but as soon as it etablishes Connection to Blynk it crashes.

What about the memory setting? Is that ok? I just used what he did detect himself…

Can try the sketch with my ESP 13F module on my breadboard but why should there be a difference…

Both did work with every Sketch since yesterday but as soon as Blynk comes into play…

My only Idea is to generally deinstall Arduino and all Libraries tomorrow and install everything new from scratch. But I doubt this will get me any further…

I’m more and more thinking Blynk libs are buggy… Why should they detect your board as NodeMCU?

Blynk is very solid so I wouldn’t spend time looking for buggy libraries.

The WeMos is NodeMCU compatible and maybe one of my many libraries is making the difference. Blynk have confirmed the reference is purely textual and doesn’t do anything.

4M and 3M SPIFFS is fine.

Do you have a blank Blynk project to go with the standalone sketch or do you have lots of widgets set up?
If you have widgets set up, start a blank project and flash the new token and see how it goes.

What version of the Arduino ESP core do you have and what hardware and OS are you running the IDE on? I have 2.20 core on Windows 8.1 laptop.

The ESP13F might behave differently if you haven’t previously connected a 9V battery to it.

So wait a moment the board is working flawlessly with ANY sketch but neither works with Blynk wit AT OR standalone…

BTW…

Found the following:
As soon as I decrease Baud to 9600 in the sketch there’s no Watchdog reset anymore since I use 115200 all the day with any other sketch, where should be the reason when not in buggy libs?

This really gets me annoyed… Wasting weeks for something that should be a matter of one or 2 weeks…