-
-
-
I've managed to get i2c working on the ESP32 - using parts of the arduino library.
The device supports 2 i2c devices - at this stage it's only one supported ( The version 1.0 sdk did not contain the spi and i2c api's as expected)
The bitrate seemed to default to 50000, so I needed to set to 100000 for it to work.
The esp32 needed to be powered up with the display Vcc left off and then turned on, otherwise the board would not intialise properly - it seem to be better feeding the display 5V directly.
I2C1.setup({"scl":D17,"sda":D16,bitrate:100000}); var lcd = require("HD44780").connectI2C(I2C1); lcd.print("Hello ESP32!!");
-
-
What the amazing thing is is how little code has been written. Look in the esp32 branch under targets. So far there is about 3 files!
For graphics and crypto - its all compiling cleanly and we don't need to do all the tricks like for the esp8266.
There is an sdk update due at the end of the month tht will give us spi and i2c, however @jumjum has found issues with the Uart.
I've got the telnet module linked in, however the connection from Uart to sockets needs sorting - not sure where to start yet..l
-
Thanks @Gordon
Ok. Maybe time to justify/invest in a logic analyser! Any recommendations? (cheap)
Using a poorman's Led on the signal line, I can see it glowing dimly.
The disable/enable interrupts are just stubs at the moment, as the espruino was pinned to a core I was wondering if that was not important - but probably is!
Time to read the sparse documentation again!
-
Any ideas how I can debug onewire library?
I think my wiring is ok, however ow.search() is not returning anything.
Would the onewire lib be using timer functions that might not be implemented properly yet?
I added this to get around an error, but have not got any futher:
case JSHPINSTATE_GPIO_OUT_OPENDRAIN_PULLUP: mode = GPIO_MODE_OUTPUT_OD; pull_mode=GPIO_PULLUP_ONLY; break;
-
@ollie - 8000 vars is too much.
Still seems to boot with 6000 vars. - and 7000!
>ESP32.getState(); ={ "sdkVersion": "1.0.0(c418d6b)", "freeHeap": 69312 } >process.env ={ "VERSION": "1v87.132", "BUILD_DATE": "Nov 28 2016", "BUILD_TIME": "20:47:04", "GIT_COMMIT": "114743c748dec1b9bc9b85fdd20ac7ccd300f5bb", "BOARD": "ESP32", "CHIP": "ESP32", "CHIP_FAMILY": "ESP32", "FLASH": 0, "RAM": 524288, "SERIAL": "240ac400-2f90", "CONSOLE": "Serial1", "EXPORTS": { "jsvLock": 1074612384, "jsvLockAgainSafe": 1074612520, "jsvUnLock": 1074615156, "jsvSkipName": 1074635332, "jsvMathsOp": 1074646944, "jsvMathsOpSkipNames": 1074650168, "jsvNewFromFloat": 1074629948, "jsvNewFromInteger": 1074629860, "jsvNewFromString": 1074628356, "jsvNewFromBool": 1074629920, "jsvGetFloat": 1074640852, "jsvGetInteger": 1074634132, "jsvGetBool": 1074641544, "jspeiFindInScopes": 1074661088, "jspReplaceWith": 1074660836, "jspeFunctionCall": 1074671164, "jspGetNamedVariable": 1074662684, "jspGetNamedField": 1074663072, "jspGetVarNamedField": 1074663180, "jsvNewWithFlags": 1074627972 } } >process.memory(); ={ "free": 6968, "usage": 32, "total": 7000, "history": 13 } >
-
https://www.espruino.com/Reference#l__global_clearInterval
If no argument is supplied, all timers and intervals are stopped
So it is doing what is says on the box...
-
-
-
Further progress made:
save()
works - and on reboot loads saved codewifi.save()
saves the current connects and reloads on reboot
So after wifi connect and save, here is a example using websockets:
function onInit() { console.log('on init...'); var wifi=require("Wifi"); //wifi.connect(ssid, {password: password}, function() { wifi.on('connected', function(details) { console.log("Connected to access point, listening for clients",details); var http = require("http"); function onPageRequest(req, res) { //console.log(req); res.writeHead(200, {'Content-Type': 'text/html'}); res.end(page); } var page=` <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> </head> <body> <div class="well well-lgt"> <div class="panel-heading"> <h3>Websockets</h3> </div> <button class="btn btn-warning" id="send" onclick="ws.send(JSON.stringify({click:{count:count}}));;count=count+1;this.innerHTML='Send '+count">Send to Espruino</button> <ul id="list" class="list-group"></ul> </div> <script> var ws, count = 1; setTimeout(function () { ws = new WebSocket("ws://" + location.host + "/my_websocket", "protocolOne"); ws.jsend=function(o) { this.send(JSON.stringify(o)); }; ws.onmessage = function (event) { console.log({ msg : event.data }); var ul = document.getElementById("list"); var li = document.createElement("li"); li.className = "list-group-item"; li.appendChild(document.createTextNode(event.data)); ul.appendChild(li); }; setTimeout(function () { //ws.send(JSON.stringify({click:{count:count}})); //ws.send(JSON.stringify({info:{value:'Hello to Espruino!'}})); //ws.send(JSON.stringify({date:{date : new Date()}})); ws.jsend({info:{value:'Hello to Espruino!'}}); ws.jsend({date:{date : new Date()}}); }, 1000); }, 1000); </script> </body> </html> `; var ws_outer; function sendTime() { ws_outer.send(JSON.stringify({data:new Date().ms})); } var server = require('ws').createServer(onPageRequest); server.listen(80); server.on("websocket", function(ws) { ws_outer=ws; ws.on('message',function(msg) { console.log((msg)); }); ws.send("Hello from Espruino!"); sendTime(); }); }); };
open a browser with the address echoed:
Connected to access point, listening for clients { "ip": "192.168.15.11", "netmask": "255.255.255.0", "gw": "192.168.15.1" }
Still lots of vars free:
>process.memory(); ={ "free": 3858, "usage": 1142, "total": 5000, "history": 528 } >ESP32.getState(); ={ "sdkVersion": "1.0.0(c418d6b)", "freeHeap": 97864 } >
-
-
@JumJum
Where did you save the empty bin to was it 0x100000. ?Have you had a sucesssful save the works on power up?
-
@tve are you likely to get an ESP32 board?
-
I have a compiled version on Windows 10 working. This also works out of the box which looks promising:
make USE_CRYPTO=1 USE_TLS=1 USE_GRAPHICS=1 USE_AES=1
This means potentially we will be able to use https:// to hit other sites.
This is working:
require("http").get("http://www.google.com", function(res) { res.on('data', function(data) { console.log(data); }); });
={ "type": 1, "#onconnect": function (res) { ... }, "res": { }, "opt": { "protocol": "http:", "method": "GET", "host": "http://www.google.com", "path": "/", "pathname": "/", "search": null, "port": null, "query": null }, "dSnd": "GET / HTTP/1.0\r\nU" ... "ww.google.com\r\n\r\n", "sckt": 3 } <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>302 Moved</TITLE></HEAD><BODY> <H1>302 Moved</H1> The document has moved <A HREF="http://www.google.co.nz/?gfe_rd=cr&ei=HtMvWK6XD9TN8genzLygCQ">here</A>. </BODY></HTML>
however this errors:
require("http").get("https://www.google.com", function(res) { : res.on('data', function(data) { console.log(data); }); :});
Connecting with TLS... ERROR: Unable to create socket ={ "type": 5, "#onconnect": function (res) { ... }, "res": { }, "opt": { "protocol": "https:", "method": "GET", "host": "http://www.google.com", "path": "/", "pathname": "/", "search": null, "port": null, "query": null }, "dSnd": "GET / HTTP/1.0\r\nU" ... "ww.google.com\r\n\r\n", "closeNow": true }
I've also got issues with
save()
- if you do this it appears to corrupt the flash memory and the board won't boot on reset and needs to be re-flashed. I've put more detail on the gitter.im feed -
-
I'm using Version 54.0.2840.99 m chrome on windows 10.
https://googlechrome.github.io/samples/web-bluetooth/device-info.html
Requesting Bluetooth Device... Argh! NotSupportedError: Web Bluetooth is not enabled on this platform. To find out how to enable it and the current implementation status visit https://goo.gl/HKa2If
this leads to here:
chrome://flags/#enable-web-bluetoothWeb Bluetooth Mac, Linux, Chrome OS, Android Enables Web Bluetooth which could allow websites to connect to and control Bluetooth devices around you. [#enable](https://forum.espruino.com/search/?q=%23enable)-web-bluetooth Sorry, this experiment is not available on your platform. BLE Advertising in Chrome Apps Chrome OS Enables BLE Advertising in Chrome Apps. BLE Advertising might interfere with regular use of Bluetooth Low Energy features. [#enable](https://forum.espruino.com/search/?q=%23enable)-ble-advertising-in-apps Sorry, this experiment is not available on your platform.
How do you enable?
Thanks
-
-
Thanks @JumJum
I'll test first with the binary you have built - thanks.I've been reading up on the tools chain etc - I'll document how to build under windows 10 with the bash/Linux subsystem when I get around to installing.
-
@Kolban
My adafruit dev esp32 board has arrived. Before I test a build is there firmware I can flash stored anywhere?Ideally it would be great to get the Esp32 built automatically with the Travis builds - to do this for the esp8266 @tve has hosted the toolchan.tar file on his server - we would need to do something similar for esp32...
Or are things still a little unstable to do this?
As the Windows version of chrome does not support web Bluetooth - has anyone tried in a virtual box vm running on windows with a USB Bluetooth set up to pass through to the vm?