[Solved] Eventor output wrong

I have a value sent from hardware (esp8266) to a virtual pin, read by the eventor. The eventor then needs to switch a pin (gpio12) on the hardware side based on this value.
The problem is that the eventor only gives an option of turning a hardware pin ON or OFF, this ON does not work and I suspect it is because an analogWrite with a value of 1 is sent instead of a 255. The virtual pins work fine as you can specify the value you send.

@Nelis_Brink I suspect your sketch can be improved for Eventor to handle your problem.

Are you able to post the sketch or an extract?

Why is that wrong if this is digital pin?

@Costas Thanks for a quick reply. I specifically don’t want to have any code residing in the esp module, I want it to be easily managed through the Blynk app. I know I would be able to read virtual pins again on the esp side or even switch the hardware from there but that is undesirable.

I have tested my theory of an analogWrite happening (in the Eventor) instead of a digitalWrite by writing ON to a virtual pin in the Blynk app connected to a LED Widget, the LED showed a little grey lit up part meaning it is on 1/255 on, as in analog. So I need the Blynk Eventor to either digitalWrite(gpio12,HIGH) or analogWrite(gpio12, 255).

The code is extremely simple an basic

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

#define ONE_WIRE_BUS 14
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "";
char ssid[] = "_";
char pass[] = "";
int nextSample = 0;
int intervalSample = 1000; //1000ms = 1s
void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
}

void loop()
{
  
  Blynk.run();

  if(millis()>nextSample)
  {
    sensors.requestTemperatures(); // Send the command to get temperatures
    float myval = sensors.getTempCByIndex(0);
    Blynk.virtualWrite(V0, myval);
    nextSample = millis()+intervalSample;
  }
}

hello!

i do not think this is possible using only eventor…
maybe can you use a digital pin, instead analog?

also, remove the passwords, tokens from the uploaded sketch!

EDIT:
consider declaring nextSample as unsigned long, otherwise it will overflow very quickly, just after 32 seconds…
or, even better, use simple timer library, included with blynk library!

ESP’s don’t work without code :slight_smile:

I am a bit confused with your analog and digital references. What is it that you want Eventor to do?
You said switch GPIO12, which is digital.
Please elaborate.

@wanek Thanks for the tips, I’m truly a forum virgin. I tried the SimpleTimer and somehow it made my device disconnect the whole time.

@Costas Yes, sorry I’ll try and explain in a simpler way:
Yes GPIO12 is a digital pin on the ESP. For example, I can use a Button widget in the Blynk app and then turn that pin ON or OFF. I guess that the Button of Blynk somehow sends a digitalWrite (arduino style) to the ESP. That works perfectly.

The problem is that I want to have the eventor send out a digitalWrite(HIGH) just as the Blynk Button widget does it, but instead it sends only a 1 (out of 255) in an analogWrite (arduino style) manner, so in theory the pin is only slightly on and extremely dim. Understood?

@Nelis_Brink understood and @Dmitriy a quick test suggests Eventor isn’t working correctly. I never use it, so maybe I am testing it wrongly. Will continue to check.

I have 2 events tied to a V3 button, if V3 is > 0 turn on GPIO 2 and if V3 is < 1 turn off GPIO 2. No response from the builtin LED on an ESP (GPIO 2).

Edit: ignore, see my follow up post.

than this could be a bug… @Dmitriy, can you confirm this, please?

but, anyway, @Nelis_Brink, why do not want to use a simple code to come around this issue?

like, send the eventor to a virtual pin, instead digital, and in code write:

BLYNK_WRITE("virtual pin number here") {
  if (param.asInt() == 1) digitalWrite("yourpin", HIGH);
}

It’s “by design”. Eventor is hardware triggered only.

i do not understand what does it mean???[quote=“Costas, post:10, topic:11612”]
hardware triggered only
[/quote]

From hardware to app, not app to hardware.

@Dmitriy digital pin control with Eventor from the hardware side doesn’t seem to work as indicated by @Nelis_Brink

Could be. Let me check.

You mean analogWrite(gpio12, 1023)? Right? According to https://github.com/blynkkk/boards/blob/master/Esp8266.json#L18

Bug is confirmed. Will be fixed with next Android update.

@Nelis_Brink thaks for reporting!

@Dmitriy I have tested the new app and it works perfectly now, thanks!

@Nelis_Brink thanks for letting us know!