BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Sparkfun ESP32 Thing disconnects and connects frequently


#1

This scetch is running without any problem when I disable this line: // ledcWrite(ledChannel, ledout);

uint32_t freq = 5000;
uint8_t ledChannel = 1;
uint8_t resolution = 10;
uint8_t LED_Pin = 15;

ledcAttachPin(LED_Pin, ledChannel);
ledcSetup(ledChannel, freq, resolution);

BLYNK_WRITE(V15) // 
{
  int ledout = param.asInt();
//  ledcWrite(ledChannel, ledout);
  delay (7);
}

But ESP32 connects and disconnect frequently when I comment this line out.
Any idea?
Regards
Hanno


#2

Aside from this NOT being a Blynk related issue… you are contradicting yourself…

Which is it? works with or without that line :stuck_out_tongue:


#3

My guess is that the ledcWrite function that you’re using to simulate Analog.write is a blocking function that’s causing Blynk to be starved of processor time, resulting in the disconnects.

Pete.


#4

It works without this line!
Hanno


#5

@PeteKnight that command should work fine, even with Blynk. I have used it in this example for both LED and servo.

@Hanno make sure you have all the correct supporting libraries and any setup… try different channels, resolution and frequency.


#6

@Gunner, I see that you used 8 bit resolution, whereas @Hanno is using 10 bit. I wonder if that makes a difference?

Pete.


#7

I used different resolution depending on application. 8 bit is all needed for LED (0-255)

@Hanno NOTE, the higher the bitrate you set, the lower the frequency must be (stated, but unclarified in the various documents I have read)… perhaps that is your issue.


#8

Reducing frequency doesn’t help
and changing resolution to 8 bit didn’t solve the problem.
tomorrow I’ll try different channels.
Hanno


#9

Try a different sketch as well.


#10

is it possible that use of function BlynkTimer cause this problem?


#11

As I said, try other sketches… it could be something in your current one?? I showed a link above that works just fine with BlynkTimer and a couple of differing settings for two channels.


#12

I tried your sample scetch but got same problem.
I’m using Sparkfun ESP32 Thing.
Did you check your scetch on this device?
Hanno


#13

On a SparkFun ESPThing? No, I used a Wemos Lolin32

Make sure you are using the latest updates for the ESP32 Arduino Core.


#14

This line made the problem:

#define BLYNK_PRINT Serial

after deleting this line everthing is working fine.


#15

That also doesn’t make sense as I successfully have BLYNK_PRINT running on my ESP32 testbench, along with the same Servo and RGB-LED PWM control commands… plus SPI for a display which is showing the BLYNK_PRINT results… no problems.

Have you confirmed latest Arduino Core?

Do you have something plugged into the RX/TX pins??


#16

Don’t know why but everthing is working fine now.
Thanks for your help.
Hanno