I have looked for similar topics here and a number of user have reported outputs not working.
One was to do with widgets talking to the same pin
One was to do with number confusion
I could not see anything that matched.
Hardware:
• SparkFun 8266 thing dev + wi-fi/standalone
• Android, but failure happens even without the app running
• Blynk server
• Blynk Library version - whatever was around this week
Here is the issue:
In a non-Blynk sketch I am able to say:
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
and it works perfectly.
In Blynk it does not work. I created a minimalist sketch (below). If I comment out the Blynk.begin line, the code works and an LED connected to output 4 lights up when the sketch starts as expected.
If Blynk.begin is used, the LED does not come on.
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "xxxx";
char ssid[] = "xxxx";
char pass[] = "xxxxx";
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass); //<- it works if I comment this line out
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
}
void loop()
{
}
The app on the phone has nothing connected to D4 and is not running either.
Does Blynk remap the outputs?
The Blynk doc says one can use digitalWrite as usual, but I cannot find a single code example of actually setting an output pin on the site.
It works fine (same hardware and connections) in a more complex sketch (non Blynk) that also connects to my wifi and even takes commands in through an additional TCP connection. It seems as though output 4 is not the same port for some reason once Blynk attaches to the network.