[SOLVED] API Calls Reversing after Sent

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

Bump. Any thoughts here? I’m going to try to set up a local server and see if the same thing happens.

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 :stuck_out_tongue_winking_eye:

Hey Gunner,

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.

Does that make sense?

Oh, wait… perhaps there is something.

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

AHA ! Thanks Gunner, Im hoping that puts me on the correct path.

Based on this link here esp8266 wemos d1 Mini pins/diagram it does have a 10k Pull-Down.

Is there any way to disable that? (I’m fairly new to the wemos.)

No. It, like the others, are hardwired and not adjustable like with pinMode()

image

1 Like

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 :confused:

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.

Much Thanks Gunner!

I owe ya a beer. Let me know how to send it to ya. :wink:

1 Like

The like button will have to do… I am gluten intolerant… no hops for me :stuck_out_tongue:

1 Like

HA! Me too! I’ve found I can do a few Gluten free varieties available near me.

Thanks again!