MicroPython & the Internet of Things • Damien George • GOTO 2016

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
my name is Damien George so I just give you a very brief background on myself I used to be a theoretical physicist working in sort of string theory related topics but I also did a degree in university and computers and engineering and actually I was on a RoboCup team many years ago maybe eight years ago working with Sony four-legged dogs so you might have seen that yesterday it's a lot of fun working with that but so during my time as a physicist I got a bit sidetracked and rewrote Python to run on microcontrollers and now that has taken over my time and I'll tell you a bit about what I did there in it and how it's going so don't forget to rate the session at the end now the the idea behind micro Python is that electronic circuits little microcontrollers nowadays are getting very very complicated just like computers are and there's a lot of functionality in a tiny little chip and in order to get the most out of these chips I thought it would be good to have a higher-level language rather than see or assemble to program them so the idea was to sit well to see if it was possible to put Python on a microcontroller to make Python small enough and use resources not so intensively so that you could use it as an application language on a microcontroller so we all know that high-level languages like JavaScript and Python and Ruby have helped immensely in the development cycle of coding so you know if you want to write a quick script you write it in in one of your favorite scripting languages and you get something done in 5-10 minutes and maybe that's all you need to do or maybe you know you then rewrite it in some other language like Java or C++ once you've tested out the idea so languages like Python are good for prototyping but also sometimes good enough for the final product if performance is not a big issue so the same concept can be applied to the microcontroller world so microcontrollers as I said are getting more complicated and they're at the point now where they have just enough resources to start running these scripting languages and the reason that it's not an easy thing to do is because well with the amount of RAM for example is about a hundred kilobytes so in a hundred kilobytes you have to do everything you have to have a stack and a heap and all your data and to have a language like Python running 100 kilobytes is is not easy so but for a bit of the talk I will discuss exactly how that works how Python can run in such little memory but first of all so why did I even choose Python 2 to go down this Avenue with well I mean I liked Python it's a very nice language to use I think it's a very high-level language and it has lots of really good features like list comprehension for example and generators and very good exception handling mechanisms one of the big I think points for Python is that has a very big community that is very friendly and very helpful there's a lot of online resources for learning I think Python is also actually a very easy language to learn maybe you don't like the idea of white space and new lines and indentation being instead of curly braces but you actually get over it pretty quickly and it's nice and neat I think I find and I'd say Python has a really shallow but long learning curve so you can jump on very very easily and you can walk along and you can start learning new things and new things and you get more and more productive but it keeps going this learning curve because there are so many libraries and so many things you can do with Python so many advanced features that you know as a developer you never really get bored with the language there's more and more sophisticated things you can you can learn in order to make yourself more productive and I think it's actually one of the more ideal scripting languages for microcontrollers because it has native bitwise operations for example like and' and or' and when you're working with my controllers you're working with bits ones and zeros so being able to do bitwise and is really important unlike for example Lua which doesn't have those kinds of constructs it also has a very good distinction between integers and floating point numbers so you know if you have an integer type even though it's it's dynamically types if you have an integer and you add one it stays an integer and you can keep adding one because it has transparent transition to arbitrary precision numbers and if you have a floating-point number like you know 0.5 then that stays a floating-point number and that's really important in microcontroller context because sometimes you need a 32-bit number and you need you know to actually have the the precision of 32 bits in contrast say to JavaScript which everything is a number is actually just a double precision floating point number so if I keep adding one in JavaScript eventually I can't add one anymore because I've got like 10 to the 100 plus 1 is still 10 to the hundred when you've got a double precision number but in Python if you keep adding one you just the number grows and grows and grows so having this precision with respect to types I think is very important in a microcontroller setting there's also because python is compiled you have opportunities for optimization as you know with jet engines in Java and JavaScript there's a lot of things that can be done there to improve performance if you need to so I guess the big question is you know why why can't we use existing implementations of Python which is called C Python because it's written in C and there are a few other implementations of Python so why can't we just take one of those and compile it for a microcontroller and just run it on the microcontroller so the reason is that these language these existing implementations are quite intensive in terms of memory usage for example a single integer object because it's an object it carries around lots of information like it's appointed to its type a reference count and the actual value itself so the number one in normal Python takes up about 16 bytes of your memory and it has to live on the heap because it's an object that can have extended lifetime outside the current function so you have to whenever you're doing that one plus two for example you've got lots of memory need to allocate and it's also rather inefficient well to get around that inefficiency in cpython day when the interpreter starts up it actually pre allocates all the numbers from minus five to plus 257 because they're the most commonly used numbers so that when you add one plus two equals three the objects already exists there you're just referencing different ones but nevertheless if I'm create pre creating all of these and integers that's using about four kilobytes of memory just when I start up to make numbers so this is not an efficient way from a microcontroller point of view because that's four kilobytes of memory just wasted that could be you know half of your memory so that's one of the reason rate well a very big reason why you can't just take normal Python the other one is that if I wanted to do a method call so in Python things are mostly objects so if I have an LED object and I want to turn it on so LED on what I actually have to do is to get the LED object look up the on method and extract that and then it makes a bound method object which binds the on method to the LED object and then you actually call it so in that call you actually have to create an intermediary object which is the bound method taking about 20 bytes as written there so just to set the led to some intensity requires about 36 bytes of RAM to store the number and to store the bound method object and this apart from using our memory it's also not good from a sort of speed and efficiency and determinism point of view so if I'm running my code what if I can't allocate on the heap I have to do a garbage collection that's that's not good if I just want to turn a light on so there are things like this which make it hard to run normal Python under my hood controller and then there are other things that use heap memory like for loops for example okay so I have this idea then to rewrite Python and from scratch and I also had the idea that I wanted to do a Kickstarter project so Kickstarter is this crowdfunding platform where you pitch an idea and peep we'll give you money to fulfill that idea hopefully fulfill the idea so I had these two things python micro Python idea to put on a controller and just to see what doing a Kickstarter was like it took about six months to go from the initial inception of the idea to the actual launching of the campaign and that was yet in 2013 so about three years ago two and a half years ago and by the after about six months of do of actually working on this I was thinking everyday or someone's going to beat me to it someone's going to write path in a different way for a microcontroller because you know when you're in the middle of an idea you always think it's the greatest idea and everyone else wants to what get is gonna beat you to it so it was like one weekend to make a video for Kickstarter and then you know you publish it to kickstart and you say yes I just want to get this out there I'm sick of working on it now I just want to see if it will succeed so when when I pressed you know launch the project I was quite relieved to have this thing out there but then that's actually when the hard work starts because you have lots of people contacting you and it gets sort of more and more intense as the time goes on anyway but that the Kickstarter project was very successful and we got almost a hundred thousand pounds and nearly two thousand people pledging support and I think they were just excited by the idea of of some of the sort of cool technology that micro Python was bringing I'll explain a bit about that in the next few slides but yeah it was a very overwhelming response for me and but really great to to have such a project and it was fulfilled after about one and a half years about two years since inception so in 2015 in April I called it officially done so I'd finished all of the rewards and and and said that was it I mean that doesn't mean the project finished microbiome keeps going but the kickstarter itself was finished but just as a note so kickstarter itself has so far funded 1 billion u.s. dollars worth of projects so they've taken in 1 billion dollars and given it out except they keep 5% so that's that's quite good for them so to do so part of a part of the Kickstarter was to make little microcontroller boards and give them to people as reward and we went to a local PCB a PCB assembly house in the UK in Luton and they were very helpful and friendly and they really wanted to work with us because they thought okay so gel tech is a more of a comment of like they work with space projects and parts of the LHC the Collider in CERN and they wanted to get more into direct-to-consumer things they thought okay if we if we partner with with Damon here and build these little boards you know maybe we can get insight into more of the consumer side of things so they were really keen and you know invite you and give you lunch for free and so on and show you around the factory and it's really great to see inside a factory and see all the machines moving and I think you know we when we said all we need to make 3,000 of these things they said wow that that's you know normally they used to like one or two hundred but of some massive shake car charger or something so doing three thousand was a lot for them although they were obviously per unit it's a very small cost but so it was a bit of a challenge for them as well to get this many units shipped but since the well up until today we've done about 13,000 plus boards with them and yeah they've been very good and it's yeah definitely worth working with a local manufacturer rather than someone from examples from China just because Communications so much easier you can literally just drive an hour and visit them it's been really good okay so but delivering on the kick starter is I don't know if you've ever done one or if you've seen know someone who's done one but actually sending out a sour 2,000 things is a long and arduous process in this picture here on the left I think there are four PhDs just sitting and packing so you send a lot of stuff and yeah you get friends to help okay so as I said at the beginning the reason that I needed I couldn't just take cpython was because the main consumption is too high and so all of the tricks that I've put into micro Pythian are in order to reduce the memory consumption so okay strings are interned which means you sort of you make a string and mortal and that or that helps with efficiency and also memory usage the so the way our numbers are fixed up so that they don't use heat memories that you actually stuff numbers into a pointer and I'll explain about that on the next slide and this is a trick from Lisp from a long time ago there's optimizations for the method calls so they don't use the heap for loops don't use the heap they use the stack instead and lots of things where possible will live on the stack instead of allocating memory on the heap and everything else that is sort of an object sort of statically allocated like a module that actually goes in ROM or in flash in in read-only memory so when my capacitor starts up it's almost almost instantaneous because everything is already pre computed and stored in in in the read-only code section so that that's also very important trick yeah and it doesn't use reference counting like cpython in order to save memory so it uses garbage collection only and there's yep there are exceptions implemented using sort of set jump long jump if you know what that is from C this is just a little diagram about how the internals of the compiler and the virtual machine works so on the left-hand side is sort of the compile stage so the scripts go into a lexical analyzer which token eise's and then that turns it into a parse tree and then the compiler runs through the parse tree and annotates it with some type of information a number of local variables and so on and then eventually it emits bytecode and then on the right-hand side of this diagram the virtual machine there executes the bytecode and it uses helper functions to do things like you know insert things into dictionaries or search for stuff in a string or concatenate strings and do other things like that lists raise exceptions and then that can call any external c-code or any other language down the bottom right there and then you can actually generate code and recompile it within itself so it's it it's a fully dynamic language the compiler can also emit much native machine code sort of like ahead of time compilation and I'll explain a bit about that coming up so here I've I'm trying to explain how this some pointer stuffing works with integers so this as I said is an old idea from Lisp maybe I think this pioneered it so say we have a 32-bit machine and we have a pointer we have a 32-bit word and we want to get the most out of this word so if the most if the least significant bit is set to 1 then the 31 upper bits actually represent an integer so I have 31 bits to represent an integer say from minus 1 billion to plus 1 billion but if that lowest bit is actually zero then I've got those higher bits can store something else and actually we use a scheme where if a lower bit is 0 you then have to look at the next bit so if the next bits 1 it's a string if the next bits 0 then the upper bits are actually a pointer because pointers are aligned to 4 by it's just the way objects have to be aligned this doesn't lose any address space at all so if the two lowest bits are 0 means that you have your 32-bit words actually pointing to something like a list or a dictionary or a floating point number for example or a class and in this way you're really using up as much of the space the coding space in this city should be number as you can to efficiently store your numbers so if I do 1 plus 2 then the information is all just stored in the actual pointer itself which lives on the stack or it lives literally within the actual list it doesn't actually have to store on the heap anywhere so this is the main trick that you use to not need to use the heap so much and there are other schemes you can use to sort of stuff 30 bit floating point numbers within a machine word as well and then there's also this thing called nan boxing where you have a you use 64-bit words and they could put in a 64-bit double-precision number as well as integers as well as pointers as well as strings so you're really trying to use up this space as much as you can ok so that's the main one of the main tricks so now I'll just talk a little bit about the the bytecode that comes out so this function here just adds two numbers together and on the bottom of the screen is the what it compiles to so I load X I load Y so that's 0 and 1 and then I add them together and then I return the value and act there's a stack machine so you have a stack of values so I load X onto the stack I load Y the calling the add operation will have them and then the return operation will take the top of the stack and return that value so this is the this is the sort of the default way the compiler emits code but you can also ask the compiler to emit assembly code direct machine code so that it runs straightaway on the machine it doesn't go through the virtual machine and it may be a bit difficult thing to read sorry but it's it's it's anyway written in assembler so it's the same function but it's compiled to assembly and essentially what I'm doing here is so just I'll just go back one page so each of the opcode each of these virtual machine op codes is being sort of unrolled into it's the actual assembler so it's sort of unrolling the virtual machine what it would do if I was executing those byte codes so there's actually I'm not going to go through this there's a lot of set up rail you to set up the function to decode the keyword arguments and so on and then the actual addition is sort of towards the end there um but it calls some runtime function it this is our machine code if you're wondering anyway it's just it's just to show you that it's possible to if you want extra speed you don't want to go through the virtual machine you can compile ahead of time it's not just in time compiling because if you have to specify beforehand that you want to use this particular output from the compiler okay so just a few words on coding style so I have a research background and to me micro Python is sort of like a research project it can it even be done at all and I didn't really follow programming practices that maybe you were taught in university so I optimized first because you know if it can't be optimized it can't even work right the idea is that it has to be optimized to run on a microcontroller there's lots of tricks that have to be used to sort of get things to fit and to run efficiently clarity of code is sacrificed to to get smaller code and you encourage to use go to whenever you can because to make the code smaller for example well you know not encourage but go to was certainly not discouraged so the idea in the coding style is a bit different to maybe what you used to and I mean it's just a remark to tell you that it's kind of like it's a lot of fun and and I think when into coding micro Python and there was also a lot of analysis to see you know analyzing millions of lines of Python code to see what the most efficient way of decoding and byte codes were for example there's just this little code dashboard that I set up to attract the size of the code and the speed of the execution so the red the red fuzzy line is actually the speed the number of pi stones that micro Python gets so this is just to make sure that we don't suddenly double the size of the binary or slow it down so much so it's microphone is an open source project under an MIT license so you can use it however you like and it's developed in the open on github and github I mean I'm sure most of you know and probably use github it's an amazing community of programmers I mean it really is sort of like the social network of coders and developers and it's been very very good for micro Python because it attracts people people can contribute raise issues very easily it's gotten quite popular got quite a few stars and in the top point Oh 2% of all projects although there are 10 million projects but you can work out look at what top point oh two percent is so I think having it on github been having such feedback from people running micro Python on so many different machines like you know this old same embedded system that has a GCC compiler version 3 for example makes the code more robust because people can get feedback from these systems ok so just to give you a quick overview of this sort of sizes that it runs on the the pi board which was the hardware that we make for the kickstarter it has 192k of ram and one megabyte of ROM or flash and runs at 168 megahertz and there are a few other numbers there from other systems but it can also run on your desktop as sort of a lightweight Python implementation if you like for example in the open wrt projects which puts linux on a like these little router ships they have a micro Python package if you want to run Python on that system and the desktop version is also useful for testing so you know instead of downloading from my control way every time you want to test you just run it on a computer and it runs the same ok so I think for me one of the most exciting things was working with the European Space Agency what actually happened was yeah a couple of years ago so the start of last year I think it was yeah someone from the European Space Agency emailed me and said do you think micro Python could run in space and I didn't even have to think I was like yes I think it can and but anyway but that led to and they said ok well we would like to do a project with you to sort of essentially set up a contract and a project to do a feasibility study for see to see if micro Python can run on space hardware and within the constraints of space systems so yeah I mean I learned a lot about how space systems work so for example they use spark mark spark cpu which is a kind of an ancient thing but that's actually pretty cool once you get used to it it's a RISC instruction set and a lot of fun to work with and the Leon implementation of spark is sort of an open-source version of the spark a description and that's so literally on is the microcontroller and spark is the CPU and Artem's is the real-time operating system that runs on top of that so this is what Easter uses in a lot of their payloads and missions for example satellites and Planck satellite that discovered the CMB but had very good got very good images of the CMB so lots of their systems run Artem's which is a very highly tested and qualified piece of code and the idea was to get micro Python running within our teams is a little task so that you could for example say oK we've got a virtual machine we bring up and we're going to upload some code from earth to this spaceship and so a script and then it's going to run some sort of thermal control thing to check all the parameters of the spaceship and then print out some some statements depending on what what the parameters were like so the idea was to use Mac was to see if you could use micro Python as sort of an applications level language on spacecraft to enable more rapid development of coding and that worked very well and it seems that that's possible and we may have a few more ongoing contracts with ISA to to qualify micro Python to make it sort of space grade and actually use it in real missions but yeah this is sort of few years planning but it's very exciting the other exciting project was with the BBC so they have this micro bit project which is this little controller board and so they made the BBC micro many years ago like the Commodore 64 and they want to sort of reignite that that sort of idea by making a IOT device the micro bit and inspire children to get back into programming they've given away seven to eight hundred thousand of these to all 11 year olds in the UK and the micro bit here can run it can run different languages but and micro Python or Python via micro python is one of them so children will be able to learn programming using pipe marker Python on one of these devices and we're getting some good feedback there but there's still a lot more development on that to go okay so getting to sort of the IOT part so after so we did a second Kickstarter which was based on this Internet of Things chip the es expressive esp8266 this it's just a um I have one here it's a little chip that costs about you know a few dollars you can get it from China and it's it's it's got just enough memory to run microphone it's got about 96 kilobytes of RAM although a lot is used by the operating system and we did it kick-started to say okay if people want to have micro Python running on this chip you know here it will will take some donations and the mobile code for you and do it and so I partnered with some other a developer who is very keen on micro Python and we managed to raise almost 30,000 pounds on a pure software campaign so it was basically saying you know if you're interested in having this software work this free open-source software then please funders and we've got such an amazing response I didn't expect to get anywhere near that much for a pure software campaign and if anyone here is back with project thank you very much but it was really exciting and I'll just give a few demo live demos now hopefully that will work about this some with this chip okay so I know there's yep you probably can't see too much but you can come and look at it later but it's a little thing here and I will just attempt to change screens okay here okay it works so I will reset this now okay some garbage is printed to the screen can we all see this yeah yeah it's okay here there's a bit of debugging output that's okay so here micro Python so I'm all I'm running here is a terminal emulator it's just connecting via a serial prompt to this little board here so it's just a it's a you a third term it's just sending and receiving characters my computer's not doing anything except sending and receiving characters to this device and you can see here I have a Python prompt so this prompt here is on the board so there's a bit of information about the version up there and so on but I can actually so type in Python commands so you know things 1 + 2 it gives me 3 although I'm sorry I will see if I can adjust the screen for you open another terminal that's better ok ok so this is a Python prompt running on the board so if I'm typing something like you know then this gets compiled and executed on the little ship itself and then the response is printed back up the serial port so the computer doesn't is not doing anything except sending and receiving characters so there's things there's there's floating point support for example and maths there's a math module square root ok there is big big numbers support to say 2 to the power of a hundred two to the power of a hundred or to the power of a thousand yep ok so it's full on you there's a seamless transition between small numbers which fit in a word like I was saying before and long num arbitrary numbers so it's a full well micro Python is not full Python because otherwise it wouldn't fit so and the aim is not for micro pattern to compete with normal Python the aim is from to take from micro Python to allow Python to run where it couldn't run before so we have to in some cases sacrifice some features and a lot of the standard library that you normally expect with Python is not there but nevertheless I think the language the syntax is still is a hundred percent complete so there is lots of things there we have for example if you want to see so it's quite hard to type it my friend so here I can show you the amount of memory and how it's being used so the stack there is 8 kilobytes of stack if you can follow the mouse and about 2 kilobytes are being used and the heap yep so there's 28 kilobytes avoid of heap and then this here is a representation of what's being used on the heap so far um this is just for information so and then this the the thing with this chip is that it has network capabilities so the actual chip itself has this little antenna here and now well that connects you to Wi-Fi and micro pathing tries to give you really easy access to the network so let's import the network module ok everyone can see ok there and I can so interface naught is network wireless LAN 0 I have not that I can fig ok so this is my IP address netmask gateway and dns server this is on the local go to amsterdam network so this is i can connect to other networks i have not got say connect and then just give my SSID in my password and will connect so this is how i've connected to the network and then the one of the goals of micro person is not to reinvent anything where possible and to reuse all of the existing Python libraries to do things so if I want to connect to the network I use the socket module in Python or from a low-level point of view so the socket module is there and so say I want to look up so notice I have tab completion as well so that's how I'm typing so quickly if I if a pressing tab will will complete and it's useful for working out what functions are available so I can say get the address of this website for this conference okay so that was that's that's looking up a DNS server okay so let's let's do something a bit more interesting with our network so remember this is all running here on this little chip here with about a twenty eight K heap doing all of this so I have some pre-made little demos so I have paste mode here which allows me to easily cut and paste some code okay so this this is a simple demo that tries to download the Star Wars estimation and so it's quite straightforward it's just um it looks up this web address here and port 23 is the telnet port so we open a connection down here create a socket connect to our address and then just wild to receive information from this soccer just get as much as we can from it and then print it out to the screen so it comes in as binary data after decoder as utf-8 because it's Unicode and I don't want to have any line endings and so this loop here we'll just continue running so when I've entered this code here okay so now that codes running it's downloading it's connected via telnet to this server and it's just downloading and printing the text as it comes off the server so you I don't know if you've used the Star Wars sq-- mission before but if you just tell that into that address you can watch Star Wars it's quite cool so this will just well we'll keep running for a problem I don't know I've never watched the whole thing I guess it runs for hours so anyway but this is you can see that okay so I just ctrl C and it will break out and I'm back to I get a keyboard interrupt like in norm - and then back to my prompt so with that that was 1 2 3 4 5 6 7 sort of 8 lines to implement that on this little device so if you try to do that in C I mean there's nothing stopping you at just the compile time you have to write the codes probably four times longer compile it download it if there's an arrow go back and do it again but using micro Python you have the the prompt here and you can just try things out very quickly so prototyping is very quick and that that's one of the main aims so I can do it there's another demo here too just this function ctrl e okay so this function here is just to download a URL HTTP GET so it it looks up the address it makes a socket and it sends a get request for the web address that you lack and then it just does a little loop downloading and printing out that URL okay so I have this function HTTP GET and I will this is just a little webpage that I I use for testing on the micro Python server so there I just downloaded from the internet our web page so you can download whatever page you'd like now of course I've only got 28 kilobytes of RAM I can't go and download you know a megabyte web page and store it and posit that that's that's just a limitation of these things but if you just want to read some JSON and send some jason that's super easy and it will fit in memory there's a JSON module which allows you do so just this isn't normal and Jason module so use dumps to convert say a list of numbers and then so I can load that back against underscore is the previous expression yep so that just repass the JSON so you know you have very powerful things at your fingertips string formatting dictionaries hash tables exceptions and you can make some really simple web applications that way so there's a few more things here I can demo so some more hardware oriented things so I've got some code here which so there's this module called the machine module which gives you access to hardware for example the pins GPIO so I've created a few pins here and pin naught and pin 2 and if I okay they're both on at the moment I'm sorry that the lights are very difficult to see for you but you might be able to see the red and the blue on Iran and so I have P naught P naught is pin naught and I can make that low and that will turn ok that actually turns it on because the LED is out wired inverted and high if I can type properly okay high will is supposed to turn it off again okay so the red one went off if I go low it'll go on again if I go high will go off again oh okay it's off now and okay the other day the part of the big part of this demo so I've made a function here which allows to pulse using sort of pulse width modulation so if I want to pulse pin or LED not that will say well this is my delay okay the little red light will flash and if I increase the delay to say two milliseconds it will flash lower okay so anyway you can come and have a look at this if up closer if you want later but I'm just if you can have it appreciate the code here is rather simple just to do i oh and there's a function here to do the pulsing and you can connect this up to say internet so in the sense of you can make a webpage and when you click a button you can turn the light on or the other around the webpage can tell you the value of some pins the SE analog or digital value of a pin now I was actually going to I will try and do this demo it wasn't working before oh it was at some point the idea here is okay okay so this code I've just pasted here is supposed to make a little work web server and you as the audience is supposed to be able to go to the web page and turn lights on and off but unfortunately the network here whilst this was downloading just fine for you to actually acts as a server it wasn't working before but I will try again okay well it's not working but I'll tell you what it's supposed to do so this is the IP address of this device and one is getting LED one and I want to turn it on so I just made a simple sort of API request here so if I went to zero I can read yeah zero on was supposed to turn LED zero on for some reason this thing is not working as a server on this network but you can see the code there so it's it's just running in a loop waiting for addresses waiting for clients and then this wild true loop here is just pausing the incoming request from the web browser so it goes through each line and if it finds the gate line then it splits up the URL and sees if I want led 0 or 1 if I want to turn it on or off and so this bit of code here detects if you want to turn it on or off and turns to pin on and off okay so this is how you should be able to make some IOT device I assure you it was working before ok so I think I need to start wrapping up I will go back up to my main slide and just say ok so the well in summary micro Python is the idea is to bring Python to places it couldn't go before in especially in resource constrained environments with that much RAM for example one spacecraft or a little Internet of Things devices and there's lots of ongoing work especially with this esp8266 code there's lots of stuff we need to do for the kick starter including some async i/o support you may have heard about async i/o it's coming around out in lots of languages now I think even the latest version of JavaScript has it and we're going to support that as well because Python supports it so we want to support it multi-threading support is nearly finished so you can actually have run multiple threads as you do with lots of other languages and yeah there's lots of other ongoing work with the micro bit more work with ISA for further space embedding and also the ideas to make micro Python easier for someone to just take and use in their own project for example if you wanted to add some scripting capability to a game and you wanted that scripting language to be Python then you could just take micro Python and sort of chuckle in your system without any any difficulty at all and it would just be integrated so that's another another application so don't forget to rate this session like all the other sessions and thanks for your attention well Damien thanks very much for your presentation and it's quite an impressive feature what you achieved with micro fight and running on such small footprint so thank you for that as well thank you I got some questions from the public and someone else when do you decide to use Arduino C or micropolitan or embedded C do you have some pointers on that do we know C or embedded see ya or for microbots and if you have to choose between it or between the use cases okay yes so micro pathing can't run on really small devices like it needs at least about 256 K of flash and on Arduino is you have really very limited probably 16 32 kilobytes of flash and one or two K of RAM so micro pathing can't go down that far so if you want really cheap and low power so remember the the reason you use a micro controller is because it's it's cheap in volume and it's very low-power it runs on a battery unlike a Raspberry Pi and if you want something like in a toaster you'd probably just write in how do we know we'll see I mean I do we know is essentially a c++ so if you're making a toaster i'd say you see if if you want to make a an internet-connected freed your coffee machine you probably use micro Python so but yeah it depends on it depends on the size of the micro controller really and what your need is okay thank you much someone else said do you know the chilli and Java like VM microcontroller sorry which one yeah it's the door door evening pretty complicated work no I don't know either but but please well yep please walk up of your third question about it yeah sir I don't know and someone asked is there as already an introduction solution with my providing that you know of I do know that there are caught actually coffee machines that were using micro Python IDE although I don't know the name of the brand but there was some help I was giving to someone who was trying to get a IOT internet-connected coffee machine it's being used in teaching there was a university course that was set up around it to help teach undergraduates about computers and other commercial applications I'm not aware of that many I do know lots of people use it but I don't have really any way to keep track of what they use it for being MIT license it's out there in the wild and people do what they like with it which is good yeah more feedback from people would be nice and one last question what's the future for my provide online so well I don't know I mean it's that for me it was an interesting exercise and now it's grown into a really nice open source project that lots of people are contributing to and I'm just happy to be able to contribute finally to some open source project because I use I use many myself for example VM and so I just hope that it can grow and actually find good use and a sustainable community I think open-source projects are hard because it's easy for them to die if they don't have someone working full-time or they don't have a community that picks it up so I hope that I mean so far it's been really great there's a very big community well there's a relatively large community around it who was very supportive so I just hope that that continues that's my main hope for the future I hope you read something public today I'm Ian thanks again for your great presentation big applause thank you
Info
Channel: GOTO Conferences
Views: 24,952
Rating: undefined out of 5
Keywords: GOTO, GOTOcon, GOTO Conference, GOTO (Software Conference), GOTOams, GOTO Amsterdam, Damien George, MicroPython, IoT, Internet of Things, Computer Science, Videos for Developers, Software Industry, Software Engineering, Software Development, Micro-Controller, Microcontroller, Python 3, Python Programming Language, Connected Worlds
Id: EvGhPmPPzko
Channel Id: undefined
Length: 46min 56sec (2816 seconds)
Published: Tue Sep 20 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.