require("IRReceiver") - out of memory (eventually) #593
Replies: 5 comments
-
Posted at 2016-05-26 by @gfwilliams I wonder how long the string actually was? Some kind of timer might be a good idea as you say - but then it screws up the low power sleep states on the proper Espruino boards as it'll be waking up every so often. I guess the other option is to replace Hopefully it won't add too much to the execution speed. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-26 by Wilberforce Not sure how to determine the string length. - I could save to I'll try the 100 length. The remotes I have seem to send 1's after fixed length (33 bytes in most cases) as repeat code if a button is constantly hit. If the constructor knew the length, a repeated event could be emitted. Not sure how to handle or perhaps retrigger the code sent? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-26 by @gfwilliams
Yes, but they do this after a gap - which Potentially you could have a varying length, but it does complicate usage - and you might want to use the same receiver to detect different types of remote controls which have different signal lengths.
It's done this way for speed of processing - single character string appends are nice and fast, so I wouldn't advise changing it. Realistically bits come in once a millisecond maximum, so to fill up available memory 0 even on an ESP8266 - you've got to have a continuous burst of 10 seconds of IR. I think that's so unlikely that memory efficiency isn't really an issue. What's the 'fluro lamp' that's triggering the receiver, and are you using a proper receiver? Maybe you could check Most receivers need a ~40kHz series of IR pulses to trigger, and then to run out of memory there needs to not be a gap of more than 40ms for a whole 10 seconds. It all seems really unlikely unless something is wrong. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-27 by Wilberforce
Seems to have fixed the issue. Would you like me to do a pull request? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-27 by @gfwilliams Yes, that'd be great - thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2016-05-26 by Wilberforce
I have discovered at night a fluro lamp triggers the IR reciever. These random pulses after a couple of hours trigger this:
it appears to be in this block:
I believe the cause is here:
So code just keeps getting longer.... I wondering what the best way is to make this robust?
Set a watch dog timer that truncates the
code
string if it gets too long, or simply controls it's length?http://www.espruino.com/modules/IRReceiver.js
Beta Was this translation helpful? Give feedback.
All reactions