Connect Everything with Electric Imp – Hugo Fiennes

Connect Everything with Electric Imp - Hugo Fiennes

Hi, this is Wayne again with a topic “Connect Everything with Electric Imp – Hugo Fiennes”.
So uh elektra kim um – i did have a really nice demo here with like we’re gon na, do like audience boating and have a servo and have a little counters and stuff. I was gon na. Do it live, however, as anyone may have noticed, the wi-fi is even worse this year than it was last year. I think i’m blaming the drones, i think for sure. They’Ve got like spread specs from 2.4 and they’re just like blasting everything.

Connect Everything with Electric Imp - Hugo Fiennes

So i have to tell you about it and i’ll show you some stuff, but it won’t be working um, but anyway you can play with it yourself. So what is electric imp we’re a platform to connect things to the internet? So a lot of people want to make connected devices these days, where you’re just trying to make something for like to open your chicken coop in the morning from bed or you want, like you, want to know the temperature somewhere else or you want to stream. Some audio or you want to do whatever you want to program things, so we built a platform to do that and we built it we’re up with makers and hobbyists, but we built it. So we can use it and also you can make things out of it and sell them. So it’s kind of got two things: it’s it’s a commercial platform that you can use for free and we don’t charge developers, i’m never going to charge developers um. This is still really loud. It’S plugging me. Let’S, try that a bit better, okay, um! So the way we do that you need to connect to the internet.

Connect Everything with Electric Imp - Hugo Fiennes

We connect using wi-fi and you have we do it with a something: that’s an sk format card. So this this little card looks like an sd card. It actually has inside it all this stuff. It has a 32-bit arm processor.

Connect Everything with Electric Imp - Hugo Fiennes

It has a wi-fi chip, it has an antenna, has all these power saving components and stuff, and it’s 25 dollars if you buy one. So it’s actually it’s pretty cool um for the cost. What you get? Obviously it’s an sd card, so you only get like nine pins, two, a pair and one’s id. So in the end you get six pins to play with on that one.

But every pin can be analog, every pin can be pwm. You can have three uarts, you can do all sorts of fun stuff like that. But what it does is it’s inside that card. It runs ros and it runs a virtual machine.

So there’s actually a real vm in there now your code, you get to write on it. You write in a web browser um, you can. The ide is online and you can just type your code hit run and no matter where the imp is in the world. It will get that code and run it as long as it’s connected to wi-fi it’ll get the code, it connects securely to the internet and keeps the secure channel up and then, when you press build and run, it runs that code now the weirdest place.

I’Ve done this is, i have left an imp in a bush 150 miles outside of las vegas pad on two double a’s connected to a mall wifi, which was an open wi-fi, and i could build code for that and run it, even though it was in a Bush outside las vegas, wrapped in duct tape, with a sign on it saying this is not a bomb um, so it kind of it’s weird for embedded programming. It’S not next to you. It can be anywhere, but that’s great because you know it’s always just after you’ve. Double-Sided taped the arduino to the ceiling that you realize you need to update the firmware on it, so it allows you to do that. It allows you to do this this stuff and because it’s a vm, if you make an error in your code and the code crashes, no problem you can, you can get to it actually see. If i can show this, i’ve got if i’m on wi-fi, because i’m on five gig wi-fi and that does work. We got hang on i’ll switch it back to this see. If we got the ide nope, that’s there we go i’ll post, it’s gon na be not much rooms.

It’S a very small! What the hell hello! When i press expand! I want it to expand onto this screen. Now, i’m trying to find hunt the mouse pointer there. We go, we got it. Let me get the bottom corner because, obviously it’s not working.

This is great. Watching people drive. Computers is really annoying. So here’s a unit i have actually just sitting in the office um. I can write some code here, i’m just saying hello. So i can say hello, maker, fair and if, if the wi-fi is working, i press run that device is actually in los altos at our offices and i just ran code on it.

If i put an error in it, i go oh yeah, okay, whatever it’s dynamically dynamic language, so that could be a runtime valid runtime thing. It’S going! Oh you’ve got an error and it’s like it’s okay. I can just fix that error. Press build again. It’S compiled on the server sent to the device and the device reboots and there we go we’re up. So it’s kind of fun like that. You can actually program very, very forgiving. It’S an object, oriented language, so you have classes and you have strings and you have tables and you have all sorts of stuff that you’d expect for like javascript javascript, you type language. So i switch back to this so yeah the impasse i o. It runs a vm, the os takes care of all the hard stuff like interrupts and so on, and you you get to write your code in that language. Very, very low power it’ll run connected to wi-fi on about five six milliamps. If you want to sleep and wake it’ll go down to four microamps when it’s asleep, so you can make something which will like take a temperature reading. Every 15 minutes go back to sleep again, sending it to the cloud every 15 minutes and it’ll run for three years on two double a batteries, so you can get some pretty good power on that. So it’s pretty good for some.

For that sort of type of thing you can also even do audio streaming in and out. You can like set up a sampler sample ac waveform sample a microphone whatever and stream that up to the cloud. So we have some demos over there which again aren’t working because wi-fi isn’t but the code’s all online and it’s all open stuff, so you can play with it. So that’s one bit, but that connects up to our cloud and our cloud has another vm. So this is a cool bit.

