Wemos D1 mini crashes

Whenever I try to use Joystick with wemos D1 mini, even the example code, it runs for exactly a second and crashes the board and board resets…

The code I used -

#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "";

//WiFi details
char ssid[] = "";
char pass[] = "";

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
}

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

Probably the easiest device available to get connected to Blynk server.

Are you actually entering your token between " " ?

How are you powering the WeMos and does it have a strong enough WiFi signal?

Do you have WeMos D1 Mini or Generic ESP8266 selected in your project?

Do you have any Blynk widgets in your project?

Do you have a reliable internet connection?

Can you paste data from pinging blynk-cloud.com

the fact that I can use the button to blink the onboard LED tells me everything works just fine and yes it’s a Wemos d1 mini

@zackbare3569 is this the joystick sketch you are using as nobody else has reported any problems with it:

/*************************************************************
  You can receive x and y coords for joystick movement within App.

  App project setup:
    Two Axis Joystick on V1 in MERGE output mode.
    MERGE mode means device will receive both x and y within 1 message
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

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

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

BLYNK_WRITE(V1) {
  int x = param[0].asInt();
  int y = param[1].asInt();

  // Do something with x and y
  Serial.print("X = ");
  Serial.print(x);
  Serial.print("; Y = ");
  Serial.println(y);
}

void setup()
{
  // Debug console
  Serial.begin(115200);   // 9600 in Sketch Builder

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);
}

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

I’m using the uploaded code, with Joystick in app to adjust the brightness of an LED
(Note - It worked just fine on different Wemos D1 mini which blew up in an accident)
Actually I pin-pointed it out while using this sketch to transfer data from this board to Uno, via I2C

/*
 * I2C_Master_Writer_-2_debug
 *
 *  Created on: 03-Sep-2017
 *      Author: Kunal
 */


#define BLYNK_PRINT Serial

#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Wire.h>

//**************************************************//

//Blynk Authorisation
char auth[] = "---";

//WiFi details
char ssid[] = "--";
char pass[] = "---";

//**************************************************//

int table[] = {0, 0, 0};
int readX = 0;
int readY = 0;

//**************************************************//

BLYNK_WRITE(V1) {

  int joystick_X = param[0].asInt();
  int joystick_Y = param[1].asInt();

  readX = joystick_X;
  readY = joystick_Y;

  byte x = 0;


}

//**************************************************//

void setup() {

  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);

  Wire.begin();

}

//--------------------------------------------------//

void loop() {

  Blynk.run();

  table[0] = map(readX, 0, 1023, 0, 255);
  table[1] = map(readY, 0, 1023, 0, 255);

  Serial.print(table[0]);
  Serial.print('\t');
  Serial.print(table[1]);
  Serial.print('\n');
  Serial.print(readX);
  Serial.print('\t');
  Serial.print(readY);
  Serial.print('\n');
  delay(100);

  //--------------------------------------------------//
  Wire.beginTransmission(8);
  for (int i = 0; i < 2; i++) {

    uint8_t Buffer[2];
    Buffer[0] = table[0];
    Buffer[1] = table[1];

    Wire.write(Buffer[i]);



  }
  Wire.endTransmission();

}
//**************************************************//

Doesn’t that suggest to you that the problem is at your end?

Are you saying you have changed the Blynk library or app version since you had the old WeMos working?

That’s the problem I cannot ensure the board is faulty, as every other thing I do with it, works just fine.
Even the joystick command runs for a few seconds on Digital pin, but on Virtual pin, it crashes immediately.

could you post some serial debug data and the schematic of your hw?
did you try other virtual pins?

Rest aside virtual, even Digital crashes it.
Schematic -

:slight_smile:

thanks, i know how to find the wemos schematic in google. i’ve thought that you should post a basic schematic about YOUR setup, what is hooked up to what pin, etc.

and also the serial debug output…

Ooh right the serial debug output, I’m sorry and afraid that I’m too much of a newbie to get that and my setup is use any of the digital pin and put a single LED, and try to dim it with joystick, that’s it.

the serial debug is EASY to view and can be a HUGE help, so it is worth learning:

1 - connect the wemos with the pc usb port via a reasonable quality and not very long (less than 2 meter) usb data cable (like when you are uploading the sketch)

2 - make sure this line is not commented in your sketch:

3 - open the serial monitor in arduino ide

4 - make sure it is set to 115200 baud (or whatever you have set in your sketch)

5 - reset the wemos

6 - you should get real time debug messages from blynk in the serial monitor window

7 - study those lines, maybe you can figure out what is going on, OR copy paste that stuff and show us here :slight_smile:

1 Like