MicroPython for ESP32

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
last session prior to the lunch and so I'm happy to introduce Nick Moore he's a contributor of micro Python ESP 32 and that's a stock today welcome Nick and [Applause] thanks everyone this this is indeed the coveted just before lunch slot so if any of you feel yourself kind of slowly slumping over I won't take it personally it's the way these things go so I'm here to talk about the ESP 32 port of micro Python we've we've talked about micro Python as a project overall from Damien talked about some specific application of micro Python is a great way to prototype stuff from from Anna and I'm kind of talking about this ASP 32 port which I'm really really excited about so it's great to be able to come and talk about it to you there's some background about micro Python but it's probably not all that necessary since we've already kind of covered that fairly well but for anyone who wasn't here before it's a reimplementation of Python I'd say it's a Python because it's very much like all the other pythons and if you know how to program Python you know how to program micro Python it runs on small controller boards of various kinds including the PI board and the micro a bit and these esp8266 systems on a chip that have become very popular recently and now it's got a port to the asp 32 what are those chips an esp8266 which you can't really see because it's all pretty horrible is a small system on a chip featuring onboard Wi-Fi and various other peripherals they kind of first actually before I get onto that they made by company called espresso who are a fabulous manufacturer I think the thing that makes espresso particularly interesting is they're one of the first of the Chinese manufacturers to really embrace the open source world they're very active in an open source community they're very supportive of our open source development efforts and that's really great and I I think that's been a great advantage for them as well the 82 66 became a real enthusiasts dream partly because it's very powerful thought it is partly cuz you could get them for like $2 and the companies learned a lot out of that they've taken a lot of inspiration from the things people have done with 80 to 60 sixes many of them fairly silly but nonetheless people had a lot of fun with them people have tried a lot of things people have put a lot of interesting stuff together and the company has been able to learn from that and combine a lot of that knowledge into the ESP 32 so as I mentioned before the age of 66 came to prominence as a Wi-Fi accessory or Arduinos and things like that until somebody looking at the spec sheets realized it was well several times as powerful as the Arduino it was helping out and that this relationship seemed a little silly and that perhaps we should just develop directly for the 80 to 66 instead it's got a reasonably nice sea based SDK it's not that hard to get started in but there is a bit of a barrier to entry there and thankfully someone Damian ported micro Python across to it I discovered this I just started developing some stuff for 80 to 66 I got really fired up about it after a Linux conf geelong I think it was they're really excited about this whole 80 to 66 chip and writing see again and I hadn't written C in ages and just as the novelty and excitement of writing C again was starting to wear off micro Python came off so I lept upon micro Python and went this is the coolest thing ever and I got more into it I got more into it I got really excited about it and then I started working on it instead of just with it and then I started writing C again to work and so the cycle continues but never mind so following up on the 80 to 66 there's now the ASP 32 as I said before it's taken a lot of inspiration from what people have done it's more powerful again there's two CPU cores instead of one CPU core there's an ultra-low power processor which is a really cool little sorry that's really just like a very small very slow CPU that's just got enough power to wake up the other CPUs if something interesting is happening and if you're running on a battery that's a really important thing runs a slightly faster clock rate most importantly to us it's got a heap more Ram 520 K does not sound like a great amount of RAM to a modern developer I installed some software yesterday to do the machine learning things that downloaded I wasn't and a half a terabyte or something of data onto my laptop just to install but you it's enough to be usable for the Python for micro Python the 160k headroom on the ADC 66 he's an is plenty enough to run micro Python but your applications tend to bump into that limit fairly easily the 520 K gives us a bit of bit of breathing room but also got a bigger flash which is really nice these devices are much less powerful and something like an r pi 0 w which is the next sort of thing up that you might be thinking of that's the wireless our pi 0 that's a much more powerful cpu running at a faster rate it's got a lot more memory it's got a lot more ability to expand with with flash and things like that but these provide a little middle ground it's an interesting market segment that's kind of opened up between a bit sort of Arduino AVR world and that PI world the 32 is very interesting because it features as well as the Wi-Fi that you know about it's got Bluetooth which is really handy a lot of things they say speak ble of various kind is great for talking to mobile devices and other senses and things like that it's got more IO lines than the ad 266 which is really handy it's got more than one analog input as Anna mentioned there's only one analog input on the 80 266 which you can get a little bit annoying at times the SP 32 you can configure like eight of them and you can actually change them between pins which is kind of cool it's also got a digital analog converter which is kind of handy pulse width modulation on various pins they've done a really interesting thing they've built a capacitive touch sensing circuit into the thing and so there's eight capacitive touch sensors so if your project wants to have a touch interface rather than a button interface it's really easy you don't need any external components just a piece of copper which is a really good feature it's a really interesting it tells you something really interesting about their approach this may not be the cheapest system-on-a-chip out there but if you need no other chips on the board they can still compete so it's a really interesting little way of thinking about it and similarly there's that ultra low pro power processor and there's even things like there's a Hall effect sensor built into the chip I think that's pretty cool very few people need it however it's there it's easy to make it's just another piece of silicon on the die if your application does for some reason need a high current measurement device you can just lay your board out so that the processor has the power line running right past it and you'll see a signal on that Hall effect sensor that's kind of cool one less component again a group of Russians called zip tie bars are very good at boiling chips in acid and taking photos of them under a microscope so this is actually a picture of a D capped SP 32 gives you some idea of just how crazy the architecture of these chips is if you zoom in on that top corner there you'll actually see the circuitry of this thing the coils and stuff to make a hardware radio I think that's quite fascinating that you can actually do this you can make coils and wiring and circuits out of silicon that are right there on the die and it's actually quite beautiful in a strange and know-it-all it reminds me of maps in those old games like quake and things like that with the circles and paths and all that stuff it's really amazing that this is a thing we can do these days I think you normally wouldn't buy it as a individual discrete little piece of silicon because frankly the pins are far too small and you can't even see them but they're available as these sort of modules which are much easier to solder there on a twin you think sort of pitch around the edge so you can actually hand solder them if you work at it and they're quite a handy little chip that Google RF screen the tab on the top there is them built-in antenna so you don't even need to deal with anything that isn't like a digital 3.3 volt line oh sorry and the the flash memory is under that little can as well so it's all it's all basically there for you use it's quite easy to work with that kind of thing if that seems also a little bit too hard to deal with in terms of solder and there are lots to these boards available from various manufacturers there's a sparkfun one there in the middle which has got a integrated battery controller the other ones there's Adafruit oh sorry that one's a dev kit see the other one is an Adafruit feather I should know that it's a tiny little letters no it doesn't one of their Hazara range maybe or something it's got an onboard battery controller as well the battery controllers as an aside a very very handy if you want to have some kind of portable device because it's something that's quite easy to get wrong so having a board that has that on there so you can just plug a lipo in it's really handy so they're really good and those are standard headers around the outside makes it very easy to get started on this stuff and prototype stuff together little wires all right so that's the module I don't just talk about community since we're here one of the things about conferences they're very much about the community and about having a community I think it's really important that we have a micro Python community that we have a Python community and a micro Python community within that and an ESP 32 micro Python community within the micro Python community I noticed this news article the other day Intel launched with great fuss and excitement the Galileo platform and all of this stuff and it was going to take over the world of IOT and everything is going to be fantastic and lots of people have them and it's all going to be beautiful and there was no real community behind it and so whatever it was a year later when it hadn't really taken off and everyone's looking at their watch going out do anything cool with that man or add any cool they just shelved it just like that Bank so anyone who spent a lot of time and effort and stuff developing stuff while learning about that platform its kind of evaporated from under you which i think is really disappointing I mean it was a nice platform it's a it was a good idea but unless there's a community a single company can't push a platform along well I can for a while until I lose enthusiasm they can't make it a global thing so it needs to be more than that it needs to be a community of people and that's something I'm really trying to get going with micro Python as well so where are we at with micro Python so I talked here last year possibly this very room about esp8266 micro Python and there was a lot of fun and at the time there was for like much muttering about this new ASP 32 those modules actually finally started making it out onto the market in about November and then they promptly just appeared off the market again is every single one of them sold and then they appeared again here and there in dribs and drabs and everyone responded to this in the sensible way by ordering as many of them as they could possibly get hold off and then they immediately went out of stock again and finally I got hold of my first ones in November and we could start working on stuff Damien got hold of his as well apparently really because the initial ports dates back to December which is when ripple started to actually work I can actually I'm not very good with dates and times but I am pretty good at typing git log into terminal so but around December somewhere there and then I ended up coming across and doing some work on the project with Damien to get the Wi-Fi stuff going and and TCP sockets and some more support for other GPIO functions now and that work that initial work on this port I just like to thank micro brick for sponsoring that work they helped make that possible to get that off the ground as a another port started on ASP 32 they make a really cool little robot called the Edison which is pictured there that should a little educational robot thing so I just wanted to say thank you to them and give them a little bit of a thank you from there we went on and we actually finally admitted we were doing this thing and stuck it up on github which is great because I mean other people lept all over it and then I went down to limit offing Tazzy to kind of like you know launch it well it's a good excuse isn't it we went down there and at Loomis conf we had support from espresso to make a little board called an IO does which is this thing pictured which has a little OLED display and it has a little joystick and it has an ESP 32 on top and all of that stuff and as I'm working up to my talk about how to develop C code for the SP 32 I got up on stage and said ìlook unfortunately we haven't actually got micro Python booting on the IO toss yet and so on and the care put up at the hand and said yes I have oh right okay open source excellent so we did indeed get that running on the IO test which was cool and Jaya who's probably around here some way I got working with the neopixels on the board and people added more stuff and suddenly we had a snowball rolling which is brilliant it's this community thing I'm talking about is that we've suddenly got multiple contributors it's not just one person or two people or three people pushing this thing along it starts snowballing so that's really exciting we went from software spi to hardware spi which was a great start other functions appeared someone said why is there no PWM and I said of course there's PWM I said no there isn't oh yeah I didn't write that after all I thought I had oops so someone implemented that which is great and evil ends here there you are support arrived so now you can talk to all three you arts on the board which is another thing that took me by surprise when I discovered I actually had three you arts it's kind of cool and other people are adding more support all the time I've been in a few names here there are many many many more contributors in the in the thing get log is your friend but I just want to do emphasize afect this is becoming a community thing this is becoming something that is bigger than just a couple of people and here we are at PyCon again what's in progress so the ESP 32 also got used on a badge at a conference in Caen Amsterdam I think or near Amsterdam anyway called sha and a whole bunch of people from that community have been putting a lot of effort in on things like Bluetooth le and I think the same people are involved in the deep sleep thing I can't remember now those are pull request numbers and those things are waiting to kinda get merged back into the main line of VSP 32 micro Python but once that's working it'll support bluetooth LE it'll deeps be able to deep sleep so that you can round off batteries and it can wake up do some thinking go to sleep again there's the more sophisticated PWM control available on the chip one of the fun things about this is is that espresso for kind of doing a lot of their development of their SDK very publicly this is very unusual but they've released a very early SDK they call it an IDF IOT development framework they released it quite early with a lot of things missing and then they're slowly adding those things bit by bit which is a little challenging at times for us trying to keep up with with their development but it's really exciting as well because every now and then you'll discover a new piece of hardware is now available I we also need to have at some point some support for that ultra low power CPU because that's a really exciting piece of hardware anyone who wants to run stuff on batteries and a really exciting thing that's just suddenly become a thing recently is to attach more RAM to this thing so there's a new chip coming out from us a new module coming out from espresso soon which has got four megabytes of onboard ram serial Attached ram so it's just attached to the internal bus of the the module and I think it's really exciting can we make micro Python use this big slice of RAM you know if we've got more RAM available can Python use that and I've been sort of looking at it and poking gently at it and just before this talk googled it again and someone's in the meantime implement of it so that'll be really that's that's pretty amazing it's um something we have to now look at how to integrate that back into the main line of micro Python so as not to make it too much of a fork but it's really exciting that we can now it address that much more RAM and if you look at the dev kits and things like that a lot of dev kits have a pixel map display of one sort or another io does how to display the dev kit from espresso if has one the badges all tend to have maybe an ePaper display there it would help a lot to have a kind of standardized frame buffer approach that would work across multiple of those devices everyone doesn't have to reinvent how to do this every time it's probably a much lighter approach than you'd normally use for like a web tech or whatever but come up with something so those are all things that are kind of in progress at the moment so we've got coming up we've got a sprint signed up for Monday that's really exciting I've never actually kind of run a sprint before or participated in a PyCon sprint but I'm hoping it will let us achieve some really cool stuff expressive a very kindly provided some support for that there is a whole box full of SP 32 dev kits for people who can contribute at the sprint if you happen to have a sprint ticket for Monday please do come along it will be a hoot I think it's not just I mean micro Python itself is written in C so you need a fair bit of C programming ability to make much progress within the guts of micro Python but if you do have some seed background it's actually very very easy to work on so partly I guess because it's relatively recently implemented and it implementing quite a modern way and it's quite well documented internally and all of that sort of stuff and it's it's a nice code base to work with but the other thing is that there's a lot of work that still needs to be done on this platform in Python and a lot of work that needs to be feedback that needs to be done about how do we make this a better Python platform how do we keep our classes now libraries as pythonic as possible within the scope of micro Python so there is a definitely role for people who aren't see people as well within that sort of sprint and all of that and it'd be great to come and hang out and just you know get a chance to talk to each other about what we're interested in doing and so on and so forth Tim who is around here somewhere or another Oh up the back Tim hey Tim has also got an fpga board port of micro Python and he's interested in doing some work with on Monday that's basically running micro Python you know a little soft core within an FPGA and so there's a whole Python tool chain there that lets you configure the FPGA from Python and then program the actual running of the FPGA in python and so on as have well oh it's a really interesting effort I don't think Tim's talking about it this year but you talked about it at linux conf right i look up my timeline right right no bigger anyway there's a youtube video if i work out which one I'm talking about I'll post that link as well so there's that and the other thing I want to just mention is I'm running organizing a micro pathan meetup group here in Melbourne at connected community hacker space which is just opposite Swinburne that gives you a chance to come along and just meet up with some fellow enthusiasts and do some interesting kind of work it's very hands-on space there's machine tools there's things like that play around with hardware have a bit of an experiment get to know the platform not so useful for those of you out of state but for people who are around here if people are interested in running a similar thing anywhere will you happen to be from happy to help out with information about that stuff too and and help get things started elsewhere so cool that's about all I had to talk about in terms of this stuff does anyone have any questions about the ESP 32 port or about micro Python general thank you I might heard that there were some issues with the actual silicon in the ASP 32 in terms of some of the functionality is that I maybe you could comment on sort of just give an update in terms there's Rev one silicon out now so you could say that that would imply that there isn't a totally perfect singing River zero silicon I don't know specifically myself I haven't bumped into into the problems but then my my stuff is occupied a relatively small part of the silicon so I'm not sure yep Thank You Nick what's the development experience like on these chips I know it's G it's a GCC port but is there a good gdb interactive debugging things like that oh I've been strictly off in the world of print statements and logging via that via the serial port you can add to get those you arts working yeah so I haven't actually tried using gdb on it interestingly though the the dev kit J or whatever it's called not going to ever get to see little ones but the big ones have a jtag port and things like that on them so and I think I'm not 100% sure but I think what's on there is so there's a jeweled USB to UART converter and one of them goes to the standard serial repple kind of port that we use and that you flash the chip through I think the other one actually goes through to the jtag port or something similar like that so there's some circuitry there that I don't yet understand that I think will let you do that debugging over USB rather than actually having to get out the you know old Xilinx JTAG cable or whatever you've got so far though I haven't bumped into too many things that aren't solvable that way maybe I've just been lucky I wanted to comment also those traces the silicon traces look like patterns thank you thank you [Applause]
Info
Channel: PyCon AU
Views: 26,419
Rating: undefined out of 5
Keywords: pyconau, pycon_au_2017, Python, PyCon, PyConAU, NickMoore
Id: 6N1hNRDkm0o
Channel Id: undefined
Length: 25min 15sec (1515 seconds)
Published: Fri Aug 04 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.