Your Arduino went offline

Will go to bed now, good night!

When you were messing around with the AT stuff you probably FIXED the baud at 9600.

For now I would run all my sketches at 9600 as it doesn’t really need 115200 for Blynk.

If you have time or spare WeMos’ you can change the baud to 115200 in the AT settings before going to Blynk standalone but you wouldn’t normally need to do this if you go straight to standalone with the WeMos as it comes from the factory.

Don’t get annoyed with Blynk it is just your lack of experience with the system and specific hardware.

No that can’t be it.

Baud is set as soon as you upload the new Sketch with Arduino.

As soon as,you upload the AT Firmware is overwritten and doesn’t exist anymore.

I will post my Sketch later, would you please copy and paste it and upload it to your wemos to see if it’s resetting as well?

Which Arduino IDE and Blynk Library Version do you use?

Ok, can you please use the sketch already posted above and post the Output of your Wemos?

Once I just use the example without changes it works well since it can’t connect.

But as soon as I enter Token, SSID and Password it crashes my Wemos at the moment the connection is made to Blynk.

/**************************************************************
 * 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();
}

Which sketch as I have already given the standalone sketch output?

I found the reason… The token I copied over were from my project on the uno originally.

This sitting in front of the PC for weeks does mess up my head, maybe I should take off today and do some other things to relax…

It’s always a good idea to take some time off if you get stuck. I try to do that too. Sometimes I just get inspired at the weirdest moments because I left all things alone for a bit.

But in that sense I’m lucky to have my own place where I can just drop everything and go do something else :slight_smile:

@Gorkde yes maybe relax as most problems with Blynk are nothing to do with Blynk.

1 Like

I now found somemthing positive to report about Blynk…

When reading analog in with ESP it has a problem when wifi is on. So my readings were about 10 off (alternating) and I did need to wifi.disable() before the reading and enable it afterwards.

But as soon as I avtivate Blynk the readings are correct.

So I assume Blynk disables wifi automatically at begin and end of its routines.

Can someone of the blynk staff confirm this?

Hmmm… eventually it started messing around as well but after more than 15 minutes…

Maybe I need to disable Wifi then…

One question related:

Once I disconnect WiFi with wifi.disconnect();

How do I reconnect?
Is there a wifi.reconnect() or connect() ?
Do I need to connect again with my credentials as if there has been no connection before?

Do I need to manually connect again or will this automatically be done once Blynk is called again?

@Gorkde take a look at https://github.com/esp8266/Arduino/issues/644

Suggestion is:

WiFi.disconnect();
WiFi.mode(WIFI_OFF);
WiFi.mode(WIFI_STA);
WiFi.begin(SSID, PWD);
while (WiFi.status() != WL_CONNECTED) delay(500);

For Blynk you can use Blynk.config() and Blynk.connect() but under some circumstances it will simply reconnect when the WiFi restarts i.e. Blynk.run() magic.

Thanks.

So there’s no way to just reestablish last connecton with something like WiFi.mode(WIFI_ON); ?

So I need to cut connection read analog and reestablish connection?

the problem with that would be you’d have no realtime Blynk communication since you’d have to wait until it has reconnected…

Dunno, our sensors are fine with WiFi running. I would look seriously at the design of your home made sensors.

Thats not about sensors if I do ground A0 and do analogRead(0) in the beginning it reads correctly then suddenly the values jump artound.

I read you ccan only read ADC when HF is not transmitting but got no Idea how to check that.

Try that sketch with grounden A0 you should see it go up after some time.
Once you disable WiFi it works.

#include <ESP8266WiFi.h>


char WLANname[] = "***";
char WLANpw[] = "***";


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

  WiFi.begin(WLANname, WLANpw);
  Serial.println(" ");
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("\nCONNECTED");
  
  // WiFi.disconnect();

}

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

The reading varies from 5 to 13 on my WeMos and it is the same with or without WiFi.begin() and associated WiFi stuff.

With a range from 0 to 1023 if you were reading the 1V voltage range, without a voltage divider, the 5 to 13 range would equate to 0.0049V and 0.0127V, so within 0.5% and 1.3% of the 0 volts. This is within the tolerances I expect from a device costing $4, not sure what you are expecting.

The tolerance is from device to device not from reading to reading…

I found this must be a flaw in the Expessif Firmware and as well in the Github files see:


I am familiar with the Github thread but as indicated by Mr ESP (Ivan Grokhotkov aka @igrr) there is no drift, just noise and contained within the LSB.

Are you trying to land a spacecraft on Mars?

If you are I would increase your budget and swap to a higher priced system :slight_smile:

That’s not correct. There no long time fluctuation as one said n one post but noise on A0 (maybe I did link the wrong page) but Even Expessif has changed it’s code in the last version.

Have you tried running the code I posted for 15 Minutes with A0 grounded?