Espruino on ESP32 #6888
Replies: 1 comment
-
Posted at 2016-09-23 by @gfwilliams There's another thread on this as well, with some of my comments: http://forum.espruino.com/conversations/292525/#comment13203153 But yes, I'm happy for whoever wants to to have a go at this. Just start a new ESP32 branch in the Espruino project (not a new repo). I just added a new ESP32 label, and you can tag issues with that (it's easy enough to search for only issues with certain labels). Please try to document in your code, or in the repo itself (as Posted at 2016-09-23 by @gfwilliams And yes, as long as it doesn't mess anything up I'm happy having it in master. I think initially the Makefile's likely to start getting even more insane than it currently is, so a branch might be better until it calms down :) ... If anyone wants to use this as a reason to split the Makefile out into per-target (STM32/EFM/ESP8266/NRF/etc) files that get executed I'd be super happy :) Posted at 2016-09-23 by @allObjects Having reviewed earlier the specs, I see quite some potential in this 2 core setting. Foremost it gives relieve on the issue of the 3 main tasks on single core:
Integration of latter two is already included in Espruino, which makes it just a 2 main tasks operation and a good match for 2 cores. Having more resources available - memory and cycles - is convenient for application development but is heading in a different direction as Espruino - at least - for the past was - and still is - going for: smaller and less power demanding at runtime (even though it included some memory increase). Wifi always needs significant power, one can say... but the new Espruino Wifi alreadt provides both wifi and low power Espruino in a decoupled way. The new ESP32 device can not go that frugal. Giving ESP32 a shot and see where it leads to is for sure worth a try... and should even include a slimming down of the ESP32 infrastructure (OS) to a minimum in favor of 'the Espruino side' of the overall implementation. Latter would at least stay true to the original spirit of Espruino: keep it simple and easy to use, all through JS! Posted at 2016-09-23 by DrAzzy I would love to see Espruino running on this bad boy! The dual core looks like a real killer feature here - am I correct in thinking that that will mean that the WiFi will be done on one core, so we'll be free from the watchdog's leash on the other? I'd be happy to throw some beer money at Neil Kolban or the other greats of these here parts for making the ESP32 drink javascript. :-D Posted at 2016-09-23 by Wilberforce I'll be happy to help where I can. The esp8266 has been a bit frustrating fighting against heap and rom firmware sizes, so having those constraints removed would be great. It would be even better if Gordon produced a board with the module, so that it would not be a second class citizen... And be a part of the espruino family. Posted at 2016-09-24 by JumJum Sounds like an interesting project. Posted at 2016-09-24 by Kolban I would suggest the following ... this is going to be a long post ... sorry for that ... I'd like the project to be 110% open with no private repositories and complete and open communication between us all. We bring different skills, experiences and interests to the table. Whether one is a kernel C programmer, a JavaScript tinkerer, a hardware designer or just a consumer of the eventual Espruino on ESP32 ... we all get to play. There will be opportunities for folks to write tests, play with builds, write up notes, guides etc etc. So no-one should feel left out. In addition, if one is merely "interested" in an area, we can make time to chat, discuss or write it up. There need be no hidden knowledge and the more we share, the more eyes on the project ... the better. The project is a game in two halves. We start with the excellent code and architecture which is Espruino today. This code base has excellent support for alternate platforms (ESP32 is considered a platform here) and allows us to create "code" that is platform specific while the majority of the Espruino iceberg is platform independent and hopefully needs not be touched for an ESP32 port. The second half of the story is the new ESP32 platform. As I study this device, I find that the documentation is still being baked. As such, there is going to be much to learn in this area and there are no experts we can lean upon at this early time. Much of what was learned from the ESP8266 port can be leveraged ... but also ... much is new. It is appearing unlikely that Espruino for ESP8266 will "just compile" on ESP32. The underlying framework has changed to a real time operating system (FreeRTOS) and the networking APIs changed to be the "sockets" API. The runtime libraries and compilation procedures have also all changed. Then there is the elephant in the room ... availability of ESP32s. We don't know how quickly they are being produced nor their prices. They will eventually come down to a few dollars each (guess) but availability and price may not reflect this in the short term. Thankfully, I have an instance and we can "share it" over the network when needed. What this says, is that the project can be broken down into a wide variety of factors and tasks. Does anyone have any opinions or recommendations on how we manage and track these? The source code control system will be a branch in Espruino Github. That way the source changes and issues we raise will be recorded in history for the project ... but what should we use for discussions and design plans? Maybe a Wiki page at Espruino Github? Maybe gitter chat? Maybe there is some other distributed project tracking mechanism available to us that one of us might recommend. As for desirable skills and reading ... some of the following would be ideal:
Again, knowing all of the above are not required ... a big project can be broken down into bite sized pieces and learning grows. Posted at 2016-09-25 by Kolban A community member suggested a gitter stream for ESP32 development/design discussions. This seems like a useful idea. A new gitter stream has been created called: https://gitter.im/espruino/esp32 This can be used to chat and record discussions on the ESP32 port and can serve as an informal history of chats we have had. Posted at 2016-09-26 by @gfwilliams Ok, sounds good! In that post I linked I mentioned that it might be preferable to aim to target FreeRTOS first, with as little ESP32 specific stuff as possible. This means that development can get started even without ESP32s, and will hopefully make it easier to port to other devices as well. Hell, you might even be able to find a board that has a debugger on it :) There are also some biggish changes to Espruino that would really help (removing the event queues), and doing that in a less ESP32-specific way would make it less of a hack. Posted at 2016-09-29 by the1laz For reference, I think this the last time espruino with freertos was attempted: Posted at 2016-10-06 by Kolban Status report: The good news is that we have a proto-type build of Espruino running just fine on the ESP32 with lots of room to spare. We have been taking a lot of notes as "we have hacked". Now it is time to put the proto-typing and loose testing aside and start again. The plan is to do as Gordon correctly desires and create a new branch for ESP32. In that branch we will build out the support for the "ESP32" as a new board but do so methodically and with documentation in the form of markdown to capture design notes, ESP32 specific environment setup (for building) and other goodies. To get us started, I'd like to solicit assistance from folks who have confidence in Git and Github. I know the theory but because we are working on a live system and as a community, it is always better to engage those who have experience. Discussions on this in the gitter stream. Posted at 2016-10-18 by Wilberforce Where are people getting their dev boards? Adafruit now has a waiting list, and the lopi (with micro python) shipping to new Zealand is £38 pounds! Posted at 2016-10-18 by Ollie @wilberforce There doesn't seem to be any supply at moment. I passed on the $15 Adafruit dev board a week back because of the shipping costs, but sort of wish I hadn't now. I haven't been able to find just the ESP32 (no dev board) anywhere either, and it seems the dev boards are now on preorder. Do you have a link for the lopi? I thought they where just fulfilling the kickstarter at the moment. Posted at 2016-10-18 by Frida Posted at 2016-10-19 by Ollie Thanks @frida, I will check that out. Posted at 2016-10-19 by Frida After I found the pin that sets the lopy in boot mode, then Espruino is running.
Posted at 2016-10-19 by Ollie Hey @frida. Looking at the link, you have the LoPy which can also be a LoraWan hub? I know there's been some discussion on here about LoraWan modules - is the hardware on the chip compatible with this work? There's also a WiPy on the website, which is built on ESP32 too, just $10 cheaper. I was impressed with the range figures they cite. I don't see 1km range advertised as part of ESP32 chipset specs, so would you know if this range assumes it's part of a LoraWan setup, or is it something they've added on the board which means we can expect a wifi access point or station to have this range? Great that you've got it running too, and I've no doubt I'll ask you which pin set flash/boot mode at some point :) Posted at 2016-10-20 by Frida The hardware are non disclosure, the same with the software. Posted at 2016-10-20 by Wilberforce The SyPi version comes out at the end of the month. This uses the sigfox protocol for very long distant (limited to 12 bytes every ten minutes). This next work is getting rolled out in New Zealand so I'm keep to get one of these boards. Posted at 2016-11-01 by Wilberforce The ESP32 dev board is back in stock at adafruit: https://www.adafruit.com/products/3269 68 or so in stock. @ollie Posted at 2016-11-01 by CanyonCasa How about the SparkFun ESP32 Thing for $20... Posted at 2016-11-02 by Wilberforce Looks like that is on back order... My order for adafruit has shipped - yay! Posted at 2016-11-02 by Ollie @wilberforce, thanks, just seen this but looks like they are gone again. I think that's the way to do it though - get some other bits to make the shipping easier to palate.. Posted at 2016-11-04 by gaetano https://www.adafruit.com/products/3320 ESP32 WiFi-BT-BLE MCU Module / ESP-WROOM-32 Posted at 2016-11-08 by Wilberforce @Kolban 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? Posted at 2016-11-08 by JumJum for first testing you can download from here Its latest version from my "playing with the chip". Source is available on [github] Posted at 2016-11-08 by Wilberforce Thanks @jumjum 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. Posted at 2016-11-19 by Wilberforce I have a compiled version on Windows 10 working. This also works out of the box which looks promising: This means potentially we will be able to use https:// to hit other sites. This is working:
however this errors:
I've also got issues with Posted at 2016-11-19 by Wilberforce @tve are you likely to get an ESP32 board? Posted at 2016-11-19 by JumJum I've had some problems with saved code after reflashing. Posted at 2016-11-19 by Wilberforce @jumjum Have you had a sucesssful save the works on power up? Posted at 2016-11-19 by Ollie I came across this. It seems there are some hardware issues that cannot be bypassed by firmware, and another revision of the board will be released next year. Maybe nothing that will impact the ESP32 port, but maybe worth bearing in mind if trying to get hold of an ESP32 now. http://espressif.com/sites/default/files/documentation/eco_and_workarounds_for_bugs_in_esp32_en.pdf Posted at 2016-11-19 by JumJum @wilberforce, 0x100000 is start of save area, which is 16 pages, each 4096 bytes. Posted at 2016-11-19 by JumJum BTW, adress in flash will change soon. Espressif uses a grown boot area. Posted at 2016-11-25 by Wilberforce Further progress made:
So after wifi connect and save, here is a example using websockets:
open a browser with the address echoed:
Still lots of vars free:
Posted at 2016-11-25 by Ollie Some great progress here. Has anyone make and arbitrary tests with > 5000 JSvars, to get a feel for what might be possible whilst keeping everything stable? Posted at 2016-11-25 by Wilberforce Not yet, still getting everything stable. How many vars are you thinking of? I think we would need to reserve more than 12k of flash for the save code area. There is still plenty heap space. Posted at 2016-11-25 by Ollie Don't have a number in mind. I'm just intrigued at what applications might be possible on ESP32 given there's so many GPIO pins. My inference is that programs which orchestrate all of those pins will need more memory to run and flash in which to save the code. I recall the ESP8266 port moving up/down a few times as things progressed through the porting process, and finally exceeding all (certainly my own) expectations at 1700 JSvars. So just interested to know if the upper memory (and save) space limits of ESp32 have been "prodded " yet and how realistic those limits might be. Posted at 2016-11-26 by Wilberforce Given there is 3mb of flash free, and js code can be run from flash - I'm not sure if there will be any practical limits! I tried to look up to see how many vars the Linux port uses - however there is nothing in the Linux.py file for variables Posted at 2016-11-27 by @gfwilliams Just fyi - the Linux port uses a slightly different method of variable storage that lets it dynamically grow the memory it uses (the MCU versions needs to allocate it up front) Even if you store code in flash, each function will use 2 or 3 vars to store the pointer to the code. But still - it's a big improvement. Posted at 2016-11-28 by Wilberforce @ollie - 8000 vars is too much. Still seems to boot with 6000 vars. - and 7000!
Posted at 2016-11-28 by Ollie @wilberforce at 7000 that's comparable to Espruino Wifi, but i imagine there is a lot of work to do yet, before can know if that's realistically attainable. Anyway thanks for the update :) Posted at 2016-11-28 by DrAzzy I am amazed at how well this is progressing. I can't wait to try it out - haven't had time for any "for fun" projects like Espruino. I've been so busy lately, I haven't even had a chance to fire up my Espruino WiFi's yet Posted at 2016-11-28 by Wilberforce 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 Posted at 2016-12-06 by Wilberforce 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.
Posted at 2016-12-06 by Wilberforce image: Attachments: Posted at 2016-12-06 by Wilberforce update the COM3 to whatever port you use. Attachments: Posted at 2016-12-06 by Ollie Great work! Though I only loosely understand what was involved, I did infer the lack of these features in the SDK release might have been a showstopper for you and @jumjum. Little did I know! Posted at 2017-01-06 by countxerox esptool doesn't recognise the --chip esp32 option, have I got the wrong tool? EDIT: yep with this tool it's looking good. Thanks Wilberforce! Posted at 2017-02-02 by hygy I just recieved my esp32 supporting board, soldered ESP-32S (blue one). when powering up i got this in a serial terminal:
The last line is repeating... I press the reset and io0 and then release the reset, then io0, in serial terminal i got this:
Then I try to flash it:
What I'm doing wrong? Posted at 2017-02-02 by Wilberforce I remember having that - search the esp32 gitter channel for a reference to header packet - something might come up.... Posted at 2017-02-02 by hygy This is what you wrote there: Then your timing is off - run the script again and push the boot button I tried pushing the Io0 button, and re run esptool.py but it does not help. Any other idea? Attached a pucture about the board. Attachments: Posted at 2017-02-02 by @MaBecker Hi @HyGy, have you solder something to the bottom like resistors or a voltage regulator ? Posted at 2017-02-03 by Wilberforce It does seem to be one of those things that depends on how you hold you tongue! Hold down reset and io0 and then release reset - keeping io0 down. You should be in boot loader mode then Posted at 2017-02-12 by Phando Is there an advantage to using Espruino vs Eclipse for the ESP32 development? Is there any native functionality that gets lost? Posted at 2017-02-12 by Wilberforce I'm not using Eclipse, as long as you can edit the source files you can use anything! Posted at 2017-02-12 by Phando @wilberforce Thanks for the reply. I was under the impression that once you started messing with various IDEs you might loose some modules or features of the chip. Thanks. Posted at 2017-02-13 by Wilberforce The main ide once you are flashed, is to use the espurino ide to send JavaScript to the board.. Posted at 2017-02-16 by Wilberforce Hi folks, Please note that partitions have might have changed since the last update, detailed in README_flash.txt in the tgz file You might need to /eraseflash too. Attachments: Posted at 2017-02-17 by psiphi75 @wilberforce The ESP32 build works well. Cheers. Posted at 2017-02-17 by Phando With the update I am ready to take the esrpuino plunge on my ESP32. Previously I have only used it for light weight development on the Esp8266. The chip will still have I2C, UART, PWM and control neopixels night? Do I need to find js libraries instead of C libraries for special operations? Posted at 2017-04-20 by PressAnyKey Hello. Posted at 2017-04-20 by Ollie @pressanykey, there's a port in progress. @wilberforce and @jumjum are leading it. You can also get them on the gitter channel here https://gitter.im/espruino/esp32 Posted at 2017-04-21 by opichals I like wemos d1 with ESP8266 so I thought that getting wemos built esp32 board would be good as it also has 4MB flash available. See https://www.aliexpress.com/wholesale?catId=0&initiative_id=AS_20170420235556&SearchText=LoLin32 Would this be a good board to get to start playing with the ESP32 Espruino? Posted at 2017-04-21 by Wilberforce All of the esp32 boards I have seen are 4mb - because of the RTOS and libs, the firmware is bigger so you need that size. I have heard good things about the wemos esp8266 too, but have had not direct experience. I think it should be suitable. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-09-23 by Kolban
I am lucky enough to have received an ESP32 development kit. The ESP32 is a new model of the ESP8266 type device from Espressif ... see:
https://espressif.com/en/products/hardware/esp32/overview
The core differences between it and the ESP8266 are:
It is still very early days in the release cycle of this device.
My question to the community relates to interest, design and execution of a port of Espruino to the ESP32. Ideally, I'd like to think that there would be desire for it. I'd also like to suggest that we make it a community project including design choices, implementation choices, coding tasks and more.
What I'd like to suggest is that if there is interest, we get permission from @gfwilliams to create a new board in the master Espruino Github (possibly called ESP32) and start building it out from there and using that as the core hub for our work. The most important thing being that any code changes that might be outside of the ESP32 target do not in any way negatively affect the other boards.
My hope is that with so much more RAM available to us, the scope of our JavaScript applications could be so much larger and allow us to take advantage of other functions.
If there is interest, lets see if we can't start communicating with each other to introduce ourselves and start a plan.
I fully realize that the availability of ESP32s is limited right now but a thought I have is that I can take my ESP32 board, a Linux build environment with networking and make that available as a virtual machine. In principle, you should have access to the serial ports etc etc. I'll also set up some WiFi access points for testing with REST servers and web servers (and more as needed). That way you wouldn't have to wait for an ESP32 for yourself and we would have a consistent "ready to code" build environment at our disposal.
Beta Was this translation helpful? Give feedback.
All reactions