Hey Guys and Gals,
I’m looking for a little assistance. I’m currently prototyping some simple lighting fixtures using some Wemos D1 Mini’s and Blynk. So far its all been pretty great, I’m only using the default app and code that is super basic.
However now I’m trying to get the Web API working and I’m running into some issues. I can get the api to run for example calling “http://blynk-cloud.com/xxxxxxx(auth_code_here)xxxxxxx/update/D8?value=1023” and the light (which is a PWM LED Circuit) turns on fine. However a few moments after the light turns on, it turns right back off.
I’ve included my code that is on the device below, I fully intend to utilize Virtual pins, and do some fancy things further on, and I have some ideas for widgets that may be useful, but my use of Blynk requires that the Web API is available to call on. Does anyone have any thoughts or ideas as to why this is happening or what I am doing wrong? Everything works great in my IOS app.
I’m Loving the community so far.
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
//#include <ArduinoOTA.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "fb3daa91da3343d69e6xxxxxxxxxxxxxxxxxxxxx";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxx";
char pass[] = "xxxx";
void setup()
{
// Debug console
Serial.begin(9600);
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);
// ArduinoOTA.begin();
}
void loop()
{
Blynk.run();
//ArduinoOTA.handle();
}
It seems you are running with direct App and API control of the device pins, as you have no code aside from the basics… so there is almost nothing we can do to assist, what with not being able to look over your shoulder and all
Thanks for checking in on this. I guess my problem is that using such basic code, shouldn’t the pins stay on when called from the API? I don’t have anywhere else that they could be told to turn off.
I read somewhere that D8 (at least on a Wemos D1 Mini) has a 10k pulldown resistor built in… so that might effectively “shut off” your pin when there is no other active influence.
D3 & D4 have 10K Pullups… so try something else like D0
Dang, well thanks for the assistance! Explains part of my issue, but also shows me that the PCBs I designed are probably not going to work for this project
They seem to work fine when I use them in the app directly though, weird. Any reason you can think of for that?
I’m Currently moving all of the data into V Pins, maybe that will change my situation.
Depends on the setting of a button… if set as switch, then the library could possibly be “keeping” that state set on the device. I don’t use direct pin mode, so can’t be sure.