 to you Ravi. Yeah, thank you. I'm a variable rate. How many of you have used Arduino or Raspberry Pi? Yeah. So, talk covers about Raspberry Pi and Arduino. So, I've come all the way from India. So, this is my first talk. I work with a company called Azoy. Azoy, so at Azoy, we basically focus on health and mobile computing. We have offices in US and India. I take care of software development responsibilities at Azoy. So, I started my career with web and mobile technologies. And from like last two years, I've been working in the space of Internet of Things. So, at Azoy, we have built this product called Keto. It's a smart storage, monitors your health. So, I'll just give a quick overview of Keto. So, it has, it works on Bluetooth low energy. It has its own battery. Battery lasts for like two months. There are some sensors on the back of the cover where you place your fingers and like hold it for a few seconds and it will measure your ECG heart rate, respiration, blood oxygen level and blood pressure. I'll demo. It's a video. I couldn't get the device right now. So, basically, those are the electrodes for ECG. The below sensors are for your temperature and SPO2 readings. You are interested. Gets all the results with like medical grade accuracy. So, in this talk, I'll be focusing more on the challenges that we face when we, you know, when we are in the prototype and those, and what are the alternatives that we can use to overcome those challenges. And I'll talk about some frameworks which we use and which are like really good frameworks for where we want to, you know, have devices communicate with each other. So, before I start, I want to share some of my experiences with building few product prototypes. So, the first experience is from when I was in my university and we had to build a gateway in Python. So, at university, we decided the requirements. So, we were on clients and an API which allows developers to send and receive SMS because SMS gateways back in 2008 were very expensive. So, we thought of building REST APIs where developers can send and receive SMS using a cell phone connected with server. So, in order to do that, we needed a phone and some communication channel between the phone and the server. And this was part of our distributed computing curriculum. So, we decided to use oriented architecture. We also built a front end where you can see the messages that were in queue and the status of incoming messages. So, basic part was that we used a Symbian phone. How many of you are Symbian fans over here? So, yeah, back in 2008, Symbian was, I guess, the best operating system in, like, smartphone world before iPhone came. So, yeah, we decided to use Symbian and as Symbian has this Python support, so we used a library called Light View. Light View is a wrapper which is cross-platform across Linux, Mac and Symbian. So, we used same interface both on Linux and as well as on Symbian and to communicate it, to make communication channel between both the devices. So, initially we thought of doing it using 80 commands and stuff like that, but then we realized that use Light View, it would be much easier using Python. Yeah, and for the UI, so basically the architecture, yeah, we used this phone. It wasn't that powerful, like, no dual core quad core, but pretty enough to SQL, PHP and a basic Python. So, the basic architecture was that we had an application, a service running on Symbian phone, which would connect to the server and where we would store the incoming messages and the request for sending outgoing messages. And so we, using web services, basically developers would send a request and that request would be then transferred to the phone and from there to the network, our cellular network. So, using this we also built some of the applications which would utilize this APIs, basic chat clients like GTOC. Back in 2008 we had, we could chat on GTOC using SMS via the services. So, that was part of the demo. So, yeah, that was, so this experience, like, figured out that using Python, so this was the first time when I was, like, using Python on a project and I figured that using it was, like, it was quick to build. So, second experience is building a wireless presenter using Arduino. So, this was part of 24-hour hackathon. So, we basically collected a few devices and boards. So, in order to build a wireless presenter in 24 hours, we first had to finalize the components. So, we needed a microcontroller aboard which would run the application, a switch to navigate through the slides, some sort of power source because it was a handheld device, connectivity with the computer so that it could send the control messages and a control service running on the computer. So, we used Arduino because it's pretty easy to start with and we used it in the use, tactile switch, connected it with Arduino. We connected battery source. We chose to use wireless for communication because of this module which I will talk about later. And we had a simple service running on the machine, on the computer. So, there is an interesting board called Cactus Micro. It's basically Arduino plus ESP Wi-Fi module and gives you a very neat and tiny package of Arduino and Wi-Fi chip. So, we decided to use that and so the size of Cactus Micro is this tiny. So, these were the actions we wanted to perform. So, all the basic actions like navigating through the slides, making connection with the computer like pairing for the first time and a service which would accept those signals and fire events on the host machine. So, we did it using Arduino IDE but it was little time consuming. So, we thought how can we optimize it further or maybe better techniques to do it quickly. So, these were the actions that we decided like next slide one click, previous slide double click on the button and for connection we set it up as a Wi-Fi access point and connected. So, communication happens over HTTP. So, it's a basic get request from Arduino would switch it to the next slide and another request would switch it to previous slide. So, for firing events we use a bottle based app server plus PY, there is an interesting library called PY user which helps you inject event in OS, no matter which OS you use, it's basically supports all three of the major OSes Windows, Linux and Mac. So, then we realized that this module itself is more powerful than Arduino. So, the way it works is that and Arduino talks via serial, it happens to be that this module supports MicroPython. So, this was the time to try MicroPython because we don't have as many options when it comes to the Python world as we have in other languages. So, using MicroPython the connection and setup was as simple as this. So, all like hundreds of lines of Arduino code and we replaced it with this. So, it's pretty simple, you just connect to any SSID with WPA key, let us look at you register your callable connect to the server and so it was pretty neat and we used the button events from Arduino. This is the code from the whole time, which is equally simple because we basically get an instance of PY keyboard and then we just key event to switch the slide on the get request. So, yeah, so this is when again we realized that using Python can like speed up our prototyping process and because it makes it easy to make demoable applications. So, we extensively use Arduino Raspberry Pi, Beagle Bone. So, we basically build on form and use standard Python interpreter build applications and quickly test and come up with prototype products. So, if we look at the microcontroller options for Python, there aren't that many boards available in market, but there are few of them and more are coming. One is PY board. PY board is again a micro Python project. Another one is on Kickstarter, it's Wi-Py. It's quite powerful. PY board itself has like accelerometer, 168 megahertz, CPU, GPIOs and some LEDs and a switch. So, building simple applications using this board is very straightforward. It gives us the Python interface to interact with all the hardware which we connect with this device. It also has a micro SD slot. It lets you access a file system. So, if you want to build something which lets you capture some logs and stores it locally and syncs periodically in order to save battery or something, then we can do it. But the problem is this one doesn't have Wi-Fi in it. We can do it using the serial interface. Another option is Wi-Py. This one is interesting. It comes with Wi-Fi and micro SD slot. The problem is it's pre-order. They'll start shaping it in September, I think. So, this one is the Kickstarter project. So, if we have more of such boards, I think it would make it easy for hobbyist makers to quickly fix their ideas. So, on the frameworks and we have proto-bups, like any internet of things system would need some sort of mechanism to interact with each other. So, there are a few of them are like MQTT and proto-bups. Mostly, it's used together. Like proto-bups are used for serialization and transferred via MQTT. There's this interesting library called WebIO Py. This library lets you install this library on your Raspberry Pi. It lets you access and see, monitor all the IO controllers, so all the inputs. So, I think how many of you have used proto-bups? Yeah, quite a lot. So, this is like if you are building something where multiple devices are communicating, I think this is something that it's a must have library because it takes a lot of work from our end because it's basically a language neutral library wherein you just declare your data structure and using proto-bups compilers. It will generate files for various programming languages. Let's say you are building an application using Java and your another application is using Python, third one is using C++, then the exchange happens using binary and is compatible with all the languages because the parsers are available for all the languages. It also provides validations and so in case you receive a proto-buff message and want to check if it's valid, you can easily do it without writing any code. It also provides backward compatibility. So, let's say if two of your devices, multiple devices are communicating and you want to upgrade the protocol, you can handle it in the new protocol, new implementation. So, MQTT is again, it's like HTTP and mostly binary. So, people use it with like proto-buff and MQTT in order to make a communication network between devices. It also supports a PubSub model. Yeah, this is a very good documentation including proto-buff. Proto-buff also has documentation. This one is like very simple if you want to connect some LEDs or motors with Wi-Fi and want to see if it's working or not. It wants to quickly test if your connections are proper or not. You can install Wi-Fi and then you can access the web UI from under the machine and see if things are connected properly or not. Basically, you can control GPIOs using web-based UI. It also provides rest interface. So, for basic application, you may not even need to write any code on the embedded end. So, yeah, I think that's it. So, before closing, I would like to know if there are any questions for me. Thank you for the talk. It was very insightful to get started with something. I was wondering, obviously when I would start with experiments and I connect the Arduino controller and so on, how do you do the debugging around these components? Because I'm sure that the first thing that I'm going to be plugging together will not work. So, on Raspberry Pi, it's still very simple. But on the other boards, it gets difficult because most of the development boards has some sort of proprietary interface and libraries or framework tools which some of them are quite expensive. So, without that, you cannot debug. But, yeah, on Raspberry Pi, it's straightforward. Because it provides you a complete distribution, you can use all the tools that we use in normal development process. Any more questions? We have a little bit more time. There's, I think, a coffee break after this session. Maybe a Symbian question. Okay, she's kidding. Down there, okay. So, you showed us the case on the phone that could monitor stuff. Is it, you know, kind of production ready and what do you intend to do with this project? So, yeah, it's production ready. We have started shipping in UK. I can show you the demo offline. So, I mean, what's the typical use cases out there? What users can... So, I expected to hold the phone, get the health report when we're talking and holding the phone by hand. So, what do you plan with it? So, the purpose is to, you know, maintain a healthy lifestyle. So, in order to maintain a healthy lifestyle, you'll have to keep monitoring your vitals and see if everything is okay. So, the application is designed in such a way that it collects your data. Like, if you take reading twice a day. So, it will basically, using it over a period of time, you'll start seeing some trends. Start some activities in your, if there is any change in your lifestyle, you'll see how it's impacting your health. So, it's one of the use cases. Okay. And maybe a question from my side. And this application is also done with Raspberry or Embedded, Python or how do you read out the information? So, yeah, that application is available for both Android and iOS. It basically works with all the smartphones. The case is such that you stick it on your back of your phone. And it has nothing to do with phone as such. It basically is an independent component which talks to your phone and which you, we just visualized there. So, yeah, the Python is used extensively in building the product, not on the embedded side because it's used to test our algorithm. We have a backend service where you can sync all the data. So, this cloud platform is powered by Django. So, we use all the web stack is on Python. And as I said, for prototype, Python extensively because we, so in order to connect the sensors and easily try and see if it works or not. So, the iteration that we, in Python is much, much quicker than doing it the traditional way. Okay. There's another question. Hi. Thanks for talking. I'd like to ask you, how do you guys handle firmware upgrades? Sorry. Firmware upgrades. Firmware upgrades, yeah. Like if you're working with the PyBor or the Wi-Py or other boards, can you do Wi-Fi firmware upgrades or do you are forced to do, I don't know, over the wire? It's generally done over the air. So, basically, we maintain two separate images. So, once you flash these images, you switch to the backup image and you erase the other area, you upgrade it and then you again switch back to the newer image. So, that's how we do it. In case you want to deploy or kind of upgrade your own code running on the board, how do you guys? So, it's done using, so on the cloud and will basically output a new image which is delivered to the application. Application is on this, downloads the image and then it transfers to the product, the Keto case. You don't ever change the Keto case itself. I mean, if you want to upgrade the protocol, if you happen to find a bug in the case and you want to upgrade the case that is receiving and handling the data, but, you know, the case itself. The case itself. So, you are talking about the embedded side of it, right? Right. Yeah. So, we can update the image using standard Bluetooth framework. So, we have built a BLE service, which we can, we transfer some over to the case where it stores it in a pre-allocated area and once it receives all the data, it will verify whether the data received is basically a checksum integrity check and then once it ensures that the data received is correct and it will basically reboot to the new image. That's how we deliver upgrades. Okay. So, that's sort of custom made, right? Now, that's something that you get. Yeah. Yeah. That's a good way because there is no hard way for doing this. Thank you very much. Yeah. Thank you. Okay. Yeah. Yeah. I think Wi-Fi looks very promising. You can always try Micro-Python on like standard boards, but Wi-Fi is like built for this specific purpose. So, I think once it's out in market, I feel that it will definitely help a lot of people get started with building products. You know, if you want to build something like, let's, then you can use one of these boards. You can connect and you, because I feel Pythonic way is where, you know, it gets very, very simple to communicate with hardware. So, like you can connect all sort of hardware with Wi-Fi and use Micro-Python interface to operate them. So, I just wanted to recommend you some sessions on Thursday. I think there are several.