Introducing Swan: A Feather-Compatible Dev Board for Your Most Demanding Projects

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi everyone i'm katie from hackster welcome to the introducing swan webinar with blues wireless we've got brandon statrum zack fields and rob lauer here with us today to introduce the swan and show you how easy it is to use with arduino circuit python and cc plus plus and how it can be integrated into iot products using the blues wireless notecard so brandon is the vp of developer experience at blues wireless he has over 20 years of experience as a technology professional and has worked extensively as both a software and hardware engineer across a variety of platforms technology stacks and industries rob is the developer relations lead at blues wireless and has a passion for machine learning the internet of things and the open web and then zach is a senior developer experience engineer at blues wireless he has a long history in the internet of things starting in windows iot and then moving to azure iot particle and now blues wireless so a big thank you to all of our speakers for joining us today the first part of today's webinar will include a presentation and some demos and then we'll have about 10 minutes at the end for a live q a so if you do have questions during the webinar there is a q a section at the bottom of your screen so if you can just type your questions in there brandon rob and zach will answer as many questions as possible before the end of today's webinar so uh one additional added bonus as part of this webinar blues wireless is giving away a blues wireless dev kit to two webinar participants so anyone who attends this event live with us today will get their name in the drawing to win and winners will receive an email later next week with more information on how to claim that price uh so thanks again for joining us and i'm gonna let brandon take it from here well good morning good afternoon and good evening everyone and thanks so much for joining us today for this webinar we're going to talk about swan and blues wireless which if you have not heard of us before it should be a a fun time but before i go any further i did want to mention that if you end up having to drop or you have any technical difficulties or connection issues taxer folks are going to be recording this webinar and it will be posted to their channels and it'll be provided in a link to an email and then we will actually tag that webinar in our youtube channel as well so you can go to bitly slash blues youtube to visit our youtube channel and speaking of if you haven't yet please do visit that channel and subscribe we post a variety of content pretty much on a weekly basis from webinar and event recordings like this to project videos from the things we release on hackster.io as well as a newish series of rs blues wireless tv where our very own one of the members of our team gave sanchez interviews members of the blues team customers and leaders in the world of iot which by the way that's you if you're building something cool and you want to be on blues wireless tv definitely shoot one of us an email so we have a lot of great demos to share today and it's all really featuring the star of our show the swan i'm going to start and spend a few minutes and talk about who blues wireless is what we do why we exist but we're really going to spend most of our time today not only talking about the swan but having a demo party they will actually walk through using the swan with arduino using the circuit python and then using it beyond the feather and of course we'll leave some time for q a at the end if you have questions throughout the webinar please do use the q a feature in the zoom webinar chat now if you we prefer you use the q a feature and not the chat we'll try to keep an eye on both but really the best thing to do is to use that q a feature so at the end we can go through those questions and actually address anything that comes up as we go along through the way and also please stick around through the webinar today so those that attended and we're here do have an opportunity to win one of our dev kits either the note carrier af which includes this one it's a feather form factor version of our core development board or the no carrier pi which can be used with a raspberry pi so introductions i did want to introduce myself and my colleagues who are going to be joining me on this webinar here today my name is brandon satram and i'm the vice president of developer experience at blues wireless i have been in the iot industry for a long long time a professional technologist for over 22 years and have been a blues wireless for the last year and a half now i love the work that we do and having an opportunity to speak to audiences like this about the things that we're working on and i'm joined today by my colleague rob lauer who's the head of our developer relations team and zachary fields or zac uh who is a senior developer experience engineer and the three of us are going to walk through all the demos and share all the fun of swan with you and hopefully by the end you'll want to participate and get one of your own and join us on this journey so let's get started by talking about blues and talking about why we exist and i'll spend a few moments on this but i want to start with this concept of prototype purgatory this is that dreaded part of product development between a great idea and deploying a product to the field or pilot to the field often the reason why this part of any product development effort seems to last so maddeningly long is because building an iot product requires a mix of skills and capabilities some of which many of us are comfortable with and some that were some that we aren't right many of us that come into this space we might be web developers by trade and we understand the web and cloud side of things but hardware is very complex and difficult for us to grow we love playing with it but we always know that there's so much complexity there that we may not have as much experience in and on the other side you might be an embedded engineer you might have spent most of your career in the hardware world but you never thought about connectivity or you didn't really have an opportunity to work with it and so the other side of that story the sending data to the cloud and then building an application or a web app or a mobile app or some set of serverless functions in a cloud service those are things that might be foreign to you you don't have as much experience really really knowing how to build that piece of the application and every iot application because of the very nature of connectivity spans that entire breadth of technologies right the reason we add connectivity to sensors is because we want to do something on the other end we want to see a chart or a gauge or a widget or have some remote control capability so there's a lot and if i could sum up the current state of the iot world in one word it would be complexity and complexity comes up so much it's such a common refrain in this world and every time that i think about that word complexity i think about a quote from our ceo the ceo blues wireless ray ozzie and it's something that he said a long long time ago long before starting blues a few startups ago but it is really just as relevant to us today as it was in the software world when he said it and that quote is complexity kills it sucks the life out of developers it makes products difficult to plan build and test my guess is that even if you haven't heard that quote before it resonates with you when you hear it when you think like how much your day to day even if it's purely in the software side like we know many of us as technologists know what that actually feels like and so when i think about complexity i like to classify it in the world of wireless iot and connectivity because there's a whole lot on the hardware side on the cloud side but a lot of the complexity sits between your sensors and between your cloud applications and how you actually tie the two together and the way that i like to refer to that is the strings of wireless iot right these are the landmines or potholes in iot development these are the things that developers that we cannot control and which make our lives difficult the things that slow us down cut off choice or provide unnecessary duplication of effort and there's a whole lot of these things to be fair but i really like to classify what i see is the most common strings of wireless iot and four buckets difficult to program modems too narrow or too wide guard rails pitfalls with device life cycle management and then security as an afterthought so if you've ever had to program a connectivity module with cryptic at commands and pull out your old haze manual from 1983 you've experienced the strings of wireless iot same if you've ever been told you had to adopt your iot vendor's entire ecosystem down to the microcontroller programming language api constraints and ide just to get your project online or if you put off activating that cellular iot device that you bought because you just wanted to wait until you were really ready because you didn't want to start the meter on a monthly data plan that you don't have that you don't want that you would have to pay for whether you use the product or not or if you were forced to embed keys and certificates in your firmware in order to get your sensors to send data into the cloud applications that you prefer to use right someone maybe all of these things might feel familiar to many of you i know that they definitely do to me and at blues wireless we know the strings of wireless iot well because we've lived them in our own projects we have worked with them and experienced them all before and it's why we created the core products that make up our business the notecard and notehub.io and our goal really was to cut those strings of wireless iot and create a product and experience that's simple to start that's really available for any developer to use with any set of sensors any host and to connect very securely and quickly into any cloud application in the cloud applications they prefer and it's something that works with one device but it can scale up as your products go from one to many devices as well and it starts with a note card the note card is a low power cellular and gps module with cellular iot connectivity in over 135 countries the device comes with 10 years and 500 megs of data baked into the cost of the device itself there's no monthly data plans no activation fees the prices on the tin as they say so you don't have to worry about that ticking clock when you start your project i build a lot of prototype projects and demos and examples with blues technology and i like to say that you can prototype without fear using the note card because it's all bundled in the cost of the device that you get and instead of spending time learning a labyrinth of at commands that are unique to every modem manufacturer and cell connectivity provider you can use json with a note card to do everything from configuring the device understanding its location to adding sensor data and more really everything that you can do with a note card is expressed through that json api that you can use to speak to it from any programming language all the way down to an 8-bit arduino if you can send strings on your to your micro controller if your micro controller can send strings it can talk to the note card as long as it has a serial or i scored c uh bus on it so um with a note card you can actually go from unboxing to sending any data you wish to the cloud within minutes via secure cellular connection every note card includes the keys it needs for making a secure connection to our cloud services baked into the device at the point of manufacture so there's no error prone key rotation or cr or cloud provisioning process you power the note card up and you start sending a data and it knows where to go to phone home and if you have used a note card before you've experienced this but if you haven't we actually provide a web-based a web-based onboarding experience where you can actually connect to your note card over the browser a serial connected note card over the browser and under and start using those json commands to assign it to a project on our cloud side to start sending it sensor data and more like i said it knows where to go in order to phone home immediately and where the note card phones home is the notehub.io cloud service which is ready and waiting for your project data once you bring your devices online notehub.io is designed to be a thin middleware layer between the notecard and your cloud applications so we make it really easy to route data out to your cloud application provider of choice whether it's a cloud platform like aws azure gcp or a visualization service like ubidots datacake or a platform like losamp and once that data has landed in your cloud it's ready for you to build the visualizations to manage physical assets and to make critical business decision decisions faster and this is the fun part right for many of us the reason why we're doing this is because we need some set of insight or intelligence on the other side and the whole point the whole reason that blues exists and we built the note card and the products around it is that you can focus on the solution that you're looking to build not how you actually build it so with the note card of the note hub together it can save you weeks of development time getting your devices and your cloud speaking the same language so that you can focus on building an actual solution like measuring water quality around your water treatment facilities measuring air quality at schools and public spaces or monitoring physical assets regardless of where they're located and these images are actually from hackster projects that we have released over the last year that really show a lot of different examples how we've used the note card in our own projects and our customers are starting to do so as well so if you're interested after my little sales pitch and framing of sort of who we are and what we do if you have not yet tried the note card and you're interested in trying you can grab it at shop.blues.io and at sparkfun and soon will be available at digikey as well so now with that out of the way let's talk about the newest product in the blues wireless family the swan now this is a product that we announced as a part of the edge impulse imagine conference a couple of weeks ago and really excited to share with you today it is not a waterfowl it is a microcontroller this is a device that we have been working on for the course of really the past year and it was built basically out of some customer feedback and as a result of a direct customer interaction that we had with a customer that was building their first note card based application and this is a large industrial refrigeration company and what they were looking at was creating a application that monitored the fridges that they have deployed at customer facilities they were using the note card but they needed a microcontroller that really was quite complex something that they could use to control lots of gpios lots of buses be low power but have a high clock speed lots of ram and flash and so we decided to actually build a board based on that customer experience of building helping them design something custom but a board that uses the exact same microcontroller that we have on the note card itself because it is a low power high performance device and so that swann the core mcu on the swan is an ultra low power arm cortex m4 that's clocked at 120 megahertz uh it's an stm32l4 r5 it's the exact same mcu that we use on on the note card on our cellular module and it comes with two megs of flash and 640 k of ram it's an absolute beast and it runs around eight microamps and stop two mode um and it's also when it's running it can actually do a ton for you uh it's an amazing uh device that we have worked hard to have support from day one in c and c plus plus in circuit python and arduino now you can visit bitly slash swan dash mcu to learn more about the specs of the device but really it is much like everything else we do we built the note card with this idea that any programming any embedded language can speak to it we wanted to provide as much choice here as well and one of my favorite things about it it's also an mcu that's really built with machine learning in mind in many ways that 120 megahertz clock is is amazing for snappy inferencing on device and with two migs of ram and 640k a flash is great for managing those large tiny ml module models that we might get from time to time if you're doing complex things and then plenty plenty of pins for complex peripherals i'm going to come back to that in just a few moments but i do want to dig into the edge ml side because this one actually does have day one support for edge impulse so i know that we're all big fans of edge impulse i know that for many of you that spend time on hackster you're probably edge impulse fans as well love the product in the community that they have created so we worked with them to make sure that we had day one support for swan so there's a full edge impulse guide at bitly swan dash guide that is in their docs as well as a guide that we've created for using edge impulse with the swan but i do want to talk about the language language support for a few moments and actually get into our first demos because that's the things you're actually here for i've talked long enough it's time to let my much more capable colleagues show you how these products actually work we're going to start today with using the swan with arduino and my colleague and compatriot zach fields senior developer experience engineer at blues is going to show you exactly how you can use the swan with arduino vs code and a little bit of on device debugging so take it away zach hello everyone thank you brandon and i'm zach and i love the arduino so i don't know if you guys are familiar with arduino or not but has become the ubiquitous platform for turning your laundry machine into an e-bike or your vegetables into flamethrowers or your banana into a piano like it seems like the options are limitless and the community surrounding arduino is enormous and that's why it is particularly awesome that this one supports the arduino ide and development environment so without further ado let's arduino so i'm going to boot up the arduino ide this is standard we're all familiar with it it's a clunky ide it doesn't really have a lot of debugging capability or or any debugging capability other than printf and uh it's got i would say limited options but it's a great place to start so if we look here i've got blink set up and this is the hello world of electronics we're just going to turn the on board light on and off and on and off so normally what you do is you select a sketch like blink and then you come over here to tools and you would choose your board from the list so if we look here we'd be looking for stm32 boards but we can see that's not an option in our list well that's because we need to go into the file preferences and come down to this little additional board manager urls and add in the stm32duinos or manager url so this is the same thing you would do for esp32 or any would you say any set of boards or architecture that isn't native to arduino all right so we'll hit ok and then now we can come up to tools and go back to the boards manager and we we're not in the list but we can add it in so now we can come over here and we can look for blues and you see this stm32 mcu based host was say based boards and that looks suspiciously correct and it is correct so we're gonna go ahead and install that now this part does take just a second so like i really hated to do this in the demo but you don't get what would you say i don't feel like you get the real idea of how simple this is if we don't go through all the steps because the rest of the steps take about as long as this install right here i i can't emphasize how simple arduino is and how easy and approachable it makes electronics and and that's why we wanted it to be part of the swan or that we this is one of the first things we did i guess was to get in the family here with the arduino uh environment so that we can make spawn approachable and for anybody so we'll give it just a second here while it wraps up this install oh there it went great so close that and now if i come to over here again i'll look at the boards and now i see the stm 32 boards group all right so that's our that's where we're looking and in here we're going to look around and we see blues wireless boards okay that's us so we selected that the menu went away but it doesn't really end there so if you come down and you we got a whole new set of stm32 options uh notably you want the uart support because this is what allows you to see kind of your printf debugging messages so always just enable that unless you don't need it and you know that you don't need it because it's great to get started if you just want to print to test a sensor or really anything like that uh what else do we have here um just smallest so it compiles the program down to the smallest for the optimization no debug symbols this is all fine i think we'll move forward with that and port we need to find the board i've got it plugged into usb already let me flash over and show you what it looks like so if we flip over here all right this is the swan and it's in its feather format i've got it mounted so that you can see it a little easier right up under the camera this little guy over here is a st-link v3 mini and it allows us to program the board and more importantly debug it this isn't strictly necessary you can connect to it directly with usb and program it that way and check again the printf or the console messages as sort of a printf style debug if you just want to get started in the easiest and fastest way possible i'll need this for later in the demo so that's why i chose to set it up with the st link all right so let's come back over here so i've got that all plugged into here so i've chosen that and now i will upload the board or i'll upload this program the default blink over to the board and we will see if it works so let's come over here and what we expect to see is that this is going to successfully install the blink sketch on the board and we will see the onboard leds start blinking on and off and on and off okay so it looks like i've got a different console showing me the messages but we've had a hiccup over here and you see if i get out of the way that we had like a little error reported here this is no problem it happens on occasion it typically revolves around um power supply when it's being programmed and i have it running on a lipo for the sake of this um demonstration so it's on a not average what would you say power supply and so that kind of can cause it to be a little bit squirrely but let's flip back over and take a look all right as we can see it's blinking now and there you go that's how quick you can get going from zero uh with the swan and that's using the arduino ide but since that's so fast let's start talking about things that are more interesting so instead of just the arduino ide let's go ahead and drop this out and bring up something cool like i don't know vs code that's way better so this actually piggybacks on top of the arduino ide so you need to have that set up and prepared but once that's ready you can come over here to the extensions and look for arduino you'll notice that arduino is an official microsoft extension so that's great so you know it's going to be a higher quality and it'll be getting updates continuously so we'll install this and then i know that i just claimed that it had high quality which is funny because this one actually has a problem let's see i need to how do i do this i have to i have to downgrade it to 0.44 because there's actually a bug in 0.46 so let's see i install another version here we go so let's drop back and install this version instead and then kind of reload the page let's see once it gets there there you go so we reload it all right so now like i said we've got the arduino ide extension installed into vs code and let's see what it looks like to go from here so uh in the room and so why bother maybe that's a great question the main reason you can debug here and i'm gonna show you that really fast all right so here we go uh from here we can press f1 and we go to the arduino examples and let's pick out blink it's in the basics and there we go all right so now we have blink set up and let's maximize that and uh okay so select the board type here we go so now we'll look in here and we'll type blues there we go blues wireless the extension takes just a second but it will populate that secondary list that gives you uh the debugging uh well like was it the compiler optimizations and things like that uh we'll let it kind of think and do its work and we'll get this set up in all the other things we need to do really quick oh there they go okay so the swan that's our only board so that's going to populate straight away we are going to use single wire debugging this is what goes through the st link your other option would be dfu and if that's if you wanted to program it directly using usb i don't like i said i'm going to show you guys debugging which is what's so cool about vs code and then uh let's see we don't care about that let's give ourselves no optimization so that the debugging can actually step through the code without skipping things and we'll go to the debugging symbols we'll enable those so we're able to look at them one by one by one all right so now the board is configured that's good and then the next thing to do is to configure the debugger so this is actually really simple so if you come over here to the little debug pane you can see where it says create a launch json file another bug is you won't get this option so if we click this you'll get that option but you won't see arduino in the list if you have a ino file pulled up as in if the blink file was open so let me just show you that so that's what we want to select but before i do that let's come over here let's open blink ino and now let's try that again so we see this create a json file oh no it's not there ah it took me forever to figure out this bug i've reported it and i'm sure that it'll be addressed in one of the newer versions uh okay so let's let's open anything besides that so a good one to do is again this configuration panel is just fine so now if we click this we see arduino reappears in list we'll click that uh and then let's get the uh terminal out of my way here alright so it pretty much set up all we need in the launch json except it doesn't know where you have open ocd installed and i have pre-installed that to kind of keep this demo rolling but we do need to identify it so let me grab the path to that so i'll do that and then i'll also choose which family of board that this is with so what you see is like this is open ocd is installed not all the way at the root but very close and then i have sorry the st link interface that i'll be using and the target file is the stm32l4 which is the family of boards that runs on the swan all right so that's the only change we need to make we'll save that let's come back over to blink and let's set a breakpoint here so we'll just keep it on because it's easier to see on and off so [Music] all right so now we'll launch the debugger oops i click the wrong thing we'll launch the debugger and let me get this out of the way so it will recompile and then it stores it off in its own little place it doesn't use the pre-built binary i think that's actually another bug that's relatively no new you'll notice that the version is zero dot anything so they're kind of like not really claiming it yet but it is microsoft's extension not just some junkie extension all right so you can see we broke it stopped so now if we go to my bench we should see that the lights on so let's have a look and indeed it is let me see if i can get picture and picture here i gotta get out of here and there you go all right so here's my break point so now let me go ahead and put another break point over here and then i'm going to hit f5 and let it roll over and the light goes out and then i can i will step with f10 through the delay and the light comes back on and then i'll step again that was the delay is expired and then i'll step and the light goes out so there you go guys that is step debugging with the arduino ide nvs code on the swan this device is incredible and it lets you tap into the enormous arduino community so hopefully you found that fun uh and from here i'm gonna go ahead and hand it over to my colleague rob he's gonna be showing you how to tackle your problems in a completely different way using circuit python on this one awesome thanks zach hi everyone my name is rob lauer and i'm developer relations lead here at blues wireless and i have the pleasure of walking you through some quick steps on getting started with using circuit python on the swan proving once and for all that snakes and birds can actually be friends but right away i wanted to address this question why circuit python we've had some really active forum talk about why we went with circuit python versus say micropython for example and i'm not here to say one is better than the other but i do want to point out that circuit python has a very low barrier to entry if you think micropython is easy to use circuit python really takes that next step and it's all just python at the end of the day so which frankly doesn't get much easier anyway next is a really vast array of tooling support i'll show you the editor i use in a bit but if you're using say mu or vs code or sublime text you're basically covered anyway one thing that is really attractive to me for circuit python is the extensive set of libraries available for all sorts of peripherals and of course the core is lovingly backed by adafruit and frankly you know we aren't necessarily limiting ourselves to circuit python on the swan no promises today of course but we are starting to look at the potential for micropython support as well now that i've already blown a couple minutes of my time what are we going to be talking about well as promised i'll show you how quickly you can install circuit python on the swan we will take a brief look at this mysterious circuit pi drive that will show up post installation and we'll talk about a little bit about some ide options and requirements and of course do a little programming magic on the swan all right let's start with the installation now until we get our quick start updated you can visit circuitpython.org to find a little more info on using the swan with circuit python you can also grab the very latest circuit python binaries here if you really want to live on the edge what's probably better for now though is to head to our github page at github blue circuit python you can find all of the beta releases of circuit python using circuit python with the swan here in particular on this page you'll find the files you need along with some basic instructions which we're going to do right now to set up our swan now step 0 is going to be to download the circuit python uf2 and swan bootloader files with those downloaded we can head to our swan over here make sure of course it's plugged into your computer via the micro usb port and we can put our swan into boot mode by holding down the boot button on the left and then pressing and releasing the reset button on the right now we can head over to our terminal here and use the dfu util utility to flash our swan which takes all the few seconds now with that done we will see the swan boot drive appear on our desktop so now we need to install circuit python now to do that we literally just drag and drop that circuit python uf2 file onto swannboot so let's do that here and here is our circuit python uf2 file drag and drop it on the swan boot the drive will reset and appear as circuit pi in a matter of seconds it's down here now let's take a look at the circuit python drive because it's kind of interesting now the circuit python drive is where your code and the libraries are going to live you can edit your code directly on this drive and when you save it will just run automatically you'll notice by default we have a code.pi file and an empty lib folder so circuitpython looks for files in the order of code.txt code.pi main.txt and main.pi to execute that automatically when the board resets so the cool thing about circuit python to me is if you make a change to any code the board is going to reset now the beauty here is that i don't have to put my spawn into bootloader mode you know recompile and re-flash for every iteration of code that i might have to do otherwise so makes for a really grand developer experience now i mentioned you have a variety of different ide or editor options when working with circuit python adafruit recommends using mu which is a really nice and basic editor prom is basically i don't think it's compatible with m1 max so i can't show it off but i've had a lot of luck using visual studio code and the circuit python extension here i think it's a really nice implementation uh but frankly you know for this demo i thought i'd stick with the funny ide you know it's a really great specialized environment for python micropython and circuit python as well so let's go ahead and connect to our circuit python drive and we can see we have access to the circuit python file system right here so i can open up my code.python file i can look in that lib directory you'll notice in the bottom right here we have access to choose different interpreters so of course we want to stick with running the interpreter off of the swan so the circuit python interpreter here and we have the x to the shell or the the python replica here that's running on circuit python within the fonty ide as well so if we execute you know this print hello world command what's it going to do well it's going to print hello world but what's cool is then i can bring up other commands like i could say help modules to bring up a list of available modules that are built available to me out of the box with this circuit python distribution so of course we're you know we're using cycle circuit python where we have access to all the traditional uh python code constructs so i can print out a range of numbers here from one to ten and no microcontroller demo is complete until of course we do what well we got to blink an led so what we're going to do is we're going to import some libraries here we're going to reference the onboard led that is right underneath the micro usb port here and we're going to blink it right we're gonna turn it on we're gonna sleep for a half second and turn it off so prepare to be amazed okay so that's running you know blink blink blink awesome now i want to take this the next step and kind of link the swan to the rest of the blues wireless ecosystem and that's to make it work with the uh notecard so our cellular notecard to do that it's going to be pretty simple i'm going to disconnect the swan here remove it from my breadboard and i'm going to add the swan to our note carrier af which is designed for feather compatible microcontrollers like the swan and plug you back in all right now let me reconnect here and i think i need to quit and restart funny there we go so here's our code again and what i'm going to do i'm going to copy and paste a bunch of code in here but we're going to walk through it's going to be super simple again we're importing a bunch of libraries i'll note that we're importing the note card library which i'll get to in a moment and we are referencing a product uid this applies to a project in note hub that again i will show off in a second and we're going to access the note card over i square c which is very simple to do we're going to send our first request to the note card using our json based api so that is this we're sending a request and it's hub.set and all that it's doing it's saying hey attach this note card to that project in note hub and use this mode which is going to be continuous or maintain a continuous cellular connection with the note card and then we have a very simple while loop here it's just going to go on forever and it's going to say what it's going to say grab the temperature from the note card so we have an onboard temperature sensor which we gather with the card.temp request and we're going to print some stuff out to the shell here and we're also going to add a new note so this is going to be adding a note creating an event that's going to be sent up to note hub with just the temperature so we're grabbing the temperature and sending it up to no time pretty simple and you know what i'm missing a line of code i was like hey we don't want this to run non-stop we're going to do a time.sleep of 15 seconds so every 15 seconds it's going to run this oh except they had an error well wait rob you never installed the note card library well geez i bet that's really tough um let's see well it's actually not too bad so i've got my note card library that i downloaded from github and let's open up that circuit python drive again head to our lib directory oh boy this is tough oh okay that's it let's run that again oh hey now it's running so we can see that our configurations were set here and we've got the temperature from the note card being read and it's being added to these note files which are now going to be sent over cellular to note hub i'm going to let this run together a couple different notes here and you see the temperature isn't changing uh i could probably i don't know cover this up for a while and get it to raise a little bit but uh let's just let it create one more note and then we'll head over to note hub and see this in action now if i go to reload this page sure enough we see all those note files that were just created so pretty cool it shows you just in a few seconds how you can go from having this swan microcontroller out of the box installing circuit python running some python code iterating over that code really quickly creating completely new programs in a matter of seconds and then even connecting it to a cellular board and pushing that data to the cloud so i hope that all made sense if you're looking for some next steps with swan and circuit python check out our basic install instructions on github at github.com blues circuit python releases we also have a quick start for developing on arduino ide at dev.blues.io and i point that out because we will be adding circuit python support to that quick start shortly and finally on dev.blues.io we also have a really cool guide for building and deploying an edge ml model with edge impulse on the swan that you should also check out so that's it for me back to you brandon all right thanks so much rob that's great so two demos down we have one fun one ahead and this is actually before i hand this back over to zach i wanted to come back around to something that i haven't really mentioned yet but you may have noticed in all of the pictures that we've had about the swan littered throughout this presentation and you may have noticed these nice little castellated edges that are around the base of the device and so the swan is a feather compatible mcu so you can solder in male header pins and plug it into a breadboard use it with any feather wing that you might wish but we actually provided another feature of the device that brings 55 gpio pins out to a set of castellated edges around the board so you can solder that down directly into your own pcb or a carrier that we provide and access so much on the board itself including eight analog and 16 digital pins four i squared c and three spy buses one usb otg full speed one 14 channel dma a true random number generator a 12-bit adc and two 12-bit dax a low-power rtc and crc calculation peripherals are so much on this board and we wanted to give our customers and give developers the ability to access the power of that core mcu so that nothing went to waste and so there's a lot on there and i do want to give zach an opportunity to share more not steal his thunder to give you a demo of using the swan beyond the feathers so once again zach take it away hello once again and thank you brandon all right so what does it mean to take the swan beyond the feather well if you haven't guessed already it means taking advantage of the castellated edges that we just talked about and how do you do that well we've provided a swan carrier board that allows where you can see right there if you look at it the two lines of solder pads and how close they are together well that allows you to take the swan and its castilated edge solder it down and then get access to the 64 pins on the two rails that run up and down the sides okay so now the first thing i thought of after i saw this beyond cool is well what am i going to use so many pens on i mean some of you probably already have an answer right now but i started thinking like what would you do well for one there are some peripherals that are only available when you have access to the additional pins namely qspi so that's quad spi if you don't know and it it operates significantly faster than standard spi and it works in a slightly different way but the other things that you can do is you can get access to multiple i2c and spi buses then again if you're like me you're like why do i need more than one bus that was the first thought that i had one of the things that you kind of once you start stewing on that you'll realize one advantage you can get from this is bus isolation this could come in really handy if you were making a product and you had if the product itself had peripherals that were maybe sensors or something of that nature and you wanted them to be on one i2c pool and then you had internal operations that you wanted to be on a completely separate i2c pool this would make it you know maybe some security if these were completely plug and play that would prevent someone from plugging in and checking the internals of your product there could be several other reasons i can't think about off the top of my head but another good one there was a guy at uh one of our previous webinars and he had six i2c sensors they only have their primary address and one alternate address so that means that only two of these sensors can be plugged into any single i2c bus well he needed six in his project and coincidentally we have three i2cs available when you use the expanded rails which that allowed him to take all six of his sensors and stick them on a single mcu and that that's actually really nice because then you can sort of aggregate data or do comparisons or anything that you wish when it's all in one place without having to do extra leg work to get it to aggregated but probably i think the most important thing would be to discuss the myriad of gpio pins that would allow you to interface with nearly any device so uh think of it as a swiss army knife that allows you to gain access to maybe any old standard piece of equipment you have sitting around or even non-standard piece of equipment you have sitting around that maybe your company uses uh has been running it's one of those ain't broke don't fix it scenarios within the company and so the problem is when you have a device like that typically you don't have any way to move it forward into the future and it ends up while it's very important for your company to leave it alone it also is going to slowly kill you as opposed to changing it and instantly dying so that's one of the neat things let's say that you had a uh i don't know like a battle tested device from like the 90s and it has no real observable protocol that it adheres to but you know that you you need it you want to use it and you don't really have any other way to get at it for me this was my trusty game boy so this is probably i think the biggest benefit of the swan is its ability to interface with almost any uh existing hardware that's available today so this demo is mostly a talk but then also i'll show you the code run at the end of me hacking the game boy by creating a by using the swan to emulate a game boy game so that i can talk directly to the game boy and take control of it so let's talk a little bit more about that at first blush i have to admit that the game boy is surprisingly complex so it's early 90s tech i was expecting a very very slow machine that was very weak and probably had an 8-bit processor especially because it was like the cousin to the nintendo you know well it turns out that it's got like a 4.1 megahertz processor so it's clipping right along and it has 16-bit regis weight because it i think it has a 16-bit i want to say registers or some sort of um i'll forget about it but it's it operates on 16 bits internally even though it's an 8-bit processor kind of like the arduino uno but so it's like it's pretty brilliant the way that it works but that also means that you have to be a lot faster than maybe you thought you had to be when you have your new mcu you're trying to use to interface with it so uh there's this is a super dense graph here this is just an oscilloscope reading of a snippet in time that is about 50 micro seconds long so there's a lot of activity happening within 15 microseconds and you can see that that's completely possible because if you look down here at the bottom this purple line right here this is the clock and you can't read the little number there but that says 480 nanoseconds so that is every up down uh well up down and back up is just shy of one microsecond but the up and down or half of your oscillation takes 480 nanoseconds so whenever you want to move in and out data it has to be done really quick surprisingly quickly i would have to say so uh i ran into a problem immediately because i was trying to do 16 digital reads to get the address and then do eight digital rights to get the data out so i have to do all of that very quick to get inside of the clock i was actually concerned for a moment because when i first started i was over time like i wasn't gonna make it and then i started realizing like one of the greatest things about using stm st products is that you get access to the st tool chain even if you're using it through the arduino ide in vs code so i just clicked the little drop box that i have highlighted there in red and set the optimization from 0 for debugging down to optimize level 3 with link time optimizations enabled so all of a sudden it went from kind of a dog to screaming fast uh and i don't know if any of you guys have had to do fast io before like bit banging but typically you have to do a port read to take the whole thing at once and you can't do individual reads and you really have to think about exactly the steps you're taking to optimize things so like i said before my non-optimized code was running about 7.8 microseconds for a sig for reading a 16-bit address and then about three and a half microseconds for the 8-bit data right which makes sense because you know 16 is 2 times 8 3 is 2 times 7. i'm sorry i don't know how i just said that but i mean to say the the read is twice as big as the right so it the right should take half the time roughly and that's what we're seeing here uh but the idea that all of it was happening in about 11. what is that three two milliseconds microseconds it was way over my budget of i think one to two microseconds that i was given and i was starting to think of about like oh geez i'm gonna have to figure out how to do port rights in the st like in the stq ide to speed it up but then i saw that like i said that little optimization box i clicked that and all of a sudden i could read a 16 by address in 200 nanoseconds and i could write the 8-bit data in 100 nanoseconds roughly and holy cow like everything worked and i'm not i like i'm embarrassed to do this but i'll show you the code it's gross like it is not my professional whatever whatever coding etc etc you know you know the whole story that you read on everybody's posting code i'm gonna show it to you it is cringe worthy but this thing could optimize it which is like part of the amazing stuff about having st embedded in the device but all right so you know so what we have to do to make it well you just you know wire up a couple wires here and there and all of a sudden boom you've got access i mean it's actually kind of like that easy except for there are 32 pins on a gameboy cartridge and it's a lot of really teeny tiny soldering that you have to do and you have to kind of destroy tetris whatever you do it rest in peace i had to sacrifice a tetris cartridge to get this thing to work and it requires some dremel action and some other things but i was able to get my uh little rainbow jumper wires down in there soldered down to the the well the cart pin the pin out from the cartridge and then i can slip all of that into the game boy just the way you would load a standard game boy cartridge which then gives me the ability to talk back and forth with it directly from this one and again this is something that would not be possible without additional uh integrated circuits if it weren't for this one and like in all fairness looking up here you can see in that breadboard some blue ics sitting there but those are just logic level shifters and i bought them and placed them in the breadboard before i realized that the st chip that we're using is five volt tolerant so odds are i probably didn't need them at all and in fact i couldn't even use one of them i had to just i had to just not i had to disable it and then put the wires on the other side to get the whole thing to work anyway so it definitely was leveraging some of the five volt tolerant pens and uh my guess would be that this could have all been done if you choose carefully because not all pins are five volt tolerant but my guess is that you could do this directly by just like plugging it from the cart into the swan nothing else in the middle no man in the middle uh so like i said a little bit of wires a little bit of solder and i got in there so with no further ado let's flip over my bench and i will show you it in action all right here we are so game boy voila and i've got the swan sitting here soldered into the expansion board you can see how that works and then obviously i have a litter of wires back there but uh and in this there is no external power the game boy will power up the swan the swan will boot in time and be able to respond to the game boy and without missing a beat so we'll flip this over here there we go and there you have it so instead of our typical nintendo we see the swan and then i could even take this a step further let's see if i can get over there um oh yeah let's go back to my desktop here we go so i'm in the code uh here's the swan logo in the nintendo logo so just to show you that this isn't fake i've i've left that on and then i would just tell it oh yeah let's let's look at the gross code like i said this is as embarrassing as showing you my underwear uh this is so horrible but i was up to like for writing this stuff uh all right so it's just like you'll look at it and you'll note that nothing is well written here i think that's probably the thing i really want you to take away from this that i'm i'm performing digital rights on each and every pin i'm doing digital read on each and every pin and instead of using ports and the optimization just smooth all that over as if i was a good code writer for this thing so okay well enough of that and let's see we'll change it from the swan logo to the nintendo logo and then let me jump back and then i just click this little button here to upload the new code it's going to start and then i'm going to flip you back over to the desktop and a neat thing to notice is it actually reboots it when it has a successful deployment of code so hopefully we'll chime here in a second and then it'll reboot with the there you go nintendo logo so now it's restored back to its former glory uh and it's that easy to do so like i said guys the swan is amazing not only is it 5 volt tolerant it's got tons of gpios for kind of any problem that you could even start to wrap your head around it's fast enough that it can jump in on the existing timing and this is display timing this is not just some protocol bus like i don't have the ability to cue everything up i have to get it and write it kind of instantaneously and the salon does this with ease and you saw the code it's garbage like so it was able to transform garbage code with an awesome compiler into great a great binary i should say and then it runs it like plenty enough speed and clearly if i had written good code and then optimized it it would be that much better all right thanks so much zach now we're about to transition into live q and a but as we do so i did want to mention that if you're interested in grabbing the swan checking it out even potentially learning a little bit more about the note card we have a discount code swan dash webinar that you can use it'll come out in the emails as well that hackster will follow up with but you can use that code and save 20 on either the swan by itself or the uh this the feather starter kit for swan that includes the note card so that you can explore cellular iot as well you can grab either of those at shop.blues.io and again swan-webinar is the code to use we'll add it here in chat really quick and uh feel free to use that so we're going to transition now into live q a and just bear with me for just a moment as we as we swap over turn all of our video feeds back on and we'll uh we'll take questions as they come up in the q a panel great thank you so much uh brandon zack and rob for those demos that was awesome um so we do have quite a few questions that came in and so i'm going to let you guys take that over we are at our hour mark so if you do have to leave um post your questions really quick and they'll try to get to them before the end we'll give about 10 more minutes here um just so we can do some some questions live and uh if you guys don't get your questions answered i will also post the link to the forums at blues wireless uh in the chat in a second here so you can also go over there and ask your questions there uh so thanks guys i'll let you take it over from here awesome thanks katie yeah and great great great questions thanks everybody for sticking with us through the hour we'll take about another 10 minutes to answer questions and anything else that comes across uh in chat in the next little bit there's definitely i think everybody really appreciated the demos zach and rob lots of uh lots of love for the nintendo hack uh i saw a mention of the you got the gratuitous celie logic analyzer and that was that was noted in the chat as well uh but let's actually go through a couple of these questions we've answered a ton over the course of the last hour but one that i saw early on that i wanted to throw to rob was questions about what's uh the note card what cellular bands and radio access technologies are supported in the current products yeah so there's actually four different note card models you should be aware of um they're all documented in uh on our developer site developer portal at dev.blues.io but basically it's going to depend on where you're going to deploy it around the world so we do have a global narrowband notecard we have a narrowband notecard just for north america and we have a wideband for emea and a fourth one that i'm blanking on of course but um with those four notecards we offer support for ltem nbio nbiot and cat one and if you want to dig down into the specific frequency bands i recommend consulting our data sheet and looking at the actual quaktile modem that we're using with each note card and you can like dive into their data sheets and see like you know if you can get specific information for your country and exactly which frequency bands are going to be supported there yeah definitely thanks rob so yeah head over to dev.blues.io check out the hardware section we have the data sheets for all the four variants you'll see listed there as well as which of those variants support which countries we have support for over 135 countries if you're looking for the broadest amount of support the nbgl our narrow band global notecard supports about 135 countries on both nbiot and cat am so and that's the one we ship by default just so everybody knows yeah yeah yeah that's cool that's the one we should by default so let's talk about uh remote low power battery powered nodes i don't throw this one to use that because i know you've messed with a lot of battery powered applications both on the swan and on the note card itself so there's a few questions about what's the potential for remote battery powered node and then if you talk to about just low power operations sort of how we do it on the note card and then what options we provide in the swan as well yeah so uh can you guys hear me because my my stuff yeah you're good okay great it's good um yeah so one of the things that i ran into uh well yes it's really good it's designed around low power i should start with that like that was the whole purpose uh and this the note card itself idles at eight micro amps like really low yeah uh so or well approximately eight micrograms and so uh you can use the way that it works and i've used it in a bunch of remote situations like i made a stream monitoring project you can find that here on hackster actually but i floated this thing in a stream and it ran on a solar panel so it can go for a long time like indefinitely running on only solar power and the mcu that i had selected is not necessarily known as a um it's a power intensive like empty it was an esp32 i'll just say that which they use a lot of power or they can and uh so it's not known for its low low power profile or anything like that but what's cool is you tell the note card and the note card has a locking or latching uh interrupt and so you'll have the mcu say hey i i need to go to sleep now i've done all the computation i need to do i need to go to sleep and it tells the note card note card says all right good night and then it latches that interrupt and then it goes down and so then all of a sudden on a timer or on motion or um on a note or like an inbound node any of those things and there's a couple others i can't take them off the top of my head will light up will trigger that interrupt which you tether directly to the enable pin of the mcu and then it'll pop back up and it'll work so you'll have you want to execute whatever kind of code you need to do to do the computation you need as quickly as possible obviously but it can even run at high power on battery because it's going to be a burst if you will or a like a short power draw and then it will request to go back to sleep and then it will sit and idle i mean because it's off because you're going to disable it but then the whole thing will idle at the note cards idle which is 8 microamps so most batteries decay faster than that anyway so this is a super low like low power mode and it's very very easy it's a json command-a-way to enter it's not like you have to stop a whole bunch of processors uh flip a bunch of peripherals off and on like i'll forget that like just leave your mcu in a high power state uh and ask for it to go to bed it'll get shut down and then it'll reboot sample everything it needs to sample send that off on the note card or cue it to the note card it doesn't have to send it away you just cue it over the note card go to sleep okay done and then this idles and you'll tell the note card itself a schedule of when it should connect to the cell tower so that you can really optimize around battery i mean that is one of the founding principles of the note card all right thanks zach yeah and while we're while we're talking about that i'll mention for those of you that are interested in the low power support we have the same mcu on both the swan and the note card so the things that we do on the note card to operate in stop two and low power mode you can do on the swan as well and the stm32 hal documentation has a ton of great examples for that we'll be shipping examples for it soon as well if those are interested related to that stm32l4 there was a question from kangman about those chips are out of stock everywhere how can you insure production we have a lot i'll just tell you that if you have if you're curious and you want to do a volume purchase shoot me an email at brandonblues.com i can tell you that we've been aggressively pre-ordering pre-ordering uh parts since early 2020 so we're more than willing to entertain conversations around what what folks are wanting to do at scale with the note card and even potentially with the swan there are a few questions about the purpose of the sim socket on the carrier on the note carriers that's a great question from from sudheer we are actually we do support external sims on those note carriers so if you're operating in a country where we don't have support for the note card with our built-in e-sim you can use a twilio sim or a sim from geo or from airtel or for from another another provider like that or just depending on your needs and so you do have that flexibility um we also let's see there's another question i was gonna throw i was gonna throw oh there's a question from dario about what happens when the date on the note card is over how do we renew the amount and if you check out blues dot io services that actually has a list of our our pricing plans on the cloud service and data side so we do provide something called connectivity assurance where you can actually get top up pricing on the note card if you go over 500 megs and uh in the 10-year period so um let me see oh here's a question let's see i'll throw this one back to you zach from naveen does swan support i2s uh yes it does so it actually has a ton of all sorts of peripherals that it does uh support but it's one of them it has was it two dacs and i2s lines so it's it's pretty awesome the list goes on and on if you'll go over to our product page or the if you go to the dev.blues.io and look up its datasheet then you can look on there and i think that there's at least a link to the proper stm chip that's on there so you can see the full supported uh peripherals but yes absolutely i2s cool and rob what about micro python support wouldn't that be awesome um yes maybe uh i think there's some definitely at least three questions i saw pop through about low power support with circuit python um i'm not the circuit python expert even though i pretended to be today but we are looking into micropython support uh this is my understanding that we could better support the low power modes in the st chip with that so to be yeah those of you that have played with both might be aware micro python does have a few features that we are definitely envious of like interrupts interrupts are not available in circuit python that's one that we'd love to be able to support on the swan the drawback is that micropython doesn't have the same level of library support for external sensors and things like that so there is some emerging work happening where it's quite easy to port circuit python libraries over to micro python and what have you but um we did see that there is some existing stm32l4 family support in micro python so we're going to look into to adding that in there as well and i saw the last question we'll take so here it asks is there a dock on how to debug using vs code zack you want to answer that one ah yes there is not only is this recorded and i just did it live but also on our doc site on uh if you go to dev dot blues dot io again we have a tutorial for setting up the swan it's i think it's called it's like getting started with the swan or start swan i've kind of lost track of the navigation but you get in there hop in take a look and uh we'll walk you through step by step give you every url to copy and you'll be ready to go right one last question i did want to answer here if i could quickly somebody asked about those cellular protocols and which ones are supported uh when and if there's any settings you need to apply one thing that i think is really cool about the notecard is that it's going to programmatically work through those protocols in a certain order but if you want to like you probably don't want to prioritize nbiot because it can take forever to uh to grab a appropriate signal with nbot um so what was i going to say oh there's a there's an api call you can make to actually put the note card into specific mode to actually look for a specific protocol as well so it's it's automated in one way and it's also very flexible in terms if you want to customize it awesome well thank you so much everyone uh for joining us and for you guys coming on and showing us all these demos and giving these pres this presentation it has been really fun um and we appreciate it absolutely thanks everybody you can reach any of us at firstname blues.com feel free to email us directly we're happy to answer any other questions we didn't get to today but thank you so much katie for hosting us perfect yeah you're welcome i will also be sending out that follow-up email with the link to the recording and uh some more information that that these guys gave today so thanks for joining us and have a great rest of your day thanks everybody
Info
Channel: Hackster.io
Views: 383
Rating: undefined out of 5
Keywords:
Id: 7L8XHIZlzCQ
Channel Id: undefined
Length: 72min 24sec (4344 seconds)
Published: Thu Oct 28 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.