-
and removing the code you have below that also sets those sensors up?
Here's the problem ...
"If I remove the code you have below" it won't run in RAM because the function
onInit() has the device(s) setup code? Only when I do a flash "Save()" will the
function onInit() will run? The problem is ... if the code will not run
in RAM first, it sure will not run in flash by doing a save()?
For your testing, I had to leave in the I2C setup code.On another very minor issue ...
I believe you put a patch in v66 for Serial1 noise. In v65 by printing to the LCD Serial1.available() nothing happens on the console screen. In v66, leaving
the console connected (USB), I get " a list of "Warning: String buffer overflowed maximum size (512)" when ever I print to the LCD the function "Serial1.available()?Test code ...
/* DS18B20 Data Logger Rev. 1.0b 7/9/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 657 but after a few days increases to 667 ??? 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); } var fs = require('fs'); var testName = "TEST152Q.LOG"; var testDetails = "Data Logging DS18B20 to SD"; var logInterval = 5000; var logEntry = 0; var ow = new OneWire(A1); var sensor = require("DS18B20").connect(ow); I2C1.setup({scl:B8,sda:B9}); var rtc = require("DS3231").connect(I2C1); /* 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); I2C1.setup({scl:B8, sda:B9}); var lcd = require("HD44780").connectI2C(I2C1); lcd.clear(); // 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"; // var logString = logEntry + " " + 1234 + // (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.print("TempF: " + "5678"); 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);
-
I assume you've verified that the log files are clean?
The data on the SD card seems OK
Since I posted the code (above), if someone else could run and verify the same memory leak problem? After all, the complete DS18B20 logger is hooked up on a "capacitance" breadboard and the problem could be hardware.
-
After a few days of 5 second temperature logging, the memory usage units increase from 657 to 667. The Serial1.available() still had zero on the LCD display. <-----
So, in conclusion, it was not the console serial port A10?The "possible" very slow memory leak might be comming from any of the sensor or devices. I2C LCD, I2C RTC, 1-Wire DS18B20 or the buit-in SD card? It could be even in program, module or firmware?
New memory leak testing changes:
Disabled the 1-wire DS18b20 sensor read with a fixed constant.
On line 76 (above), I replaced the 1-wire "(sensor.getTemp(true)* 1.8 + 32 + " F. ")" with a fixed constant "1234" and on line 86 (above), I replaced "lcd.print("TempF: " + new String(sensor.getTemp(true)*1.8 + 32));" with a fixed constant of "5678"After a few days of testing, the memory "unit" usage again increased by 10 and the Serial1.available() still stayed at zero. Still no help - any suggestions
welcomed <------<<<<Espruino: v 1.3: firmware: v 66, WEB-IDE: v 45, Windows 8.1 / Chrome
-
Ok, Serial1.available() reads 0(zero) on the I2C LCD 4x20 display when the Espruino
is not connected to the USB. I will give it more run time testing.
Note: I am reading "Serial1.available()" every 5 seconds.Note: The I2C LCD display comes in extremely handy for troubleshooting an
"unconnected" Espruino! (For $10 USD it can't be beat anywhere)
http://yourduino.com/sunshop2/index.php?l=product_detail&p=332
"sorry for the plug" -
Are you running the latest 1v66?
Yes, Last week I just obtained 1v66 and had to reload the firmware.
It's possible that a little noise gets on pin A10, is interpreted as a
character, and then causes the leak?I not sure I understand. The data logger program (above) does not even use A10?
If you are still hitting problems with 1v66, are there any error
messages shown?Without the computer connected to the Espruino, there would be no way of telling?
I cannot tie my PC up for weeks at a time for this testing.
Note: I created a "standalone" hardware configuration in which the Espruino, DS18B20, LCD 4x20 runs off of a wall-wart.Maybe, its the 1-wire "12 bit" DS18B20 and I will try substitute this temperature sensor with a constant?
-
-
One suggestion for constantly removing the Espruino micro cable ...
Find a very short "micro" USB cable to always plug-in to the Espruino.
Then get a USB "A to A" in-line female adapter and mate it with another longer USB cable.
Just break the USB cable at the in-adapter and leave the short cable always connected to keep from wearing out the micro USB.http://www.monoprice.com/Product?c_id=103&cp_id=10314&cs_id=1031401&p_id=362&seq=1&format=2
-
Being a hard core Arduino user, I decided to switch to the Espruino.
I put together a DS18B20 data logger. After a few days, I noticed
on the I2C LCD, that memory usage was increasing from 646 to 651.
Any help is appreciated to track down this memory leak. (See code below)BTW ... I am very impressed with the amount of program code needed for this project. It would of taken thousands of lines of code for the Arduino.
/* DS18B20 Data Logger Rev. 1.0b 6/26/14 Espruino: v 1.3: firmware: v 65 WEB-IDE: v 45 Windows 8.1 / Chrome Hardware: I2C 4x20 LCD, DS18B20, I2C RTC DS3231 Bugs: Memory usage 646 but after a few days increases to 651 ??? Program description: Uses 1-wire DS18B20 for the temperature sensor. The DS18B20 temperature is logged along with time/date to SD and LCD. 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. */ function onInit(){ var ow = new OneWire(A1); var sensor = require("DS18B20").connect(ow); sensor.setRes(12); digitalWrite([LED1,LED2,LED3],0b100); var 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}); var rtc = require("DS3231").connect(I2C1); } var fs = require('fs'); var testName = "TEST152L.LOG"; var testDetails = "Data Logging DS18B20 to SD"; var logInterval = 5000; var logEntry = 0; var ow = new OneWire(A1); var sensor = require("DS18B20").connect(ow); I2C1.setup({scl:B8,sda:B9}); var rtc = require("DS3231").connect(I2C1); /* 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); I2C1.setup({scl:B8, sda:B9}); var lcd = require("HD44780").connectI2C(I2C1); lcd.clear(); // Initialise log file here with header information console.log(testDetails); 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)); }, logInterval);
-
-
-
-
dis-reguard - extension js still not working but that's not a big issue.
If the file does not have the js extension, when "saved as" it creates a normal file.
Since, in my case, I selected a document file folder which only holds files created
from Espruino then all I do is rename with the extension "js" -
I pulled it again and it now says v45. The previous v44 had the "save as" fix already in the Github pull.???? Now the only nickpic is the file extension not
defaulting the "js" and not being able to change the type of file. I can live with putting in, for each "save as" file ".js" but for some it is a hassel.It seems to work fine for me.
Do you have Windows 8.1?
Windows 8.1 64 Bit
Chrome 35.0.1916.153 m (no beta)
Espruino 1v65
Web-IDE v 45
Board: Espruino -
-
-
-
Note: The Web-IDE version did not change - still is v 44 <-----????
The save-as works but you have to put in place of "code" --> "codexxx.js" extension. (".js")
There is no file type selection - it's lockout.Windows 8.1 64 Bit
Chrome 35.0.1916.153 m (no beta)
Espruino 1v65
Web-IDE v 44
Board: Espruino -
Due to I2C addressing device conflicts, I need 2 I2c buses in my program.
Question #1: Can I used (both) two I2C buses (B6 B7) & (B7 B8) ?
If possible, state the instances I can use for both buses.Question #2: I2C Class shows instances of I2C1,I2C2&I2C3
and since the Espruino has just 2 buses (I2C1 & I2C2) that can
be used BUT the software rejects using I2C2 but likes only I2C1?Question #3: The Espruino board layout pins only
shows "same" I2C1 on both pins (B6 B7) and (B8 B9)?Windows 8.1 64 Bit
Chrome 35.0.1916.153 m (no beta)
Espruino 1v65
Web-IDE v 44
Board: Espruino -
http://www.espruino.com/Mounting and use "hot glue" on the mounting hardware. I used hot glue on everything due to the fact it can be removed easily.
-
PC/Windows 8.1 64 bit Chrome Version 35.0.1916.153 m
Using "blocks" to construct simple code for the Espruino, for the first
time, shows an obvious bug/error. When choosing any GPIO from the
drop-down list, any GPIO not visible on the drop-down display screen,
the user has no means to choose other GPIO not visible on the screen.
Note: The GPIO list is very long and cannot be displayed all at the same time.
Not able to cursor or mouse roll-down to the other non-visible GPIO
prevents the user from non-access to all GPIO in the block logic
generator pane. The user is also prevented from just typing in a GPIO
location.Example: Under "Espruino block" use the "digital read pin block" and
try to choose or check off any GPIO not displayed on the desktop screen. -
Are you using anything non-standard (like a Chrome beta version) that might be causing it, or is it a totally normal Windows install?
Just the normal Chrome (non-beta) install. For windows, I upgraded from the standard
widows 7 to 8.1 on this new laptop computer.Windows 8.1/x64 Chrome 35.0.1916.114m
-
do you not get a 'save as' dialog?
NO, it generates sequential file(s) with the format "code(x).js" on the bottom
download task bar it generated, on using the save command, from the WEB-IDE
and does not allow "save as". I was hoping to have organized "Arduino like" folder(s) for all my Espruino projects.
Windows 8.1/x64 Chrome 35.0.1916.114mNote: The only options, in the folder dropdown box arrow is ...
"open"
"open files of this type"
"show in folder"
"cancel" -
Under windows 8.1 / using Chrome saving a file from the Web-IDE produces a
generic java script file in the download files directory.Is there a preference to change this generic file name and the directory in which it is downloaded? I would like to keep a special java script backup folder with user friendly file names. Using a "save as" file under download would be helpful.
@Gordon... I did everything what you instructed (above) "to the T"
I did a trace file at the beginning of the testing and could not
do another trace file because the memory "usage" did not change!
In fact, the memory usage is rock solid as in the rock of Gibraltar!
After a day of running off of the USB, I switched overnight to a
remote offline power supply with the same results - so far.
It must be the pullup on the serial1 receive line?
I will be running it for a few more days of testing.
BTW ... Its cool to have the Espruino to tell the user that the
"console was moved from serial1"
Update ... after four days of remote logging testing, the memory usage did
not change. End of testing.