BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

What am I missing

Not sue what I’m missing. I have used D1 mini with old blynk countless times but since i migrated i can’t perform any pin writes, specifically on esp8266… ping latency is 40ms but projects connect every time to blynk cloud.

#define BLYNK_TEMPLATE_ID " xxxxxxxxxxxxxx"
#define BLYNK_DEVICE_NAME "Candle"
#define BLYNK_AUTH_TOKEN "xxxxxxxxxxxxxxxxxxxxxxxx";

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

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

char auth[] = BLYNK_AUTH_TOKEN;

char ssid[] = "xxxxxxx";
char pass[] = "   ";

// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0) // Executes when the value of virtual pin 0 changes
{
  if(param.asInt() == 1)
  {
    // execute this code if the switch widget is now ON
    digitalWrite(4,HIGH);  // Set digital pin  HIGH
  }
  else
  {
    // execute this code if the switch widget is now OFF
    digitalWrite(4,LOW);  // Set digital pin  LOW    
  }
}

void setup()
{
  pinMode(4, OUTPUT);  
  // Debug console
  Serial.begin(115200);

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

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

___  __          __

/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v1.0.1 on ESP8266

[4305] Connecting to blynk.cloud:80
[4472] Ready (ping: 40ms).

What exactly does this mean? Which pins?

Pete.

Its the strangest thing… these were d1 mini pros with a stacxking relay on D1 they worke flawlessly on the previous blynk and own server.

As per documentation i have tried other pins, deleted and recreated the stream and device. Also tried to hard code the default pins in the stream setup. Its like the information never arrives at the device… cant see any logging anywhere that would indicate malformed data, packet loss etc… everything else i have converted with a wired lan connection works flawlessly… i am on the same wireless network as the devices

Are you talking about digital pins or virtual?

You need to be MUCH more specific!

Pete.

Pete… I am using the virtual pin(as per your previous suggestion) for the on/ off stream V0. in the sketch you will see that when V0 holds true, then write to the digital pin of the wemos d1 mini wich is the standard pin for the stacking relay.

I have tried multiple minis and multiple relay combinations. I even tried a wemos D1…

when i look into the log the data.csv show null data
but the evens csk shows allthe connects and disconnects of me reprogramming and adjusting the streams.
so could conclude that there is no writing back coming from the blynk server.

similarity the data stream supports the selection of a hard coded pin indicated byt the drop down field…the results are the same regardless what virtual stream number or available ping in the data stream, on multiple devices with the same script. Wondering if its the blynksimple library and the new service.

p.s im using 1.0.1

The mk1 version of the D1 Mini stacking relay uses pin D1 (GPIO5) as the trigger pin, not GPIO4 as you are using.
The mk2 version allows you to choose which pin is the trigger pin, by bridging solder pads.

There was a bug when using pin V0, but I think that has been fixed now. But, maybe you should use a different virtual pin.

The way to prove that is to add a serial print statement into your BLYNK_WRITE(vPin) callback function. Have you tried this?

Pete.

Pete… my apologies the pin in the script was from my last futile attempt to make it work. It doesnt work with d1 either so im thinking the latter in your response is the reasoning. I will try another virtual pin.

Pete…I must bow my head in ESP8266 shame… The previous version of the app had a drop down box that allowed me to select D1, D2 etc. The new app has a drop down box that shows virtual pins as well as pins 1,2,3 etc which actually correspond to the pins of the devise …

It wasn’t until i debugged with the serial monitor that I received the Aha moment… Totally embarrassed

Thanks once again…

That digital pin functionality is not fully released yet, use virtual pins instead.

Pete.