Can't read Digital & Analog By ESP32S board

1.Whent I use this board: NodeMCU32S
https://docs.ai-thinker.com/esp32/boards/nodemcu_32s

2.It can only be read digital and analog signal by original source code like:
digitalRead(36) or analogRead(36)

But it can’t be read by setting datasreams 36 or A0 input.

3.But I can use Virtual Pin to exchange original source code to display input value.
Blynk.virtualWrite(V5, digitalRead(36));

Does everyone has the same problem?

Digital and analog datastreams aren’t implemented in Blynk IoT yet, despite being available for selection in the datastream tab.

Pete.

Thank you for your reply, it really help to me.

Digital and analog datastreams are implemented (~ 2 months ago). Should work.

Okay, maybe that should have been announced?

Pete.

@Dmitriy can you explain how the analog and digital datastreams are meant to work for various hardware types?

If I choose ESP8266 in the web console I see 5 analog pins available numbered A0-A4. I also see pins numbered 0-14 which I assume represent the digital pins. The ESP8266 has one analog pin, A0.

If I choose digital pins for the ESP8266 I see 14 pins, numbered 0-13.
The ESP8266 has the following GPIOs:
0, 1, 2, 3, 4, 5, 12, 13, 14 & 15.

If I choose ESP32 then I see the same analog pins A0-A4 plus 0-14 that I get when choosing the ESP8266.
The ESP32 has 18 analog pins, arranged into two ADCs, 1 and 2. The ADC2 pins can’t be used at the same time as WiFi, so are useless from a Blynk perspective.
The 8 ADC1 pins are also GPIO pins:
32, 33, 34, 35 36, 37, 38, 39

The ESP32 digital pins are GPIOs 0-5 and 12-39, yet Blynk shows digital pins numbered 0-13

How do any of the Blynk analog or digital pin numbers relate to the pins on the ESP8266 or ESP32 boards?

Pete.

2 Likes

It couldn’t be work, when I use datastream to set A0~A4 or 0~13 all no response.

And I was the same question with Pete.
ESP32 in Datastream only has pin A0~A4 and 0~13.
But in the ESP32S board, it has GPIO0~GPIO36,ADC: 0,3,4,5,6,7,10~13,15~19.

Also the esp32 pins ( 6-11 ) connected to the integrated SPI flash and can’t be used at all

@vshymanskyy could you please provide documentation explaining how it should be used?

to send analog data to Blynk you just transform the float value into string value.
like :
float x = analogRead(35);
String s = String(x);

and in the blink data stream you choose string for virtual pin option.
to display the value in the dashboard you choose the label widget.

@veens I think you’ve missed the point of this topic…
It’s about using Digital or Analog datastreams in Blynk IoT in the same way that they were used in Blynk Legacy.

Pete.

@vshymanskyy are you able to provide the documentation about using digital and analog datastreams in Blynk IoT, and how the digital/analog pin numbers that appear in the web console are meant to map to physical pins on the various devices?

Pete.

1 Like