You don’t just get to write code on the card. You get to write code that runs within our cloud and you get a megabyte of ram there and it doesn’t burn any of your batteries and that bit has a url. So you can actually access your device with url. Even if your imp is behind a firewall, you don’t have to configure anything. It just works.

It’S all encrypted. You can do json, parsing and all the stuff which is hard to do on a micro. You do that up in the cloud where there’s loads of ram and it’s running on an amazon, server and kind of easy stuff. So you get to split your problem, you do the cloud io and maybe, like you know, fetching weather, underground results and parsing it down. Just to the temperature, and then you send the temperature down to the imperium, can then display on a screen.

So you get to do that split and that’s actually one of the problems with cloud connected devices is usually you end up doing: json, parsing or something down on something with no memory uh, it’s a pain to download. You know all that stuff. So this one you get both which is kind of fun, and that also means that you know there’s no battery drain. Also, if you have a sleeping device, you can talk to the agent, which is what we call a vm in the cloud. 24.

7.. It’S up the whole the whole time, so it can like cue, a message and when the next time it wakes up, it can pull it directly down. So it’s kind of fun. You can also do things like you know.

If you’re going to play a web file, you get the web file, you fetch it with http you strip off the headers. You do pre-parsing and then send it down in chunks down to the device with no memory as it streams, so that’s kind of cool. So that’s kind of what it looks like again.

You get the bits you write yourself live in two places. Then you have apis for all sorts of things for hardware for cloud for uh, hmac, hashing, all the sort of things you need to do things like um, otp, totp, awards stuff like that and there’s loads of example, code for it. You write code in something called squirrel, which is actually a video game.

Scripting language – i don’t know if anyone like i just left 4 dead, 2 uses it. We did have lua, but we lua did my head in. I really couldn’t get the syntax right. I kept using colons and dots the wrong way around if anyone uses the lure. They’D know that this looks a lot more like c, so you get atk of free in here 80k of ram after it’s connected and secure and everything you get 80k, which is a decent amount of space um.

You also get 128k to put your code in which is again a decent amount of space and the ones in the cloud get a megabyte by default. So what does it look like? This is like if i wanted to make a switch. That would send a request to a web thing to a web website.

This is what i do. I put. I have a basically three line function here. I’M configuring pin one it’s digital in with a pull up and when it changes, i send a message to the agent and that’s pretty much all i’m doing here on the agent side.

When i get a message from the device, i do an http post and that’s it, and you know that is the whole thing. If you’re doing you’re secure the whole way, your https very, very free to do sort of the stuff you might need to make connect stuff, it’s really really easy to experiment with um the ide, where you’ve seen it looks kind of like that. You get log.

You get real-time logging out from both sides and so on, and the hardware looks like this, which, if i switch over and show it a bit more, so this is kind of a card. This is easy. The nice thing about this is there’s a little dev board that goes with it. This has a power supply and a unique id chip and a breakout for your pins. So these are like spark fun, adafruit, digi-key sellies, and these um the nice thing about it. Is you build this in? These are about 10 bucks and you put the card in and it will connect to the cloud service and run the right code for this board. The code is associated with this. If i have one card and three of these boards, i can move stuff around it’ll, just work just by magic. It’S kind of fun um, but you know you have all the ios, the pwms and so on out that side, um and it’s in the card form factor the inside of it looks like this.

Like i said it’s tiny, you can look at it on a booth. It’S 0.4 millimeters thick board, it’s kind of fun, there’s another one which you can build into stuff which looks like this. This has got more ios. This again has the antenna, the wi-fi the processor in, and we just launched a new one, which is this big, which has a cortex m4, even more ram and wi-fi built into it. The antenna has to be external, but it’s also kind of hard to solder. But if you need lots of ios, that’s kind of a cool option, um and that’s what this is like the breakout board for that.

But you can see it’s like 23 ios on that one, and this is the antenna it’s just on a pcb trace um. So i said before that one of the nice things about it is, you can build something and then, if you want to ship lots of them, it’s actually really easy and we have everyone from artists to ge using this stuff. So these are some of the people who use it. Things like locatron uses for wi-fi connectivity, there’s a quirky air conditioner window air conditioner, you’ve seen it just launched that uses us as well. So you can do like nest type things, that electric imp is used to connect that device to the cloud budweiser made a promotional product which did this stuff. So did vb victoria, bitter australia.

We have haiku, we have the melo sous-vide cooker, which is launching early next year uses us razio is a connected sprinkler system, so i can actually pull my phone out and turn my sprinklers on in my guard from here. If i want it and that’s in home depot in a couple of weeks, i think so there’s all these people who prototype stuff and then you can go to production with the same stuff, which is nice, because if you want to like deploy new firmware to 100 000 devices, you just click a thing in the ide and you’re done. So it’s like really nice for connected devices. You can keep them up to date in the field.

Um. Sorry, i can’t show you an actual wiring demo. It’S actually going to be typing stuff in and people are going to be voting and making the counts go up and down, but um wi-fi we’re going to try tomorrow. We have some ideas up our sleeve but uh, but uh we’ll work on that. But if you have any questions, we’re actually directly behind there, um and uh, i will get off stage because then we’ll try and get back on time again. I guess, but thank you very much. .