-
-
The example comes from here: http://www.espruino.com/Puck.js+Infrared.
Here's the output of process.memory() before and after loading the code.
process.env follows.
process.memory()
={ free: 2217, usage: 33, total: 2250, history: 12,
gc: 0, gctime: 3.23486328125, "stackEndAddress": 536924008, flash_start: 0, "flash_binary_end": 419924,
"flash_code_start": 442368, flash_length: 524288 }
| |_ ___ ___ _ ||___ ___
| |_ -| . | _| | | | | . |
||_| || |_|||_|_||_| espruino.com
2v04 (c) 2019 G.Williams
process.memory()
={ free: 2180, usage: 70, total: 2250, history: 46,
gc: 0, gctime: 3.2958984375, "stackEndAddress": 536924008, flash_start: 0, "flash_binary_end": 419924,
"flash_code_start": 442368, flash_length: 524288 }process.env
={
VERSION: "2v04",
GIT_COMMIT: "3956264e",
BOARD: "PUCKJS",
FLASH: 524288, RAM: 65536,
SERIAL: "f4801353-1c650745",
CONSOLE: "Bluetooth",
MODULES: "Flash,Storage,hea" ... "S,crypto,neopixel",
EXPTR: 536882364 }It is possible that the IR signals are not properly formulated i.e. more than a few transitions.
But I doubt the stream of data would overflow d[]. -
While running the following (example) code to read IR signals
digitalWrite(D2,0); pinMode(D1,"input_pullup"); var d = []; setWatch(function(e) { d.push(1000*(e.time-e.lastTime)); }, D1, {edge:"both",repeat:true}); var lastLen = 0; setInterval(function() { if (d.length && d.length==lastLen) { d.shift(); // remove first element console.log(d.map(a=>a.toFixed(1)).toString()); d=[]; } lastLen = d.length; },200);
I get this after a few reads:
.1,4.6,0.6,0.6,0.6,1.7,0.6,1.7,0.6,1.7,0.5,0.6,0.6,1.7,0.6,1.7,0.6,1.7,0.6,1.7,0.6,1.7,0.6,1.7,0.5,0.6,0.6,0.6,0.6,0.6,0.6,0.5,0.6,1.7,0.6,1.7,0.6,0.6,0.6,1.7,0.6,0.6,0.6,0.6,0.6,0.5,0.6,0.6,0.6,0.5,0.6,0.6,0.6,0.6,0.6,1.7,0.6,1.7,0.6,0.5,0.6,0.6,0.6,0.5,0.6,1.7,0.6,40.0,9.1,2.2,0.6,97.2,9.1,2.2,0.6
4.0,3.9,0.6,0.9,0.6,0.8,0.6,0.8,0.6,0.8,0.6,0.9,0.6,0.9,0.6,0.9,0.6,0.8,0.6,0.9,0.6,0.8,0.6,0.9,0.6,0.8,0.6,0.8,0.6,0.9,0.6,0.9,0.6,0.9,0.6,0.8,0.6,0.8,0.6,0.9,0.6,0.9,0.6,0.8,0.6,0.8,0.6,1.9,0.6,0.9,0.6
ERROR: Ctrl-C while processing watch - removing it. Execution
Interrupted during event processing. New interpreter error:
CALLBACK,MEMORY ERROR: Ctrl-C while processing interval - removing it.
Execution Interrupted during event processing.What seems to be the issue?
How do I go about to debug this?
Thanks!
This has been flashed with
Able to connect and set up Wifi using:
as well as "nc" over Wifi:
However, on a Mac Mojave Chrome, the serial connection does not show (baud rate changed to 115200):
Also can't connect via Wifi.
Is there a Chrome setting I'm missing?
I won't mind pasting code using "screen" however I don't know how to include "require"d modules if not already included.