SuperHouseTV #16: Compiling Arduino sketches on Pocket CHIP

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi i'm jonathan Aqsa and this is super house do you ever find yourself crawling around in nasty places and finding that you need a laptop because you need to be able to SSH to something well maybe you want to update some firmware on an Arduino that's embedded somewhere like in your ceiling or down onto the floor in nasty places like this no really don't like dragging a $3,000 laptop into this sort of place just because I want to be able to check out stuff published to an mqtt topic or maybe to flash an Arduino some of that stuff I can do is my phone but it's kind of inconvenient with a little touchscreen and you can't do upload so you can't reflash and anything from your phone so what do you do about that well maybe there is a solution I recently received a really interesting package so this thing it's called Pocket chip and it's a little bit strange it's quite hard to explain I'm going to take a step back and talk to you first about chip check this out this is chip it's a little single board computer you can see from the scale of my hands that it's quite small and you might be thinking yeah that's kind of like a Raspberry Pi or maybe a little bit like the particle photon or one of those sorts of boards so let's do a quick comparison to that so I'll just zoom out a little bit here is a particle photon and here is a Raspberry Pi 3 for comparison and as you can see it's midway between those two boards both in terms of physical size but also in terms of features let's do a little comparison so we have our three boards there there's the photon the chip and the pie and in terms of price the photon goes for about 19 US dollars the chip is advertised as a nine dollar device but that's kind of a lie because you need cables and extra things to make it do anything useful it's a little bit more than that raspberry pie goes for around $35 this is all in u.s. prices so in terms of processes the photon has it's 32 bit it's got an STM 32 which is an ARM processor it's an arm cortex-m 3 the chip has an all winner r8 and that particular chip you may have heard of that's what's used in a whole lot of the really cheap little android tablets and things you get around the place it's basically a cell phone chipset and that's 32-bit as well now the Raspberry Pi 3 has an arm v8 which is a 64-bit processor and it's quad-core so this is actually 4 cores running at 1.2 gigahertz each the photon runs at 120 megahertz and the chip runs at 1 gigahertz so you can see so far it's pretty much in between the two in terms of performance and we have one mega flash on this we have four gigabytes of flash on this and on the Raspberry Pi you put in an SD card which could be a four gigabyte card it could be a 64 gigabyte card it's pretty common to use like 8 or 16 gigabyte cards in there this one has 128 K over m this one has 512 megabytes of RAM and this one has 1 gigabyte of RAM so you can see it's really falling right into that spot between the Raspberry Pi and something like a particle Foton and these are really PC class devices whereas this is more like an embedded system you don't run an operating system on a photon you compile your code it gets installed directly but on these two it's a bit like a PC you can connect up monitors you can connect up a keyboard you can run Linux on both of these so what we've got is a board that really falls into that that's a lot between when you would use a microcontroller and when you would use a compact single board computer with an operating system so why would you want something that falls into that slot well there are a couple of things that are really interesting about this little device one is that it has an onboard power management system with a lipo battery charger and little switch mode power supply it's even got the jst connector on here if you have a single cell lipo all you have to do is plug it in it'll automatically charge while power is applied to this board if you take power out it'll just run off the lipo so it's basically like it's got a built-in UPS now if you want that same sort of functionality on either of the other boards or pretty much anything else that's out there at the moment you have to build it yourself you have to have an expansion board which provides the battery charger functionality and then uses the power from the battery to run the board with this it's built in the other interesting thing is that because it's got four gig of flash you don't need an SD card to load the operating system on that has both advantages and disadvantages the advantage of an SD card is that you can just pop it into your computer like into your Linux box or Mac or PC and load a disk image onto it and then pop it into your Raspberry Pi and away you go you can't do that with this because the flash is actually soldered on to the board you have to load the code onto it another way and you can do that using a bootloader and loading it on through USB and there are other ways you can flash them as well but it's not quite as easy as with a Raspberry Pi but once it's on there it's really fast one thing I found is that even though this is only a single core 1 gigahertz processor compared to the raspberry PI's quad-core 1.2 gigahertz for a lot of things this thing actually seems faster that's because some programs can't take advantage of multiple cores and so they tend to rely much more on things like fast memory access so it just seems that I found testing with openhab openhab is actually more responsive on this little thing than it is on the Raspberry Pi which really surprised me I thought the PI would just eat this thing for lunch but this thing is nice so I think one of these in a box with a lipo cell as a battery backup could make a really nice little home automation controller a good central system to run your whole house and I'm thinking of experimenting with that I might even replace my current Raspberry Pi with one of these running openhab and MQTT and I'll see how that goes so this at first seems like a solution looking for a problem because we've already got bigger more powerful boards we've already got smaller lower power boards that are more compact why would you want to use this well there are lots of projects where this really hits the sweet spot where it has the power management that you need it's fast enough it's got enough storage but it's not overkill it doesn't take too much power and it's not too complicated so I really like this board that brings us back to pocket chip so let's open this up and see what we've got looks a bit like a game console doesn't it now if you look in the back you'll see it's actually got one of those chip modules plugged into it and look there's a lipo and USB around here so we could power it up it's got a keyboard on the front and a screen so basically this is like a bit like a game console but it's running Linux and it's got built-in power management very strange device when I first saw these I thought what the hell is that for it doesn't look like it would make a very good game console it's no what a tablet so you can't really game on it like a tablet this green obviously it just is no match for something like an iPad it's not a laptop you wouldn't do any serious work on this and that would be crazy it's got this little membrane keyboard on the PCB but I'm really curious I think this could be very interesting as a as a Linux box that you can chuck in your work bag or in like in your your toolkit take with you and whenever you need to you can just pull it out power it up and and we've got you know you've got a console you could SSH to boxes I think this might be really useful when I'm in situations like hanging up a ladder and trying to configure something and I don't want to be trying to hold onto a laptop and you know SSH into something from the laptop while I'm standing on a ladder I don't want to be using a tablet or something like that for that purpose but this is built like a game console it seems really tough so it's a sort of thing that you could have in a toolbox pull it out power it up get yourself a command line you could SSH into things you could you know watch mqtt topics while you're working on a home automation system and not worry too much about it getting damaged and these things are really cheap they're not going to be available for another couple of months for a general access this one I got as part of the Kickstarter project so I've got early access to it it's going to be very interesting to see what people do with this so I'm going to start this up see what it the out-of-the-box experience is like and see how useful it's going to be how you see it here is exactly how it came out of the box I haven't even started it up yet didn't come with any instructions in the box it was just a box this is it you can see the battery is already connected so I don't have to do anything with that I thought maybe they would ship it without the battery connected I wonder if this comes out it looks like you can probably remove the chip module from the rest of it yes it's slowly coming out if I give it a good wiggle and there we go there is the chip looks a little bit different to what I have to this one is the next thing chip that I got from the Kickstarter project and this one has a bit of a different layout you can see that the Bluetooth module is in a different place and the configuration up here is quite different the location of the the charge port is different for the lipo so there obviously been some updates in the design but basically this whole thing is just a carrier for one of these chip modules so I'll plug this back in more power it up and see what happens looks like this is the power button here press and hold this it's alive got a logo I'll get rid of this yucky travel plastic wonder if this is a touchscreen that would be cool it looks like it is you can see the resistive contacts around here so I'm pretty sure this is a resistive touchscreen when you are finished with your app press home to return to the home screen just like an iPad battery meter Wi-Fi status shut down options and settings tap it in the Torah it all seems very straightforward so it looks like we don't have any Wi-Fi at the moment we do have some battery but it needs a bit of a charge power and settings let's see if I can connect to Wi-Fi settings super house yes that's the one I want and now I'm not going to show you my password array it looks like we are connected to Wi-Fi so terminal let's see if I can use this as a terminal and connect to my local openhab server well I must say this keyboard takes a bit of getting used to SSH command not found looks like I'm going to have to install a few things so I'm going to spend a bit of time playing around with this so here we are back under the floor but this time I don't need a laptop I've got a pocket chip I've managed to get the Arduino build environment running on Pocket chip so I'm going to flash an Arduino right down here sitting under the house with no power or anything else just now I know a USB cable and pocket chip check this out I've got a terminal running on it I have an Arduino compatible board which is plugged in to see if we can see this in the dark it's not a very convenient place to be working on this stuff but I can do this I don't have a big laptop to lug around so you can see it's plugged into the Handy USB port that's just on the top of the chip and now what I'll do is I'll CD into the sketchbook directory and then into the blink project and I'll even open the sketch in vim just so you can see that that can be done see so you can do this in fact what I'll do is I'll change the delay I'll edit this sketch a little so you can see it's done and we'll put in will make it 500 milliseconds to lay on blink and then do the usual vim staff of : write it out now we can do make upload I'll bring the Arduino around interview and then we'll hit upload it's going to compile it you can see it's cross compiling therefore the AVR processor looking for the serial port and it's uploaded now you can see the Arduino is running blink and it's got one-second delays and then half second eyes so we've just flashed an Arduino sitting under a house with nothing but pocket chip so pocket chip might seem like a bit of a bizarre product but I actually really like it it's going to be 69 US dollars when it comes out in a couple of months the chip module itself is really cool for a lot of home automation projects so I reckon you ought to check it out no this isn't a paid sponsorship I paid for the Kickstarter all that sort of thing so I'm just a happy customer but I'm really impressed looks like they've got good stuff see you next time you
Info
Channel: SuperHouseTV
Views: 46,948
Rating: undefined out of 5
Keywords:
Id: XFmrXJO_-Ns
Channel Id: undefined
Length: 15min 54sec (954 seconds)
Published: Mon Jul 25 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.