-
-
-
-
I just tried creating an error in the code in the Web IDE and
minifying it - and errors do seem to be reported - like in the image
below.Me too, but using "simple optimizations" on user code, the minimization error blocks flash too quickly and disappear in order. My eyes are not that quick to memorize all the errors. Is there some way to lock or hold the error blocks on screen so I can review the errors?
Windows 8.1 64 Bit
Chrome 35.0.1916.153 m (no beta)
Espruino 1v70 2250 jsvars
Web-IDE v 45
Board: Espruino v 1.3 -
Tried 8/5 bigram build "again" today and the program still "hangs"
On/off, for the next few weeks, I will be trying again to see if, by some chance,
"updated Bigram firmware" might work on my chip.Too bad, if there isn't a reference from my purchased Espruino serial number or markings on the STM chip to ascertain if the chips can take the bigram firmware or not. Better yet, a yes/no diagnostic with flash/ram testing in the upper 16K
For now, I can live with 2250 jsvars. -
-
Sorry - I just checked and that is an old one without the variable
size changes. Try this one:Again, 2250 jsvars and the "new" link v70 (above) works with my application code.
As for bigram ...My application "hangs" after uploading to the Espruino. The only way to revive communications is to disconnect/hard reset/reconnect.
I will send my "top secret" private application code to an email destination for your
inspection. Just send me a message. -
The v70 on there should be the same as this one - as a reality check,
make sure you code uploads on this:
espruino.com/binaries/git/commit_date/2014-07-30%2017:00:29%20+0100/quote from @DrAzzy Do note that the official github builds now have 2250 jsvars.
Ok, this "github" v70 firmware code works with my application user code Ok?
Note: The memory still shows 1800 jsvars? <---
Note: The upper ram test came back with the > after a few seconds.Next test "again" bigram ...
Update ...
Again, I did another 12 minute throttling of bigram firmware link: (http://drazzy.com/espruino/bigram/espruino_1v70_08-05_espruino_1r3_bigram.bin)My application "hangs" after uploading to the Espruino. The only way to revive communications is to disconnect/hard reset/reconnect.
Note: It runs fine on the github v70.@DrAzzy I can send you a portion of my "top secret" application, for your inspection, but you probably don't have the hardware to run it on.
-
I'm searching for a cheap WIFI solution capable for Espruino.
Better yet, just wait for 1Sheeld to release the firmware for the 1sheeld.
Get a cheap Bluetooth module and pair with the Espruino. Then use their
firmware (modified, of course) to run on the Espruino. Now you have a
Android/smartphone interface via Bluetooth with all the pre-made APPs from 1Sheeld. Is 5 dollars USD too much?
Note: You will be using the smartphone/android as your WiFi interface.
http://www.1sheeld.com/The CC3000 is a nice chip but the firmware was designed by morons.
-
espruino.com/binaries/git/commit_date/2014-07-30%2017:00:29%20+0100/
This firmware link shows 1800 jsvars with v70?
Yes, i used the "control c" to no avail.
I tried firmware/and program throttling still with no change.
Guess I have one of the "bad" chips. Too bad there is not a pre-test that can
be run to see if your bigram can run?BTW ...Throttling adds the true meaning to slow. (7 mins)
-
-
@DrAzzy Good news/bad news
I have loaded bigram( Espruino v70) and it seems to work with simple programs but loading my application program "hangs" when uploading to the Espruino.
The only way I can get the command prompt ">" is disconnect/hard reset and then
reconnect.
Note: This application program always worked with the standard Espruino release firmware v69. BTW ... I loaded the new firmware 3 times and used flashclear to no avail. -
The errors will be because the code you're minifying has some problem
which means that the minifier can't handle it. I thought it should
have told you what the errors were, but you could paste it into
closure-compiler.appspot.com/home and see what it says.Hmmm ... The Espruino won't optimize/minimize if there is an "unknown" error/warning?
An on-line Espruino javascript closure compiler -an Espruino double check - very cool indeed.I took the "LED test delay code snippet" out from the init() startup code.
Now I can simple optimize/whitespace (not advanced due to ?) ...digitalWrite([LED1,LED2,LED3],0b100);
setTimeout("digitalWrite([LED1,LED2,LED3],0b010);", 1000);
setTimeout("digitalWrite([LED1,LED2,LED3],0b001);", 2000);
setTimeout("digitalWrite([LED1,LED2,LED3],0);", 3000);From the on-line JS closure compiler warning ...
"simple"
JSC_PARSE_ERROR: Parse error. Binary integer literals are not supported in this language mode. at line 60 character 30
digitalWrite([LED1,LED2,LED3],0b100);BTW ... going from 1800 jsvars to 3250 jsvars using DrAzzy's bigram provides a much needed breathing room for code development. Thanks DrAzzy
Update ... bigram and my application don't agree with each other? -
I removed my GPS user code (to save code space for this testing) and did the following testing below:
Summary:
@Gordon Removing "all" text/comments from user code saved 149 in memory usage.@DrAzzy - fiddling with optimizations produced very mixed results.
Optimization #5 reduced memory usage but gave minification errors?
It looks like more work is needed in the optimizations for the Espruino?
Note: I did not try "all" combinations optimizations.More work is needed in increasing my user application memory usage ...
Comment removal Testing
1 Removed all comments from user application code
Default: Settings/communications Minification: No minification & Module Minification: Whitespace only (default?)
memory usage before: 1033
memory usage after: 884
savings: 149 <-------Error window block: None
Optimization Testing
2 Optimations combinations with no text in user code.
Minification: Whitespace Only
Module minification: Whitespace Only (Default?)memory usage before: 884
memory usage after: 884
savings: 0 - because of errors?Error window block ... Errors while minifying - sending unmodified code <-------
3 Optimations combinations with no text in user code.
Minification: Simple Optimizations
Module minification: Whitespace Only (Default?)memory usage before: 884
memory usage after: 884
savings: 0 - because of errors?Error window block ... Errors while minifying - sending unmodified code <-------
4 Optimations combinations with no text in user code.
Minification: Advanced Optimizations (not recommended)
Module minification: Whitespace Only (Default?)memory usage before: 884
memory usage after: 884
savings: 0 - because of errors?Error window block ... Errors while minifying - sending unmodified code <-------
5 Optimations combinations with no text in user code.
Minification: Simple Optimizations
Module minification: Simple Optimizationsmemory usage before: 884
memory usage after: 811
savings: 73 - with errors <---------???? code reduction with errors?Error window block ... Errors while minifying - sending unmodified code <-------
6 Optimations combinations with no text in user code.
Minification: No minification
Module minification: No minificationmemory usage before: 884
memory usage after: 958
savings: -74 (gain)Error window block: None
-
Out of resource memory --> RAM.
I have a GPS, I2C LCD 4x20, two I2C DS3231/2 RTCs and the 1800 memory units will not cut it with my New-Bee javascript user application code.
Is there a checkoff list that provides knowledgeable suggestions on how to reduce memory RAM usage to the bare minimum? Since I don't know the internal workings of the Espruino any help is appreciated.
-
Espruino Clock Module var Clock = require("clock").Clock; var clk=new Clock(2014,4,15,23,45,0,0); // Initialise with specific date var clk=new Clock("Jun 23, 2014 12:18:02"); // ... or Initialise with specific date from a string // every time the button is pressed, print the current time.. setWatch(function() { var d1=clk.getDate(); print(d1.toString()); // prints "Thu May 15 2014 23:45:05" }, BTN, { edge : "rising", repeat : true, debounce : 10 } ); // You can also update the current time clk.setClock(Date.parse("Jun 23, 2014 12:18:02"));
From above ...
var clk=new Clock(2014,4,15,23,45,0,0); // Initialise with specific date
print(d1.toString()); // prints "Thu May 15 2014 23:45:05"It does what it says BUT the number "4" for the month is April and 5 should be for May.
Looks like someone started to use, for the months, 0-11 and not the normal 1-12?
Are you going to keep the months index this way?Windows 8.1 64 Bit
Chrome 35.0.1916.153 m (no beta)
Espruino 1v69
Web-IDE v 45
Board: Espruino v 1.3 -
-
Modules are searched in local folder first, before searching in the
internet.Great, now I am able to patch or modify library modules to my liking and keep
them private from the internet.On another note ... there should be strict revision version control on all library modules on the internet so users can either chose between keeping their local modules or using the "default" internet modules.
-
Of course, I could do one of the following:
Use a terminal program (Non WEB-IDE) and lose the extremely easy to use syntax checking the WEB-IDE provides.
Just publish my new "top secret" module(s) on Github for the Internet to see and use.
Install and use XAMPP-apache webserver but for a novice or new-bee this would be a non-starter.
Force/fake the WEB-IDE to look at the SD card and constantly swap out the SD and wear out the transflash socket.
There has to be a better and easier way. Like directing the WEB-IDE to a C: drive folder for modules?
-
I made a modified module and put this module in the "node_modules" folder on the SD card.
When I try to download my code to the Espruino with the proper require("xxxx") a pop-up window says file "xxxx" not found ?
STAND-ALONE ESPRUINO If you have an Espruino with an SD card (but
you're not using the Web IDE), you can copy the modules you need
into a directory called 'node_modules' on the SD card. Now, whenever
you write require("modulename") the module will be used.Are you saying I can't use the WEB-IDE with a "Stand-Alone Espruino?"
There should a software flag in the WEB-IDE to select either the Internet or default to the local SD card using the WEB-IDE?
-
-
-
Issue #1 @ v67 -- console respond to reset() does not always return with a >
sometimes it hangs mid response feedback. In v66 the response is consistent.Issue #2 Unknown errors in v67 but in v66 all responses/feedbacks/warnings OK
Test code in pasted first then v66 responses and then v67 responses.
Note: I still had to duplicate the I2C setup away from the onInit() to make the code work?/* DS18B20 Data Logger Rev. 1.0b 7/17/14 Espruino: v 1.3: firmware: v 66 WEB-IDE: v 45 Windows 8.1 / Chrome Hardware: I2C 4x20 LCD, DS18B20, I2C RTC DS3231 Bugs: Memory usage leak fixed in v67 Program description: Uses 1-wire DS18B20 for the temperature sensor. The DS18B20 temperature is logged along with time/date to SD and LCD. 1 1-wire and 1 I2C bus is used. Program credits: SD data logger code snippet was used from an unknown Espruino forum member. Note: 3.3k pull-ups for I2C LCD/RTC. */ var ow,sensor,lcd,rtc; function onInit(){ ow = new OneWire(A1); sensor = require("DS18B20").connect(ow); sensor.setRes(12); digitalWrite([LED1,LED2,LED3],0b100); lcd = require("HD44780").connectI2C(I2C1); I2C1.setup({scl:B8,sda:B9}); lcd.clear(); setTimeout("digitalWrite([LED1,LED2,LED3],0b010);", 1000); setTimeout("digitalWrite([LED1,LED2,LED3],0b001);", 2000); setTimeout("digitalWrite([LED1,LED2,LED3],0);", 3000); // Delay start-up for diagnostics (above) and for LCD clear I2C1.setup({scl:B8, sda:B9}); rtc = require("DS3231").connect(I2C1); // stop noise on A10 ? pinMode(A10,'input_pullup'); } var fs = require('fs'); var testName = "TEST152Q.LOG"; var testDetails = "Data Logging DS18B20 to SD"; var logInterval = 5000; var logEntry = 0; /* Set Dow Time/date - comment out lines out below after first use! Usage: rtc.setDow("day of the week") Monday,Tuesday ... rtc.setDate(date,month,year);1-31,1-12,0-99 rtc.setTime(hours,minutes); Military Time Set time exactly on minute roll-over (+ 1 min) */ //rtc.setDow("Thursday"); //rtc.setDate(26,6,14); //rtc.setTime(19,25); ow = new OneWire(A1); sensor = require("DS18B20").connect(ow); lcd = require("HD44780").connectI2C(I2C1); I2C1.setup({scl:B8,sda:B9}); I2C1.setup({scl:B8, sda:B9}); rtc = require("DS3231").connect(I2C1); // Initialise log file here with header information //console.log(testDetails); <---- do not leave in without USB (will halt) fs.appendFileSync(testName, testDetails); // Function to log some data every so often setInterval(function(){ // Indicate each time function is executed digitalPulse(LED1, 1, 100); // Log some data. logEntry++; var logString = logEntry + " " + (sensor.getTemp(true)* 1.8 + 32 + " F. ") + (rtc.readDateTime()) + " " + "\r\n"; //console.log(logString); <---- do not leave in without USB (will halt) //console.log(process.memory().usage); <--- do not leave in without USB (will halt) fs.appendFileSync(testName, logString); lcd.setCursor(0,0); lcd.print("DS18B20 Logging ..."); lcd.setCursor(0,1); // lcd needs a string lcd.print("TempF: " + new String(sensor.getTemp(true)*1.8 + 32)); lcd.setCursor(0,2); lcd.print(rtc.readDateTime()); lcd.setCursor(0,3); lcd.print(new String(process.memory().usage)); lcd.print(" "); lcd.print(new String(Serial1.available())); }, logInterval); onInit();
reset();
=undefined
| |_ ___ ___ _ ||___ ___
| |_ -| . | _| | | | | . |
||| || |_|||_|_||_| http://espruino.com
1v66 Copyright 2014 G.Williams
echo(0);
WARNING: I2C device not responding
WARNING: I2C device not responding
WARNING: I2C device not responding
WARNING: I2C device not responding
WARNING: I2C device not responding
WARNING: I2C device not responding
=undefined
save()
=undefined
Erasing Flash.....................
Programming 36000 Bytes.......................................
Checking...
Done!
Running onInit()...
reset();
=undefined
| |_ ___ ___ _ ||___ ___
| |_ -| . | _| | | | | . |
||| || |_|||_|_||_| http://espruino.com
1v67 Copyright 2014 G.Williams
echo(0);
Uncaught Error: I2C device not responding
at line 2 col 7
4,e,e])}^
in function "a" called from line 1 col 8
{a(51,1);a(50,1);a(40,1);a(12,1);a(6,1);a(1,1);return{write:...^
in function "f" called from line 2 col 9
4,e,e])})}^
in function "connectI2C" called fromuline 1 col 41
lcd = require("HD44780").connectI2C(I2C1);^
=undefined
-
I removed all text/comments for code reduction.
There are no arrays (if any, very few) used in the program code.
Simple minification is turned on.
The problem is all the algorithms needed to support my user application are huge. Devices like GPS, two precision RTC (real time clocks), a 4x20 LCD display, a WS2811 dot matrix, an accelerometer and other sensors. I am taking the Espruino to the max of 2250 jsvars.