Is There A Known Conflict Between Millis And WiFi?

No solution found. Will keep looking.

Please post a complete sketch that illustrates the problem. It is very unlikely to be caused by millis() but it may be caused by your use of millis()

This is not helpful. Posting your code and detailing the hardware would help you get clear answers.

No.

If you don't want to get trolled, don't troll.
Read the forum how to what helpers need to help you and provide that information.
Most important - post a sketch showing the problem. Something we can put in the IDE, add our credentials and press compile .
If you don't want to enable us to help you - just find another forum.

Only a guess...

The conflict that I´ve heard about is using Wi-Fi and ADC2 at the same time on ESP32s.

Wemos D1 mini is ESP8266 based, so I don´t know if it presents the same issue. But if it does, most likely your problem is not related to Millis but to using the sensor on one of the ADC2 pins.

1 Like

Olá bom dia! Thank you for the (only) helpful reply. I searched the ADC2 thing per your comment and I am getting something real similar to what others are asking about (but I don't see where they got any solutions for their problem). My code works great with millis (but wifi quits or constantly resets), or wifi works perfectly with no millis. I'm pretty convinced it's a resource conflict. In 45 years I've never failed to find a way. I'll post an answer if I find one.
BTW, I'm a BSEECS software, retired exec. You seem like a team player, no nonsense, straight to the point. I'd bet you find getting jobs easy. Obrigada.

Then you know the importance of sharing a minimum example of the issue you see, that’s the best way to dig in…. It’s engineering 101…

2 Likes

(post deleted by author)

2 Likes

You have here members with engineering degrees or PhD in computer science and/or decades of Hands on experience willing to help…

I’ve code on ESP8266 with millis that works fine and have been running for years.

I just don’t get Why don’t you post your code ? a fresh pair of eyes can possibly see if there is something you missed…

Anyway it’s (mostly) a free world so do as you want. You’ll get more help if you provide more feedback… that’s what we are saying.

2 Likes

Welcome to my ignore user list, @anon27119251!

Really ?
You asked a question about a possible problem with the ESP8266 using WiFi and and millis(), got a reply about a possible problem on an ESP32 with millis() and an ADC pin and that was somehow helpful ?

With your qualifications and experience you will, I am sure, appreciate the need for you to give more details of your problem such as the hardware involved, the symptoms of the problem and not least the code that causes the problem to occur

Without that I fear that this topic will not provide the answer to your problem

2 Likes

it's not even a possible problem, it's documented on Espressif web site and not millis() related..


The ESP32 integrates two 12-bit SAR (Successive Approximation Register) ADCs supporting a total of 18 measurement channels (analog enabled pins).

The ADC driver API supports ADC1 (8 channels, attached to GPIOs 32 - 39), and ADC2 (10 channels, attached to GPIOs 0, 2, 4, 12 - 15 and 25 - 27). However, the usage of ADC2 has some restrictions for the application:

*1. ADC2 is used by the Wi-Fi driver. Therefore the application can only use ADC2 when the Wi-Fi driver has not started.
2. Some of the ADC2 pins are used as strapping pins (GPIO 0, 2, 15) thus cannot be used freely. Such is the case in the following official Development Kits:

  • ESP32 DevKitC: GPIO 0 cannot be used due to external auto program circuits.
  • ESP-WROVER-KIT: GPIO 0, 2, 4 and 15 cannot be used due to external connections for different purposes.

but hey, if that helps :slight_smile:

1 Like

Maybe a yield() or a small delay()
https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/using-the-arduino-addon

1 Like

Sure that's a common cause of wifi issues or watchdog reboots but it's not millis related... stop trolling stay focused on the question :slight_smile:

Unless millis control the exit of a 10 seconds loop. As it clearly may be the case here. :grinning:

1 Like

well it would be clearer if we had the code

:slight_smile:

(to be fair, with a BSEECS, 45 years of experience, including time in deutschland which is super important information - you would assume that @anon27119251 is using millis the right non blocking way)

[I'll stop here]

3 Likes

Thank you for proving the need for my original comment about not trolling. Now PLEASE put me on your ignore list.

Thank you for the useful comment. I have tried delay loops of various kinds delay(), nested for(), Serial_print(), ... instead of millis. They work as you suspected, but then I lose the time which I need to calculate the flow/time. It seems that wifi and the time I need are in conflict. I also have an RTC, but it's too slow to function in a fast/efficient polling loop. At this point I am 99% convinced that millis and wifi are fighting over a flag/bit, register, timer, .... Again, thanks.

And I am 99% convinced the issue is in your code as I have perfectly working code using both wifi and millis on various ESPs.

Are you dépendant on interruptions ?
Are you locking threads for a long time ?

If you can’t reproduce the issue with a simple code you could share (if you don’t want to share the other code) then you are not following the engineering rules you have probably (or not!) applied all your life.

Agitating the troll flag is just barking at the wrong tree. Just be a serious scientist. Keep BS in your title be "Bachelor of Science" and not the other acronym..

+1 on this.