JavaScript on ESP32 - Duktape

User avatar
Frida854
Posts: 14
Joined: Sat Dec 24, 2016 11:51 am
Location: Middelfart, Denmark

Re: JavaScript on ESP32 - Duktape

Postby Frida854 » Tue Jan 24, 2017 1:10 pm

After several sleepless nights, (just kidding), I downloaded all today.
esp-idf, xtensa-esp32-elf, template and duktape-esp32.
Without running duktape-install and duktape-configure, I just compile, did a flash_erase and flash and are now up running again.
Now on to some test again.
Thank you.
Yes Frida is my watchdog!

User avatar
Frida854
Posts: 14
Joined: Sat Dec 24, 2016 11:51 am
Location: Middelfart, Denmark

Re: JavaScript on ESP32 - Duktape

Postby Frida854 » Wed Jan 25, 2017 5:09 pm

A little error in "test_i2c_1.js"

line 21,22

Code: Select all

port1.beginTransmission(i);
var rc = port1.endTransmission();
changed to

Code: Select all

port1.beginTransaction(i);
var rc = port1.endTransaction();
then I found my sensor.

Have a nice evening
Yes Frida is my watchdog!

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: JavaScript on ESP32 - Duktape

Postby kolban » Wed Jan 25, 2017 5:46 pm

Thank you sir, code change in the source will be in the next update. The cause of this issue is an interesting one ... initially I coded the I2C language as being sent in blocks of "transmissions" and then as I studied more, I found they were more commonly called "transactions" so changed the API but failed to work back through the tests. So the issue was one of governance. However, this brings up a broader consideration. Right now the number of ESP32-Duktape users that I know off can be counted on one hand so changes and decisions can be made without too much impact. However, not forgetting that this is a 100% open source project, I feel bad making unilateral decisions that would affect negatively scripts and code good folks like yourselves have already written. One solution would be to release nothing until everything was polished ... but I'm not a fan of that ... especially if we devote tons and tons of time to the project only to find that there is no interest. Another solution is to just have "faith" that we are all making changes based on sound reasons and accommodate the breakages. However, I for one am very open to community decision making ... if we (the community) wish to have alternative governance mechanisms for a project such as this, then we can make that happen.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

BuddyCasino
Posts: 255
Joined: Sun Jun 19, 2016 12:00 am

Re: JavaScript on ESP32 - Duktape

Postby BuddyCasino » Sun Mar 12, 2017 12:35 pm

Quite an interesting project! I noticed Bluetooth taking 64K too, and it seems like a lot at least for BLE. Maybe Espressif can say something if this is going to remain that high?

If I may add my 5 cents regarding governance: its a bit too early to worry about that, just "move fast and break things". You'll want tight feedback loops to ensure the best quality, and breaking stuff is absolutely required for that to happen. For inspiration, look at how Rust got developed. There will be a time when you'll have a 1.0.0 release where you have to make API guarantees, but until then, the most precious resource is passion and momentum. Optimize for that.

WiFive
Posts: 2086
Joined: Tue Dec 01, 2015 7:35 am

Re: JavaScript on ESP32 - Duktape

Postby WiFive » Sun Mar 12, 2017 8:43 pm

BuddyCasino wrote:Quite an interesting project! I noticed Bluetooth taking 64K too, and it seems like a lot at least for BLE. Maybe Espressif can say something if this is going to remain that high?
https://github.com/espressif/esp-idf/co ... 66599fe133

BuddyCasino
Posts: 255
Joined: Sun Jun 19, 2016 12:00 am

Re: JavaScript on ESP32 - Duktape

Postby BuddyCasino » Mon Mar 13, 2017 12:49 pm

Thanks! 34k for BLE sounds more reasonable, but still kinda high. Nordic Semi does it with 8K I think.

opichals
Posts: 1
Joined: Mon Jun 12, 2017 8:11 am

Re: JavaScript on ESP32 - Duktape

Postby opichals » Mon Jun 12, 2017 8:18 am

Hi there!
I have been playing with https://www.espruino.com/ quite a bit now and I am wondering what the status of this duktape https://github.com/nkolban/duktape-esp32 port. From what I have read here and from the github repo I see not much activity recently. Is it that we are waiting for the 4MByte RAM boards? Is it purely esp32 port (I mean sometimes not much is necessary and esp8266 or other extra cheap board is just fine).
Best Regards
Standa

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: JavaScript on ESP32 - Duktape

Postby kolban » Mon Jun 12, 2017 2:06 pm

Hi there. In my tests, I had been running low on RAM while trying to do what I wanted in Duktape on the ESP32. I now have an instance of the WROVER with its 4MBytes of PSRAM and built a copy of Duktape on it and am delighted to report that it does indeed show a full 4MBytes of available heap. As such, I'll now be going back to Duktape to ensure that it all the other functions are good.

Given the plethora of environments available for the ESP32, I'm not sure how far I'll take it. Interest in the project isn't particularly high and there are a world of other ESP32 related items that are also of interest to the community.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Walter
Posts: 1
Joined: Sun Jul 23, 2017 10:23 pm

Re: JavaScript on ESP32 - Duktape

Postby Walter » Mon Jul 24, 2017 1:17 pm

Dear Neil,

First of all thank you for your massive work and and great ESP32 presentations on Youtube (really easy listenable and practically valuable. Truly one of best I have been listening to)

I have found this question to you by @cmason and your answer to it partially answered my own one. However I decided to get sure and clarify.

I intend to develop a portable standalone sensor device which would be used to take data measurements in the field during an expedition and initially log data to flash memory. Upon return to the lab, device would connect to the WiFi and move the data to the PC i.e., as you have described in your tutorial “Charting sensor data”.

Most of my code can be written in C++ and C so I would probably be fine without any LavaScript engine at all, but I need to implement a user friendly WiFi configurator (exactly what ESP32-Duktape has).

If I understood correctly It would probably be best to use Duktape original libraries in my C++/C code for that purpose? Or do you think it is still an overkill and some simpler alternative could be used instead?

Many thanks in advance for your comment!

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: JavaScript on ESP32 - Duktape

Postby kolban » Wed Jul 26, 2017 7:00 pm

The Duktape support provides a JavaScript environment for writing JavaScript based applications. Much of it is itself written in JavaScript. If you are comfortable programming in a C or C++ environment, I would suggest sticking to that as you will find the most pre-existing code fragments and answers on the forums. However for many users, JavaScript provides a better experience for them ... and it is as much personal taste as for technical reasons.

I get the suspicion that what you are looking for is not necessarily a programming environment but some pre-existing library for WiFi configuration. If you had that available in C/C++, would you still need and JavaScript support?

Neil
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: No registered users and 7 guests