i’m trying to have my window blinds/rollers being opened by ESP32/Blynk. I was inspired by It's possible push a virtual button and disable other button? - #12 by Blynk_Coeur
But when adding a digitalWrite (for steering my relays) in the function that was called by the timer, the ESP32 rebooted when coming in this part of the code. When i removed the digitalWrite, all works fine.
Does anybody know why this happens and how it can be solved?
- Search forum for similar topics
- Check http://docs.blynk.cc and http://help.blynk.cc/
- Add details :
• Hardware model + communication type. For example: Arduino UNO with Ethernet Shield
• Smartphone OS (iOS or Android) + version
• Blynk server or local server
• Blynk Library version
• Add your sketch code. Code should be formatted as example below.
Simply paste your code between ``` If you don’t format your code, your topic can be deleted by moderators.
Are you using blynk legacy or IOT ?
And post the sketch you’re using please.
Do you use a relay board ?
Did you try to use 2 power supplies , one for esp32 and one for the relay board?
I suspect a power loss.
i’m using Blynk legacy.
I indicated the added code by /added code/ . Without the added code if works fine, with the added code, the device reboots/stalls when triggering the rollerup-button.
[Unformatted code removed by moderator]
i’m using an simple 2 module relay (https://cdn.myonlinestore.eu/e40d5160-bac0-4897-baae-d6065a5d5915/image/cache/full/97ce289cafaef9a4e1728627e66b5906ef3949a1.jpg)
I doubt power loss, since by triggering the relay in the button push (no timer), it works just fine and stable.
First, this is not the whole sketch
Second, please edit your post and add triple backticks at the beginning and the end of your sketch, triple backticks look like this```
It’s much easier to create a similar project in blynk IOT using the automation, I highly recommend you to try it.
John, Blynk_Coeur, thanks for your advice. Meanwhile i found the problem: power loss of the ESP32 due to triggering of the relay. Blynk_Coeur you were spot on. I was confused because i hadn’t any issues directly in the button routine, but the timespan for the relay was much shorter (1 ms vs 10ms) there.