Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By Mickbaer
#46296 Hello,
I have traced it again,
the Interrupt changing to "CHANGE", "RISING", "FALLING" make no difference.
Also CLI(); / SEI() around the G_pulsCount value handling makes also no difference.

I added at the ISR , an Serial print for testing,
void ICACHE_RAM_ATTR pulseCounter()
{
// Increment the pulse counter
cli();
G_pulseCount++;
Serial.println ( "!" );
sei();
}
The Serail Output is shown wiht the right numbers counted ( 120 PULS / sec)
As Long the ESP8266Webserver do not act to the Network.
At this Moment the Interrupt did not came up any more.


Searching at the Internet, I found this:
http://stackoverflow.com/questions/3668 ... -i-o-crash
It seams the same Problem. Interrupt handling along with Network Actions.

Who can help here?

Thanks from Mickbaer
Berlin Germany
User avatar
By martinayotte
#46308 BTW, just as a sidenote : you should never call Serial.print during the interrupt !
Doing so can lead to even worst things. Never call any thing that take long time, and never calls something that use interrupt while been already in an interrupt.

The fact you've mentioned that it is working fine as long as no network traffic, but fails if any HTTP transaction, lead me to think that the missed interrupts are occuring while the WiFi is actually handling its own interrupts and blocking yours during a elapse time.

In such case, I would rather suggest to change the design of you project by adding an external MCU to do the pulse counting.
User avatar
By Mickbaer
#46313 Martin,
It is clear , to not use an Serial print at an ISC.
I have added it only for to check from where the Problem came up.
and it shows, that the Hardware is possible to track the interrups,
(no Level Problem), and it is laying at the anabling / disabling of the Interrup at the System.

Let me answer to your reply:
----
The fact you've mentioned that it is working fine as long as no network traffic, but fails if any HTTP transaction, lead me to think that the missed interrupts are occuring while the WiFi is actually handling its own interrupts and blocking yours during a elapse time.
----
It is not complete correct,
It is working with low frequency very correct!
Using an greater number of puls, it did not Count every puls, or stopped the complete counting.
It can be anymated, to recount for an short time, by fastly refreshing the Website.

The Problem is anywhere playing around the Interrupt handlind and Webserver handling,
like stopping the Interrupts for an short time and not freeing them some times.

As you see I'm not the only one, describing such Problems.
(see the link I posted at my last post.)

So your suggestion, to use an extra CPU for Interrupt Counting , is not an solution,
Bcause I 'm using max 50% of Flash Memory and 30% of ram, at the ESP8266

By the way, I noticed using the Webserver, from the beginning on of my project, at ARDUINO 1.65,
an behavior, as I implemented an Blinking LED, driven at the LOOP, every 500ms, to see the alaive of the System.
Using the WEBserver, some times, shortly, some times at all 30..40 seconds,
the blinking stops,
Some one works internally at the Freeing RAM, and came back with some more free RAM.
This interrupting of my blinking, came clear for me, from the Webserver, and takes one second .. 2seconds and more time. At Arduino 1.65 it crashes verry often.
So I changed to an newer Version 1.68 and 1.69.
Here I noticed the behavior, but very briefly, it does not more crashing, but you can see it, at the blinking LED stucking.
At the Internet can be found other Users, describing the same behavior.

This is for me no Problem, because the Webserver is running alaife,
over two weeks, with no Crash and no reset, but the stucking led is be seen.


All this Shows me that there is some thing has been changed from 1.65 to 1.68, because my code is the same.
And the not working Interrupt seams for me, to be also an internal System Problem.
(sorry, I have not the System knowledge to help here)

I hope that any body, who knows the System, can help here.

Thanks from Mickbaer
Berlin Germany