-
Hello,
I have firmware 0.924 as recommended in the documentation and I have a similar problem. The callback function of the connect function of the driver is never getting called. I checked the response of the ESP8266 by using Serial4.on('data', ...) and I got the AT+CWJAP error as well.
AT+CWJAP="","" ERROR
I am using Espruino 1.75.
Best,
Tobias
-
-
-
-
-
Hello again,
I experienced that the Date class has no setters like:
Date.setHours(Number); Date.setMinutes(Number); Date.setSeconds(Number); ...
How can I create a new Date() object for example for today, but time of day 12:00 for example?
In regular JavaScript I write something like this:
var d = new Date(); d.setHours(12); d.setMinutes(0); d.setSeconds(0);
In Espruino this doesn't work :(
Best,
Tobias
-
-
Hello everyone,
I plan to let my Espruino wake up on a specific alarm time. In the meantime the board should be ideally in deep sleep mode.
Is there a better way to realize that instead of waking the board by an interval to check the time frequently?
Maybe there could be a feature "setWatchTime" in the future.
Best,
Tobias
-
-
-
-
Dear community,
sorry for writing again about problems I experienced with Espruino. I used the latest build of 1.75.
I experienced that the "close" event of the http response is not raised for the same get request. No matter how often I try. On the other side I am using the Express JS framework. With other HTTP clients it works well.
var request = function() { var body = ""; var options = { method: 'GET', host: '192.168.0.11', port: 3000, path: "http://localhost:3000/api/Entities/54fabe55ef581d7d5f8bcac1/tasks?filter[where][active]=true&filter[fields][id]=true&access_token=I9sbI5cy6m1gHONeNmCHULGX4CwSGBzC0RDdnPDCfMW4or2UmDyxWg0ZbnQAT1yN", headers: { "Content-Type": "application/json", "Content-Length": body.length } }; var contents = ""; var req = require('http').request(options, function(res) { console.log(res); res.on('data', function(data) { contents += data; }); res.on('close', function() { console.log('CLOSE'); if(res.statusCode === "200" || res.statusCode === "204") { console.log('OK'); } else { console.log('FAIL'); } contents = ""; }); }); req.on('error', function(e) { console.log('Error'); }); req.write(body); req.end(); };
The response looks ok:
{ "headers": { "X-Powered-By": "Express", "Vary": "Origin, Accept-Encoding", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "Content-Length": "2", "ETag": "W/\"2-d4cbb29\"", "Date": "Wed, 11 Mar 2015 13:30:53 GMT", "Connection": "close" }, "httpVersion": "1.1", "statusCode": "200", "statusMessage": "OK", "#ondata": function (b) {l+=b} }
How can I handle such problems with the http class of Espruino? What is the problem, that the "close"-event handler is not getting called?
Best,
Tobias
-
-
-
-
Dear community,
I tried to pipe an http response directly to a file to save RAM. I experienced that sometimes the file contains the right content, sometimes it contains strange characters. Furthermore the "complete" function defined in the pipe options is never getting called.
I formatted the SD card before I tested and I typed E.unmountSD() to be sure that it is not a problem with the SD card filesystem.
Could you please help me? Below you find the function.
Best,
Tobias
var downloadFile = function(path, filePath) { var file = E.openFile(filePath, 'w'); var body = ""; var options = { method: 'GET', host: '192.168.0.11', port: 3000, path: path, headers: { "Content-Type": "application/json", "Content-Length": body.length } }; var req = require('http').request(options, function(res) { res.pipe(file, { chunkSize : 32, end: true, complete: function() { console.log('Complete'); } }); res.on('close', function() { console.log('Closed.'); }); }); req.write(body); req.end(); };
-
-
-
-
-
-
-
Hello again,
I still have the problem that 12 bytes are missing at the end of my file, when I use the pipe function like I wrote in my last post. Any ideas what I could do to get it working? I use the code above with a chunkSize of 512.
Best,
Tobias