• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESPnow send boolean data structure to ESP32 reciever to run led on and off with millis()

Q&A Forum › Category: ESP32 › ESPnow send boolean data structure to ESP32 reciever to run led on and off with millis()
0 Vote Up Vote Down
Merkeven Suico asked 3 years ago

Hi ,
Its me again, I did my second experiment exercise which is im sending a boolean data to a reciever.

In this experiment the goal would be like this.

1st Show_Group1 will “on” if its 5mins already. it will on for 1 min only,

2nd Show_Group2 will “on’ if its 10 mins already. it will on for 1 min only.

3rd Show_All will on if its 15 mins already. it will on for 1 min only.

But there maybe a chance that the Show_Group 1 will on also once the Show_Group2 beacause of the time interval, so i made something like an enterlock in the code, im not sure if its realy right im just experimenting.

The code was compiled but its not giving me any output.

Hopping you can help me with this  im nearly closer to my goal.

 

please check this link of my code.https://pastebin.com/qJXMHLCA
this is the error im geting in the esp32 dev kit.

Thanks in advance.

Regards.
Keven

E (356997) gpio: gpio_set_level(226): GPIO output gpio_num error
E (359997) gpio: gpio_set_level(226): GPIO output gpio_num error

 

3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
I see that you closed the issue.
Did you solve the problem?
Regards,
Sara

0 Vote Up Vote Down
Merkeven Suico answered 3 years ago

Hello Sara,
I didn’t solve the problem but i manage to solve some issue somehow. but still my sketch still have a problem.

Hope you can help me, here is my sketch https://pastebin.com/pAgHZMAG

Problem 1. The the sender was not sending data to Address2. only adress1 and adress3 are receiving data. I cant find where is the issue?
Problem 2. I want to send the data showOn and ShowOff but with timing.
example: I have 3 groups of show in my sketch.
the 1st show_all, if its 15 mins sender send data showON to the c receivers Address then after 1 mins the data ShowOFF will be send in the same receivers Address.
the 2nd show_Group1, if its 5 mins sender send data showON to the c receivers Address then after 1 mins the data ShowOFF will be send in the same receivers Address.
he 3nd show_Group2, if its 5 mins sender send data showON to the c receivers Address then after 1 mins the data ShowOFF will be send in the same receivers Address.
Im using the millis() function and im not sure if im doing the right approach in this.
Maybe you can give me sudgestion of what is the best approach in my project.

Thank you in advance,
Regards
keven,

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
 
Check that you’re using the right MAC address for that board. Try a sketch that only sends data to that board to see if there is something wrong with that board. If it works properly, it means there’s something wrong with your current code.
 
Using millis() is perfectly fine as long as it is properly implemented.
If you want to take a look at something similar that might be useful in the future, you can take a look at task scheduler: https://github.com/arkhipenko/TaskScheduler 
At the moment, we don’t have any tutorials about that. And you would need to learn a new library and a new way of writing your code, but might be a good learning exercise.
It’s just a suggestion, using millis() is perfectly fine.
 
Regards,
Sara
 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.