"Cloud discussion"-using open-source technology and Azure public cloud services to quickly build cloud-based IoT solutions (I) and azureiot
The first lesson of "cloud discussion" technology class is coming soon! Microsoft's various technical experts gathered to bring continuous success! As a course class for "cloud discussion", we first invited Microsoft Azure's expert Architect: Huai Changqing, he gave us a detailed explanation of "using open source technology and Azure public cloud services to quickly build IoT solutions on the cloud.The author of this article introduces:Microsoft Azure expert-level architect, Jianghu said "Huai Changqing". He has been named Microsoft's most valuable expert for five years. He has many years of cloud computing experience and has in-depth research on Microsoft's public cloud solutions.Products and technologies involved:
Raspberry Pi, DebianLinux, Python, and Azure, do smart readers think they are in the wrong direction when they see the technology mentioned above? Is this shared by Microsoft technology? This is purely an open-source technology sharing. Is Azure mixed in the middle?
This is about to begin with Microsoft open source. In fact, Microsoft is fully embracing open source, so we are not mistaken. We really want to show you, for non-Microsoft platform and technology users, how does Azure help you quickly build an IoT platform. Therefore, in this solution, you will not see the Windows 10 IoT operating system or the. Net development environment. In addition, this article will not only talk about theory, but will take you step by step to implement a complete IoT solution.
In fact, this article is a technical summary and sharing of the Azure IoT solution I provide for a real customer. I hope that through this article, you can learn more about what the Azure IoT solution can do and how to do it. Also, through this article, you can learn about Azure's support for open-source heterogeneous systems.
IoT solution architecture:
Through the structural diagram, we can see that we will use the temperature sensor ADT7410, Raspberry Pi RaspberryPi 2, wireless Nic module, WiFi router, and finally connect to the Internet, and then perform cloud data processing through Azure, finally, the processed data is analyzed and presented.
Solution Process:
The general process of this solution is to read the temperature value of the ADT7410 temperature sensor through Raspberry Pi, then the Raspberry Pi uploads the received temperature value to the Azure event Hub service in real time through the WiFi module ), stream Analytics then processes the temperature data collected in the Azure Event Center Service in real time and stores the processed data in the SQL Database service, at last, we will analyze and present data in Stream Analytics or SQL Database through Power BI.
Because the process is long, we have made a series of articles on this solution and published them in two articles. This article introduces the process 1-3, that is, the setup of the Raspberry Pi and the installation and debugging of the temperature sensor. In the next article, we will continue to introduce the process 4-6, create and configure Azure services, code logic of the Python Azure application, and data verification through Power BI. Finally, summarize the solution. |
1. Install and set the OS for the Raspberry Pi:
Install the Linux operating system and write the OS to microSD to start the Raspberry Pi:
In this solution, we select Debian RASPBIAN.
Write the downloaded image to microSD. In this solution, we select Win32 Disk Imager v0.9.5. Write process. Select the image raspbian-wheezy.img as the source, and select the drive where the microSD is located for the target Device:
Use TeraTerm to manage RaspberryPi:
Use the serial port and USB conversion module to connect the Raspberry Pi and PC,
Slave. Configure TeraTerm: Set the COM port of TeraTerm, select the USB connection conversion module, and set the COM baud rate to 115200. Enable the console to log on and connect to Rapberry, for example (left). After configuration, you can manage the Raspberry Pi, for example (right ):
Set the OS:
Change the Pi user password and root administrator password:
OS file system expansion:
Run raspai-config and select ExpandFilesystem,
The wireless LAN Settings of RaspberryPi and the connection to the PC:
This part is related to the wireless Nic module used and the specific configuration of the Wi-Fi router. You can configure it according to the instructions for using the wireless LAN and Wi-Fi router. Be sure to use a wireless LAN that has an integrated driver by default.
After the configuration is complete, Raspberry Pi can access the network, and we can use TeraTerm to manage Raspberry through IP. After the Raspberry Pi is disabled, you can remove the USB serial port conversion cable.
3. Install and debug the temperature sensor:
Physical installation,
Configure the I2C module:
Run raspi-config again, configure and run the I2C kernel module, and set it to default boot loading:
Add a i2c-dev module to/etc/modules:
Run the I2cdetect command to view the BUS address of the ADT7410 device:
Verify that the ADT7410 Temperature Sensor works and the connection is normal. The adt7410.py verification test program:
After completing the preceding steps, the installation and configuration of Raspberry Pi and temperature sensor have been completed. In the next article, I will describe how to configure Azure services, this includes Event Hub creation and setting, SQLDatabase creation and setting, and Stream Analytics creation and setting. In addition, we will introduce in detail the code logic of the Raspberry Pi Python Azure program and how to use Power BI for data verification.
For more information, see our next article! Coming soon!
Finally, the editor has an appeal:
Visit http://market.azure.cn now