Python & Internet of Things
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Part Number | 138 | |
Number of Parts | 173 | |
Author | ||
License | CC Attribution - NonCommercial - ShareAlike 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this | |
Identifiers | 10.5446/20193 (DOI) | |
Publisher | ||
Release Date | ||
Language | ||
Production Place | Bilbao, Euskadi, Spain |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
| |
Keywords |
00:00
InternetworkingMobile WebOffice suiteNeuroinformatikComputer animation
00:30
Spherical capSpacetimeSoftware developerSource codeInternet der DingeOffice suiteMobile WebProduct (business)Dependent and independent variablesWeb 2.0JSONComputer animation
01:02
Disk read-and-write headFood energyJSONComputer animation
01:22
2 (number)Inequality (mathematics)Order (biology)Covering spaceLevel (video gaming)MeasurementPressureDemo (music)Bit rateVideoconferencingRight angleElectronic program guide
02:03
GradientResultantComputer animation
02:24
Computer programmingPrototypeExterior algebraSoftware frameworkJSONComputer animation
02:44
PrototypeBuildingProduct (business)Shared memoryPrototypeUniverse (mathematics)Gateway (telecommunications)Client (computing)JSONComputer animation
03:09
Gateway (telecommunications)Universe (mathematics)Software developerGateway (telecommunications)SummierbarkeitGame controllerRepresentational state transferComputer animation
03:31
Representational state transferOrder (biology)NeuroinformatikMereologyServer (computing)TelecommunicationForm (programming)SummierbarkeitComputer animation
03:56
Computer architectureFront and back endsBitDebuggerMessage passingQueue (abstract data type)MereologyComputer animation
04:17
InferenceParticle systemHand fanOperator (mathematics)SmartphonePhysical systemGame theoryWordComputer animation
04:40
Library (computing)Cross-correlationView (database)Cross-platformWrapper (data mining)Similarity (geometry)Interface (computing)
05:00
Execution unitInterface (computing)InternetworkingMereologyTelecommunication
05:20
Gateway (telecommunications)Computer architectureForm (programming)QuadrilateralDuality (mathematics)
05:50
Gateway (telecommunications)AnalogyHoaxService (economics)Message passingSoftware developerServer (computing)Cartesian coordinate systemSoftwareDemo (music)Multiplication signProjective planeWeb 2.0Client (computing)Figurate numberTablet computerMereologyEstimatorComputer animation
07:01
Wireless LANPresentation of a groupMereologyWhiteboardOrder (biology)Connectivity (graph theory)MicrocontrollerComputer animation
07:25
MicrocontrollerWhiteboardCartesian coordinate systemWebsiteLogic gateCentralizer and normalizerPower (physics)Connected spaceNeuroinformatikQuicksortFood energyMessage passingGame controllerService (economics)Computer animation
07:47
NeuroinformatikTelecommunicationModule (mathematics)Service (economics)WhiteboardSource codeReading (process)Virtual machineParameter (computer programming)Computer animation
08:22
Wireless LANModule (mathematics)Computer animation
08:45
Group actionGroup actionNeuroinformatikConnected spaceMultiplication signEvent horizonService (economics)JSONComputer animation
09:07
Virtual machineEvent horizonMultiplication signIntegrated development environmentMultilaterationMIDIComputer animation
09:28
Group actionSlide ruleConnected spacePoint (geometry)TelecommunicationState of matterJSON
09:50
Endliche ModelltheorieSlide ruleMobile appServer (computing)Event horizonAbsolute valueLibrary (computing)InjektivitätJSON
10:11
Noise (electronics)Normal (geometry)WindowEndliche ModelltheorieFormal languageComputer configurationModule (mathematics)Right angleMultiplication signJSONComputer animation
10:58
Connected spaceLine (geometry)View (database)CodeComputer animation
11:19
OvalEvent horizonMultiplication signKeyboard shortcutInstance (computer science)Computer animation
11:44
Keyboard shortcutEvent horizonEvent horizonSlide ruleCartesian coordinate systemComputer animation
12:07
PrototypeStandard deviationComputing platformInterpreter (computing)Product (business)Cartesian coordinate systemBuildingPrototypeSoftware testingType theoryComputer animation
12:29
MicrocontrollerWhiteboardMicrocontrollerComputer configurationAnalogyWordLevel (video gaming)Projective planeComputer animation
12:52
WhiteboardCartesian coordinate systemData storage deviceComputer configurationLibrary (computing)Video gameFile systemInterface (computing)BefehlsprozessorOrder (biology)Schmelze <Betrieb>Online helpSerial communicationComputer hardwareLoginComputer fileMotion captureComputer animation
13:49
Order (biology)Projective planeWhiteboard
14:12
InternetworkingSoftware frameworkPhysical systemMechanism designQuicksortInteractive televisionJSONComputer animation
14:33
Endliche Modelltheorie1 (number)Serial portLibrary (computing)Web 2.0Computer animation
14:54
outputGame controllerEndliche ModelltheorieComputer animationJSON
15:14
Reading (process)Library (computing)Data structureFormal languageJSON
15:34
Compilation albumData structureProduct (business)Programming languageElectric generatorComputer fileRadiusJava appletCartesian coordinate systemJSON
15:54
Formal languageParsingMessage passingCASE <Informatik>Valuation (algebra)JSON
16:15
MultiplicationCommunications protocolImplementationJSONComputer animation
16:38
SoftwareOrder (biology)TelecommunicationEndliche ModelltheorieUniform boundedness principleCondition numberComputer animation
16:59
Set (mathematics)Condition numberHydraulic motorRight angleSoftware testingOctahedronConnected spaceComputer animation
17:22
Web 2.0Virtual machineCartesian coordinate systemCodeJSONComputer animation
17:43
Information managementVector spaceComputer animation
18:05
Game controllerComputer animation
18:25
Connectivity (graph theory)WhiteboardSoftware developerQuicksortInterface (computing)Library (computing)Right angleComputer animation
18:45
Library (computing)Software frameworkDistribution (mathematics)Normal (geometry)Software developerProcess (computing)Computer animation
19:07
Control flowBitMultiplication signScaling (geometry)Product (business)CASE <Informatik>Form (programming)Computer animation
19:30
Outline of industrial organizationOcean currentProjective planeProduct (business)Demo (music)CASE <Informatik>Computer animation
19:55
Traffic reportingOrder (biology)Cartesian coordinate systemComputer animation
20:16
Cartesian coordinate systemMultiplication signTwitterFrequencyUniverse (mathematics)Coma BerenicesMathematicsComputer animation
20:37
MathematicsVideo gameCASE <Informatik>Disk read-and-write headCartesian coordinate systemTheoryComputer animation
20:58
Cartesian coordinate systemInformationSmartphoneCASE <Informatik>outputForm (programming)Computer animation
21:19
Connectivity (graph theory)Computer animation
21:40
AlgorithmService (economics)SynchronizationCloud computingWeb 2.0PrototypeRight angleForm (programming)Computer programmingComputer animation
22:04
Order (biology)Connected spaceIterationHypermediaComputer animation
22:25
Software frameworkFirmwareWhiteboardComputer animation
22:45
Traffic reportingLibrary (computing)FirmwareSoftware frameworkMedical imagingBackupService (economics)Computer animation
23:07
AreaMedical imagingCASE <Informatik>CodeWhiteboardPoint cloudComputer animation
23:28
InformationMedical imagingCartesian coordinate systemGoodness of fitHeat transferMathematicsProduct (business)CASE <Informatik>Game theoryMereologyComputer animation
23:48
Communications protocolCASE <Informatik>Software bugMedical imagingStandard deviationSoftware frameworkView (database)Data storage deviceService (economics)Computer animation
24:12
Service (economics)CASE <Informatik>Field (computer science)INTEGRALComputer animation
24:33
QuicksortRight angleComputer animation
24:53
Computer animation
25:15
Standard deviationWhiteboardLatent heatComputer animation
25:37
WhiteboardProduct (business)Computer animation
26:00
Computer hardwareQuicksortMereologyInterface (computing)Computer animation
26:22
Computer animation
Transcript: English(auto-generated)
00:00
to you Ravi. Thank you. I'm Audible, right? How many of you have used Arduino or Raspberry Pi? Yeah. So, the talk covers about Raspberry Pi and Arduino. So, I've come all the way
00:22
from India. So, this is my first talk. I work with a company called Azoi. Azoi, at Azoi we basically focus on health and mobile computing. We have offices in US and India. I take
00:42
care of software development responsibilities at Azoi. 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 Azoi we have built this product called Keto. It's a smart which monitors
01:08
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
01:25
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.
01:42
It's a video. I couldn't get the device right now. So, basically those are the electrodes for ECG. The sensors are for your temperature and SPO2 readings. If you are
02:04
interested, it gets all the results with like medical grade accuracy. So, yeah. So, in this talk I'll be focusing more on the challenges that we face when we, you know,
02:26
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
02:40
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
03:06
a gateway in Python. So, at university we decided the requirements. So, we were our own clients
03:20
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 which, where developers can send and receive SMS using a cell phone connected with server. So, in order to do that,
03:44
we needed a phone and some communication channel between the phone and the server and this was a part of our distributed computing curriculum. So, we decided to use oriented architecture.
04:03
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
04:24
Symbian fans over here? So, yeah. Back in 2008, Symbian was, I guess, the best operating system in like smartphone world before like iPhone came. So, yeah. We decided to use
04:42
Symbian and as Symbian has this Python support, so we used a library called Lightbue. Lightbue is a wrapper which is cross platform across Linux, Mac and Symbian. So, we used
05:00
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 AT commands and stuff like that, but then we realized that use Lightbue, it would be
05:21
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 basic Python. So, the basic architecture was, yeah. So, we
05:52
had application 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.
06:05
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.
06:23
So using this, we also built some of the applications which would utilize this APIs, basic chat clients like GTOC. Back in 2008, we could chat on GTOC using SMS via the services.
06:42
So that was part of 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
07:05
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
07:21
presenter in 24 hours, we first had to finalize the components. So we needed a microcontroller board 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
07:45
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 use tactile switch,
08:03
connected it with Arduino, we connected battery source. We chose to use Wi-Fi 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.
08:30
It's basically Arduino plus ESP, the 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
08:47
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
09:03
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
09:20
thought how can we optimize it further or maybe other 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
09:46
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 used a model based app server plus PY, there is an interesting
10:08
library called PY user which helps you inject event in OS no matter which OS you use, basically it supports all three of the major OS's, Windows, Linux and Mac. So then we realized
10:27
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
10:44
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 yeah, using MicroPython
11:01
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, data socket, you register your callable, connect to the server and
11:27
so it was pretty neat and we used button events from Arduino. This is the code from the hotend which is equally simple because we basically get an instance of PY keyboard
11:45
and then we just use key event to switch the slide on the get request. So yeah, this is when again we realized that using Python can like speed up our prototyping process
12:00
and because it makes it easy to make demo-able applications. Yeah, so we extensively use Arduino, Raspberry Pi, BeagleBone, so we basically build on platform and use standard
12:22
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,
12:48
PY board is again a micro Python project. Another one is a kick starter, is on kick starter, it's Wipy. It's quite powerful, PY board itself has like accelerometer,
13:04
168 megahertz CPU, GPIOs and some LEDs and a switch. So building simple applications using this board is very straightforward. It gives us the Pythonic interface to interact with all the hardware which we connect with this device. It also has a micro SD slot,
13:25
it lets you access file system, so if you want to build something which let's say captures 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
13:42
in it, we can do it using the serial interface. Another option is Wi-Fi, this one is interesting, it comes with Wi-Fi and micro SD slot. Problem is it's pre-order, they'll start
14:00
shipping it in September I think. So this one is a kick starter project. So if we have more of such boards, I think it would make it easy for hobbyist makers to quickly develop their ideas. So on the frameworks and we have protobups, like any internet
14:25
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 protobup, mostly it's used together like protobups are used for serialization and transferred via MQTT. There is this interesting
14:48
library called Web IOPI, this library lets you install this library on your Raspberry Pi, it lets you access and see, monitor all the IOPI controllers, all the inputs.
15:07
So I think how many of you have used protobups? Yeah, quite a lot. So this is like if you are building something where multiple devices are communicating, I think this is something
15:21
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 protobup compilers it will generate files for various programming languages.
15:42
Let's say you are building an application using Java and 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
16:02
provides validations, so in case you receive a protobup 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
16:24
upgrade the protocol containing previous devices, you can handle it in the new protocol, new implementation. So MQTT is again, it's like HTTP, mostly binary, so people use
16:44
it with like protobuf and MQTT in order to make a communication network between two devices. It also supports pubsub model. This is a very good documentation, including protobuf.
17:01
protobuf also has the best documentation. This one is very simple, if you want to connect some LEDs or motors with your Pi and want to see if it's working or not, if you want to quickly test if your connections are proper or not, you can install biopie and
17:24
then you can access the web UI from another 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.
17:45
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 that talk. It was very insightful to get started with something. I was wondering,
18:17
obviously when I would start with experiments, connecting an Arduino controller and so on,
18:23
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 have some sort of proprietary interface and libraries
18:46
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.
19:08
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, just kidding. Down there, okay.
19:29
So you showed us the case on the phone that could monitor stuff. Is it 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.
19:49
So I mean, what's the typical use cases out there? What users can, so are they expected to hold the phone or get their health report while talking
20:01
and holding the phone by hand? So what do you plan with it? So the purpose is to maintain a healthy lifestyle. So in order to maintain a healthy lifestyle, you will have to keep monitoring your vitals and see if everything is okay. So the application
20:21
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
20:40
it's impacting your health. So that's one of the use cases. And maybe a question from my side and this application is also done with the Raspberry or embedded Python or how do you reading out the information? So yeah, that application is available for both Android
21:03
and iOS. Basically works with all the smartphones. The case is such that you stick it on your back of your phone. 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. Sorry?
21:31
Where is Python? Yeah, Python is used extensively in building the product, not on the embedded side
21:43
because it's used to test our algorithm. We have a backend service where you can sync all the data. So using this cloud platform is powered by Django. So we use all the web stack is on Python and we for, as I said, for prototype Python extensively because we, so in
22:06
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.
22:34
Hi, thanks for talking. I'd like to ask you how do you guys handle firmware upgrades? Sorry?
22:42
firmware upgrades. How do you guys, like if you're working with the Pi board or the wi-pi or other boards, can you do wi-fi firmware upgrades or you are forced to do, I don't know, over the over the wire? It's generally done over the air. So basically we maintain two
23:02
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. Okay, in case you want to deploy or kind of upgrade your own code
23:23
running on the board, how do you guys? So it's done using, so on the cloud and will basically a new image which is delivered to the application. Application is on the downloads the image and then it transfers to the product the Keto case. You don't never change
23:44
the Keto case itself? I mean if you want to upgrade the 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
24:03
right? Yeah, so we we can update the image using a standard bluetooth framework. So we have built a BLE service via which we can we transfer some over to the case where it stores it in us as allocated a pre-allocated area and once it receives all the data it will verify
24:24
whether the data received is basically a checksum integrity check and then once it ensures that the data received is correct then it will basically reboot to the new working that's how we deliver upgrades. Okay, so that's sort of custom made right?
24:42
No, that's something that you get. Yeah, yeah, that's because there is no 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
25:31
micro-python on like standard boards but Wi-Fi is like built for this specific purpose so I think
25:40
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 like then you can use one of these boards you can connect and you because I feel pythonic ways where you know it gets very very simple
26:01
to communicate with hardware so like you can connect all sort of hardware with Wi-Fi and use a micro-python interface to operate them. So I just wanted to recommend
26:23
you some sessions on Thursday, I think.