-
I have been absent from Espruino for a while, but these chips are still around. Just recently I was looking for a cheap solution to hook up a non-volatile memory in the megabyte range to a circuit and mouser quickly brought these up again.
Should I add people to the github repository so you can make the neccessary changes?
-
Thank you for pointing this out. I don't usually read big chunks, so I never wondered about this. I committed this to the repository for people who may find it useful.
It seems that function calls are very inefficient (otherwise this wouldn't be much faster than calling the read function in a loop). Do you know any way in Espruino's JavaScript to make it an inline call like it's possible in C?
Another idea I had was changing the read method like this:
Flash.prototype.read = this.spi.send;
i.e. making the read property point directly to the property of the spi class. This seems a bit unclean but it may work and actually be faster. I don't have that chip right now, but maybe you can test.
-
I will try it! By the way, I see you are communicating over a tty device. I noticed that on my Mac, the tool recognizes only the cu ports but not the corresponding tty ports. The cu ports work, but I cannot have another terminal program connected and reading at the same time because access is exclusive.
-
-
I fixed another bug (see github discussion with @Gordon about my changes) and now finally I'm talking to Espruino.
But for some reason I'm not getting the correct return values and console output from Espruino.
I have a file
foo.js
:a=123; console.log(a+1);
Now when I call espruino tool, I get the following:
$ espruinotool -p /dev/cu.usbmodem1411 foo.js espruino-tools -------------- Connecting to '/dev/cu.usbmodem1411' --]___ --]| __|_ -| . | _| | | | | . | --]|_____|___| _|_| |___||_|_|___| --] |_| http://espruino.com --] 1v81 Copyright 2015 G.Williams --] --]> --]=undefined --]> --] Connected --]=undefined
I expected it to return 123 for the first statement, then write 124 to the console and then return undefined for the second statement. The console output is nowhere to be found and undefined is not the correct result. But if I now use WebIDE, I can verify that a really has the value 123, so the code has been executed.
-
@the1laz: Yes!!! This is exactly what I need!
But it won't run :( After I fixed a few bugs in the code that caused it to crash, espruinotool now at least reports an error that the port was not found. I called
espruinotool -p /dev/tty.usbmodem1411 foo.js
, but for some reason no ports are found at all (getPorts returns an empty array). -
@allObjects: you have quite a few good ideas there. I like the idea of having a flexible build system that works tightly integrated with the IDE.
The main reason why I don't want to use the IDE this time is that I want to code in CoffeeScript and I cannot do that in the IDE because its syntax highlighting is for JavaScript and the IDE also does not support pre-processing.
-
@DrAzzy: Thank you! Aha, simple trick but works :) So it appears it's sending
echo(0);
Modules.removeAllCached();
Modules.addCached(<moduleName>, <moduleCode>)
for every module, where moduleCode is the minified module as a string. This is recursive (i.e. includes modules required by modules).- The contents of the editor window
echo(1);
Looking back with the up-arrow shows the code from the editor not in one chunk but in several chunks, where each function or each top-level line of code is one chunk... but it seems there's nothing special about sending code that way, it seems to be only related to retrieving code from the command history with the up-arrow. How do I know? Well, if I copy a js file to the espruino tty device, it's certainly sent in one chunk but yet it also appears as several chunks in the command history.
So... how should I parse code for
require
? The easiest thing would be a regular expression just scanning for the word and what's between the brackets. However, that would also require a module when the require has been commented out. And the developer might do crazy things likemoduleName="foo"; require(foo);
which would need a semantical parser. I'm not sure how smart that parser should really be, but I guess it would be nice if it did the same that the WebIDE does... -
What exactly does the WebIDE do when the button "send to Espruino" is pressed? Especially, how does it handle
- requires
- compiled functions
- minification
and what does it send over the serial interface?
The reason for my question is that I would like to use a task runner (such as grunt) to generate JavaScript from other stuff and deploy it to Espruino, since it would be bothersome to always copy and paste the result into the WebIDE. I basically need a command-line version of the send-to-Espruino button... what would it have to do?
- requires
-
I missed a disconnect function when testing connect-on-demand code. I haven't got as far as saving power, but that will become a very important topic. On a battery operated device, I want the battery to last long, but I also want it to be ready quickly. After powering up, it takes a few seconds to initialize and then connect to an AP. I'm not sure if there's a power-efficient way to keep it on standby...
-
-
Thanks gentlemen... after soldering the GPIO0 jumper back and forth about 50 times in 2 days trying to awaken the ESP8266 with the 0v50 firmware in all its variations, I tried the 0v25 version as you suggested. It's counter-intuitive but it worked immediately! Now I can finally turn off the solder station and write some JavaScript :)
-
@Gordon, I noticed that in the js file you made available as a module, some of the special characters used in the example (in the comments) got broken. They're okay in the github version. Only the comments are affected, so it shouldn't hurt the functionality, but it doesn't look nice.
-
I used this great tool online and made this new font. The converter works like a charm... but it puts the wrong value for firstChar into the call of setFontCustom (it should be the same value entered above).
-
The display is this I2C 128x32px OLED I mentioned here before, and finally it works :)
-
-
Hey folks, I got creative and made a font!
Yesterday I was shocked to find that Espruino doesn't speak German to me through the OLED display, because all of its fonts lack the letters ÄÖÜäöüß. So I went to study how fonts work in Espruino. I like Espruino's 6x8 bitmap font and I couldn't find anything alike online (all fonts I found in that size with extended characters are serif fonts that look ugly and waste space on displays), so I ended up actually drawing my own font based on the 6x8.
My font Dennis8 not only supports German but most other european languages as well, such as Spanish, French, Italian, Portuguese, Swedish, Danish, Icelandic etc. The characters are located in the charset according to ISO 8859-1, so some characters used by Turkish, Polish etc. are present as well (but not those outside of the 8bit address space).
While I was already at it, I included some symbols I found in other fonts (used by popular LCD drivers) and even more symbols I found useful for embedded development, such as transport control buttons, arrows, a house (home) and some more.
The repository can be found here:
https://github.com/pastaclub/espruino-font-dennis8To try the font, include it like so:
require("https://raw.githubusercontent.com/pastaclub/espruino-font-dennis8/master/FontDennis8.js").add(Graphics); // Update: Since Gordon added the font to Espruino module repo, you can now do require("FontDennis8").add(Graphics);
Have fun!
Here's a demo:
-
What solved the problem with my display was the changed init sequence. Mine works fine without the delay.
In order to account for the slow power-up of other displays, the module could accept another parameter
delay
in theconnect
function... but then the connect would become asynchronous and developers would still have to make sure they don't use it before it's ready, so the complexity remains. Maybe a hint in the documentation is enough instead. -
From my experience with other NAND flash memories, I would strongly assume that you can only erase a whole page, because that's the way they work. There are non-volative RAMs out there as well, without that limitation, but they are much more expensive.
I'm not sure about this particular chip though.
-
-
-
I'm trying to make Olimex's ESP8266 board (MOD-WIFI-ESP8266 Rev. A) work with the Pico. I'm using the 10 uF capacitor. I don't have a shim (and it doesn't fit Olimex's board anyways).
The firmware version test revealed
"AT+GMR\r\r\n00160901\r\n\r\nOK\r\n"
at 115200 Bd, so the firmware version seems to be 00160901. I hoped it would work out of the box, but it doesn't. The example crashes with the following error message:>Uncaught ATE0 failed: no this fun at line 2 col 18
No this fun indeed. I figured that the best bet would be to update the firmware to one tested with Espruino, so I downloaded version 0.50.0.0.
With regards to the module documentation:
- Where it says "Connect to Espruino, copy and paste this code into the left-hand side, and disconnect" you might want to add that "disconnect" means to disconnect the WebIDE (and not disconnect the Pico from USB or the ESP from Pico)
- You might also want to add that Mac users first need to install pySerial as described here because otherwise the esptool will just crash with a cryptic error message
In order to put the the ESP into boot mode on the Olimex board, I actually had to solder: the GPIO0 solder jumper needs to be put into position 0 (more about this).
I successfully flashed the new firmware, soldered the jumper back to 1 and... nothing. Now the board doesn't respond anymore, also the firmware check program just returns 3 empty strings :(
What did I do wrong?
And what was I supposed to flash to where? The firmware zip files comes with many bin files, but the included readme is not clear. I flashed the
boot_v1.4(b1).bin
file to address 0 and theuser1.2048.new.5.bin
file to address 0x1000 - is that wrong? - Where it says "Connect to Espruino, copy and paste this code into the left-hand side, and disconnect" you might want to add that "disconnect" means to disconnect the WebIDE (and not disconnect the Pico from USB or the ESP from Pico)
-
Returning the other buffer from now on will also break existing code (of people who have figured out how to use the old implementation properly, although we're probably not speaking about many).
Everybody will be happy as long as they know how to use it, so the documentation should mention which buffer is passed by the event, and the update notes for the firmware should also be verbose about the change in behavior.
-
You could name it W25 and have a list of devices that it has been confirmed to work with. I'm currently busy overseas and cannot contribute much, but I can continue to approve pull requests when they look alright. Thank you for these valuable contributions!