-
Hi,
I've got some code that is both hosting a webserver and polling sensors for data.
The sensor polling uses timeouts to provide a wait time for the sensor to respond, and the webserver uses the standard pageRequest function to parse the request and serve information back to the client. html, js and css files are held in storage and are read out in chunks on request.
I'm assuming its something to do with timers, and the storage module as I can disable the polling and it works fine.
this was all working fine in version 2.8, but I tried version 2.10 yesterday and now if try and load the page served by the module whilst running the polling loop I get the error 'Execution Interrupted during event processing.' I get this lots of times.
Any thoughts on what might have changed between v2.8 and v2.10 that might cause this and how one might resolve the issue.
Thanks,
Rob Smart
-
-
Hi,
I'm using a ESP32 to listen for BLE packets and I'm getting the occasional error. Any ideas on how to figure out the issue?
Guru Meditation Error: Core 0 panic'ed (LoadStoreError). Exception was unhandled.
Core 0 register dump:
PC : 0x400d8da0 PS : 0x00060c30 A0 : 0x800ea8ca A1 : 0x3ffde630
A2 : 0x3ffed1bc A3 : 0x00000000 A4 : 0x00000000 A5 : 0x00001e00
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x4006182c A9 : 0x00007468
A10 : 0x00000076 A11 : 0x00000000 A12 : 0x0000000e A13 : 0x000003fe
A14 : 0x7ff00000 A15 : 0x7ff38800 SAR : 0x00000012 EXCCAUSE: 0x00000003
EXCVADDR: 0x40061830 LBEG : 0x4009b418 LEND : 0x4009b423 LCOUNT : 0x00000000Backtrace: 0x400d8da0:0x3ffde630 0x400ea8c7:0x3ffde650 0x400ea91d:0x3ffde700 0x400f9a3c:0x3ffde720
Many Thanks,
Rob Smart
-
Hi,
I've been flashing ESP's for ages with Espruino and this is the first time I've seen this.
I've got a really simple bit of code:
function main() { var BTN = 12; var rgb = new Uint8ClampedArray(3*3); var pos = 0; function getPattern() { pos++; for (var i=0;i<rgb.length;) { rgb[i++] = (1 + Math.sin((i+pos)*0.1324)) * 127; rgb[i++] = (1 + Math.sin((i+pos)*0.1654)) * 127; rgb[i++] = (1 + Math.sin((i+pos)*0.1)) * 127; } return rgb; } setInterval(function() { require("neopixel").write(14, getPattern()); }, 100); pinMode(12, 'input_pullup'); setWatch(function(e) { console.log('bttn pressed'); }, 12, { repeat: true, debounce:100, edge: 'falling' }); } E.on('init', main);
Just to flash some LED's and listen to a button press, and if I type save in the console to store the code, I just get an endless loop of errors reading this:
[ERASED]
in function called from system
Uncaught SyntaxError: Got [ERASED] expected EOF
at line 1 col 1I'm sure I'm flashing the correct firmware (the V2.08 4mb ESP8266 version)
Any ideas?
Thanks,
Rob
-
Hi,
I hadn't seen that other e-ink display. I can certainly use that for some help.
I need to map out the manufacturers process in the c code they supply as I think there might be some more steps (like actually powering the display on first) that I might be missing.
I was aware of the getting the spi lines round the wrong way so did try it both ways around.
I will update on progress when I make some!
Thanks
-
Hi,
I've been looking at this code to try and convert to run an e-ink display (M5Paper) (https://github.com/gnzzz/IT8951/blob/89d505b26f130539644117522a0fdc128ffe44c1/lib/it8951.ts)
I'm pretty new to SPI so have been trying to figure it out.
looking through the forums I've managed to piece together 3 methods for reading, writing and sending commands
var read = function(reg,len) { // read return SPI1.send([reg|SPI_PREAMBLE.READ,new Uint8Array(len)], cs).slice(1); }; var write = function(reg,data) { // write return SPI1.write(reg, data, cs); }; var command = function(c,d) { SPI1.write(c, cs); if (d!==undefined) { dc.set(); SPI1.write(d, cs); } }
But it doesn't work. So for example in the code I'm looking at, this gets called
this.setRegister(SYS_REG.I80CPCR, 0x0001); this.spi.writeWords( Uint16Array.from([SPI_PREAMBLE.CMD, USDEF_I80_CMD.GET_DEV_INFO]) ); const data = this.spi.readWords(20);
I've converted this to:
write(SPI_PREAMBLE.WRITE|SYS_REG.I80CPCR, 0x0001); let info = read(SPI_PREAMBLE.CMD|USDEF_I80_CMD.GET_DEV_INFO,20)
but info is just full of zeros.
I'm not sure if I'm totally on the wrong track or just missing some key bit of information.
Thanks,
Rob Smart
-
-
Hi,
I did a bit more googling and found that one of the devices I have uses the IT8951 driver.
so not sure if there is a module for this one yet, but I did find a node.js library that should be easy enough to transfer over
https://github.com/gnzzz/IT8951
Thanks,
Rob Smart
-
Hi,
I've just got a LilyGo T5 which is an e-ink display with an ESP 32 attached.
I've got a set of Arduino libraries as I can develop for it on that, but it got me thinking about how one would port the code over to Espruino. I've read that you can compile C code to run under espurino. Is this documented anywhere? How would one even start to look at this? what tools are needed to do this?
Thanks
-
-
-
-
-
-
Hi,
Yes I'm using that code. The display is 128x160.
There is a fuzzy boarder of a few pixels down the left and across the top, then the rest of the display is black with skewed text displayed.
I've tried it on a couple of ST7735S boards and its still the same.
I've looked at the source for the ST7735 module, but its a little out of my depth, nothing obvious jumps out at me.
I'm happy to post a screen to someone if they can help debug?
Thanks,
Rob
-
-
I have the 2 channel version of it.
Here is some code that is supposed to work on it.
https://github.com/mischkasmith/lctech-2ch-relay/blob/master/lctech2ch.ino
I'm running the code on the ESP8266 that is on the device, so in theory I should just power the device, and it should load the code, and start switching the relay. I just wanted to do a simple test before doing anything else to ensure I could control it.
I did connect an FTDI to is while it was running and it did seem to be sending more that just those commands to the out. basically anything outputted to the console was getting sent too. Is there a way to redirect the console outputs to another channel that I can observe, whilst keeping the serial1 channel just for the comms to the module?
I did also try just sending the commands directly from my pc using some node js code, but I still couldn't get it to work at all.
I have a second relay module so might try that incase there is a fault with that one, but it just seemed very unresponsive.
Next thing will be to get it working as per the original spec as you suggest to make sure the board actually works!
-
-
Hi,
I'm trying to write some simple code to toggle a esp8266 based relay.
According to all the docs I've seen (and according to this post https://www.esp8266.com/viewtopic.php?p=66327) all one needs to do is send a series of hex codes out over the serial port to toggle the switch.
So I've written a very simple bit of code that I think should work, but I'm not overly familar with sending serial data.
function onInit() { Serial1.setup(9600); var relayOn = [0xA0, 0x01, 0x01, 0xA2]; var relayOff = [0xA0, 0x01, 0x00, 0xA1]; var toggle = true; setInterval(function() { if (toggle) { console.log('on'); Serial1.write(relayOn); toggle = true; } else { console.log('off'); Serial1.write(relayOff); toggle = false; } }, 5000); }
Is there any obvious flaw in this code as its not working. I can see the blue led flash every 5 seconds as it sends the data, but is this the correct way to send a set of hex instructions?
Thanks
-
-
This looks interesting
https://www.hackster.io/rayburne/esp8266-captive-portal-5798ff
It looks like its written in C so it might be possible to wrap it up into a module for use in espurino??
-
you don't want to do that....you need to type
var wifi = require("Wifi");it is not that you are requesting the wrong module, its because its not communicating with the esp8266 correctly, which is why you cannot type into the console.
did you hit reset on the esp8266 before reconnecting? Have you got the ch_pd pin high?
-
-
I believe you can use the FS module to access some extra storage.
Format the extra partition using http://www.espruino.com/Reference#l_E_flashFatFS
you can then use the extra space availible on the ESP32 board.