Design of Internet of Things Server Based on ARM-LINUX Platform

Publisher:码字徜徉Latest update time:2016-04-07 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
  The ARM-Linux Internet of Things server is built based on the XSCALE PXA270 processor platform and the open source Linux system. The 51 single-chip microcomputer is used to connect peripheral devices such as temperature and humidity sensor modules and LED lights, and the Up-Tech embedded experiment box based on the XSCALE PXA270 processor is used as the core server operating platform. First, the ARM-Linux system construction of embedded devices and the communication design between the daemon and CGI programs are introduced, and then the iQuery class library and AJAX technology used in the construction of the Web server and the design and implementation of the network program design are introduced in detail.
  The Internet of Things is an extension of Internet applications and an emerging networking technology. Its core is the information communication and exchange between objects and the interactive control between objects and people. The Internet of Things technology mainly uses various sensor devices, such as wireless technology, radio frequency identification (RFID) technology, and various sensors and other technical devices to transmit various information in the physical world, such as temperature, light intensity, location, etc., through the network to achieve the purpose of information interaction between objects and between objects and people.
  In order to enable people to easily access Internet of Things information, monitor and control various sensor nodes and electrical equipment, a friendly user interface is a prerequisite. The solution based on B/S architecture has become the first choice for building systems due to its client versatility. This paper will design and develop a universal IoT server based on the ARM processor platform and Linux embedded operating system. On the hardware platform, the UPTECH embedded development experiment box based on the XSCALEPXA270 processor, 51 single-chip microcomputer and various sensor control devices will be used. The ARM LinuX system is used on this embedded device, and the server is built under the embedded Linux system. The B/S architecture is adopted, and BOA is used as the WEB server. Remote information transmission and intelligent interaction are realized through CGI communication.
  1. System architecture
  In order to highlight the low power consumption, low cost, high service level and high processing efficiency of modern IoT server systems, the server will run on the UP-Tech embedded device based on the XSCALE PXA270 processor, and use the 51 single-chip microcomputer to connect various sensor control devices. The
  ARM Linux operating system with the 2.6.28 kernel is ported to the UP-Tech embedded device. On the Linux system, a daemon is written to communicate with the 51 single-chip microcomputer, so as to communicate and control with various sensor control devices on the Linux system. The Boa WEB server is transplanted on Linux to build an interactive user access interface. Users can view or control various sensor control devices in real time by accessing the page through a browser. The
  system architecture is shown in Figure 1.

Figure 1 System architecture
  2. Design of IoT data acquisition and processing subsystem
  2.1 Data acquisition system based on 51 single-chip microcomputer
  In terms of IoT terminal devices, 51 single-chip microcomputer is used to connect with temperature sensors, humidity sensors, LED lights and other modules through its rich external expansion interface. The "C language + driver library" development model is adopted in software. Through this development model, it can not only improve development efficiency, but also complete the information collection and processing of multiple sensors. In terms of connecting to the ARM-Linux embedded platform, the UART virtual serial port is used to connect and communicate with the embedded platform. The
  basic functions of this system are as follows:
  (1) Connect each sensor module, obtain the information transmitted by the sensor through the input and output interface and record it;
  (2) Set the timer to collect the information of each sensor device and control the status of the device within the specified unit time. The information and status of these data are combined into a data packet and sent through the virtual serial port;
  (3) The virtual serial port communication is used to detect the control signal sent from the ARM-Linux platform at all times;
  (4) The data packet transmitted from the serial port is analyzed to detect the source of the data to determine whether it is legal, and then the microcontroller and each control module are controlled according to the specific control code.
  2.2 Data processing system based on the ARM-Linux platform
  The ARM-Linux platform refers to the use of the open source Linux kernel after specific requirements are cut, and after cross-compilation, a Linux kernel that can run on the ARM processor is obtained. At the same time, a Linux root file system is customized. The capacity of the entire system is controlled between hundreds of KB and tens of MB. The system mainly consists of three parts: BootLoader, ARM-Linux kernel, and Linux root file system.
  On embedded devices, the main data processing system is implemented by the daemon. The daemon is responsible for receiving and processing the information sent by the microcontroller on the one hand, and accepting the query control request from the WEB server on the other hand.
  On the IoT server side, the request from the client is received and verified by the server, and the request query and control instructions are passed to the daemon. The daemon receives the request from the server and sends the request query and control instructions to the microcontroller after verification.
  The communication process of the daemon is divided into two parts. The first part is that the daemon informs the CGI program on the server side of the update data, and the second part is that the CGI program on the server side sends a command control to the daemon, and the daemon monitors and executes the control program.
  3. Human-computer interaction subsystem-WEB server design
  Since the hardware resources of embedded devices are generally limited, they cannot handle requests from multiple users at the same time. Therefore, in the selection of WEB servers, some WEB servers developed specifically for embedded devices are selected. These servers have the advantages of low memory space, high processing efficiency, and high security, and are quite suitable for embedded application fields. On the other hand, in actual applications, due to the rapid development of the Internet and the arrival of 3G networks, everyone hopes to access and control their own IoT devices through handheld devices in their hands. Using a lightweight WEB server as an access control server can accomplish the task quite well.
  3.1 Server working principle
  The architecture of the embedded WEB server adopts the B/S architecture, which is composed of the server and the client. In this architecture, the following steps will be used to communicate with the WEB server.
  (1) Enter the IP address of the WEB server in the client's browser;
  (2) The client first initiates a connection request through TCP, and then the server immediately establishes a connection after the authentication confirms that the request is legitimate. In this process, the "three-way handshake" method of the TCP/IP protocol is used to establish the connection;
  (3) After the connection is established through TCP/IP, the browser then uses the HTTP protocol to send an HTTP request;
  (4) When the server receives the HTTP request, it parses it and performs other operations, and then performs corresponding return operations based on different processing results.
  (5) After the client receives the return result from the server, it parses the HTML data packet and then displays it on the browser.
  3.2 Transplantation of Boa WEB Server
  Boa is a single-task WEB server. That is, it can only respond to another connection request after completing one request. Although it cannot achieve concurrent responses, it is enough to handle embedded application processing. In addition, Boa is also a very lightweight WEB server. The executable file obtained by cross-compilation is only about 60kB. Due to the simplicity of design and application requirements, Boa only supports CGI.
  Download the source code of boa from WWW.boa.org. Complete its cross compilation through the following steps:
  #tar—bxzf boa-0.94.1 3.tar. gz
  #cd ./boa-0.94.13/src
  #./configure
  #vi./Makefile
  Modify CC=gcc to CC=arm-unknownlinux-gcc, CPP=gcc -E to CPP=arm-unknownlinux-cpp -E, save and exit. Execute the following commands:
  #make
  #arm-linux-strip./boa
  Get the executable file boa that can be used on the arm platform, the size is only 60KB
  After downloading the executable file Boa to the embedded device, it still needs to be configured. First, you need to create a boa configuration file boa.conf in the /etc/boa directory. Table 1 is a partial configuration description of the Boa configuration file:
Table 1 Boa configuration file configuration parameter description
  3.3 Common Gateway Interface CGI
  CGI is the abbreviation of Common Gateway Interface. This interface defines the communication interface standard between the WEB server and other executable programs. Generally, we also refer to these executable programs as CGI programs. On the client browser, you can request to execute the CGI program and send parameters. When the server receives this request, it executes the corresponding CGI program and passes the transmission from the client to the CGI program. Between the server and the CGI program, they can use standard input and output to implement parameter transmission and information return.
  In the design of this IoT server, the CGI program not only communicates with the WEB server, but also needs to communicate with the daemon. Since the daemon is responsible for connecting to and communicating with peripheral devices, it is possible to communicate with peripheral devices through the CGI program. Through this communication process, the interaction between the client and the IoT device terminal is realized. The communication process is as follows:
  (1) The client uses the TCP/IP protocol to establish a connection with the WEB server;
  (2) The client uses the HTTP protocol to send a request with a URL pointing to a CGI program;
  (3) After receiving the request, the server executes the corresponding CGI program;
  (4) The CGI application is executed and can obtain parameters from the client by reading standard input or environment variables (QUERY STRING);
  (5) The application uses standard output to output the return results to the WEB server.
  (6) The WEB server transmits the result to the client, completing the entire request return process.
  3.4 Access and control of network applications
  The access and control of the website uses JavaScript language, calls the jQuery library and uses AJAX technology to achieve the effect of dynamically displaying pages. The parameter transfer and CGI feedback of the page both use the JSON data format.
  JSON is JavaScript Object Notation, which is a lightweight data exchange format. This design uses the collection of "name/value" pairs in the JSON data format as the basic data structure, which is used as the data format for parameter transfer and calculation result return between the page and the CGI program. The basic format is as follows:
  {device: "value", model: "value", type: "value", data: "Value"}
  Using the jQuery library, every 1 s through the request. /cgi-bin/web_cgi. Get the request result as the current state.
  4. Summary
  This paper implements the design of a general Internet of Things server based on the ARM-Linux platform. This design can provide users with real-time monitoring and control functions for data collection in the Internet of Things through WEB pages, which has good practical significance. The next step will be to continue to improve the system's functions, such as adding support for more sensors, how to more conveniently apply the system to different fields, etc. The security of the system also needs to be improved.
Keywords:ARM Reference address:Design of Internet of Things Server Based on ARM-LINUX Platform

Previous article:About USE_STDPERIPH_DRIVER problem in STM32 MDK
Next article:arm assembly - ldr pseudo instruction

Recommended ReadingLatest update time:2024-11-23 21:28

ARM immediate number explains the difference between LDR and MOV.
Mov is to assign an immediate value to a register, but there is a requirement for the range of the immediate value. It can only be a number that can be obtained by shifting 8 consecutive valid bits an even number of times. If the immediate value exceeds this range, there is no way to assign a value to the register usin
[Microcontroller]
Intelligent disinfection robot control system for livestock breeding based on ARM7
1 Overall design The livestock breeding intelligent disinfection robot control system consists of three parts: robot intelligent control module, monitoring module, and wireless network communication module. The working process is to send control command codes to the remote robot through a mobile phone or mi
[Microcontroller]
Use of ARM's list box control
Use of List Box Controls 1. Experimental Purpose Learn how to use list box controls. Continue to learn the file-related API functions of the operating system. Through the API functions of several files , display the bitmap file name with the specified extension (*.bmp) in the list box. You can select fi
[Microcontroller]
Use of ARM's list box control
Sensorless square wave driven water pump solution based on MM32SPIN05TW of arm cortex m0
1. Introduction: This article briefly introduces the application example of sensorless square wave drive based on MM32SPIN05TW in "small water pump". Program Features: ARM Cortex-M0 high-performance motor drive chip 32K bytes flash memory, 4K bytes memory, 72MHz high-speed operation, with built-in divider, ADC, comp
[Microcontroller]
Sensorless square wave driven water pump solution based on MM32SPIN05TW of arm cortex m0
Design of high-speed communication protocol for multi-processors based on ARM and DSP architecture
At present, multimedia applications based on broadband networks are increasing day by day, and high-performance DSPs are constantly being innovated. Since DSP has very flexible programming and computing capabilities, it uses different encoding software for different encoding standards, and the chip price is suitable
[Microcontroller]
Design of high-speed communication protocol for multi-processors based on ARM and DSP architecture
Arm's comprehensive computing solutions redefine visual experience and empower mobile gaming
Arm's comprehensive computing solutions redefine visual experience and empower mobile gaming News Highlights: • New flagship Immortalis GPU will significantly improve the Android gaming experience and debut hardware-based ray tracing capabilities • Latest Ar
[sensor]
Arm's comprehensive computing solutions redefine visual experience and empower mobile gaming
1. ARM9 (S3C2440) interrupt system - program example explanation
The following program explanation is based on the FL2440 development board program explanation. If there is anything wrong, I hope you can give me some advice. Interrupt control program writing steps Main Program 1. Clear the interrupt source pending register (SRCPND SRCPND) and the interrupt pending register (INT
[Microcontroller]
The first instruction after arm power on
There are many similar articles on the Internet, most of which focus on software analysis, from U-boot to kernel. Many articles are also very detailed and insightful. Here, I don't want to talk more about the software mechanism, I'll leave that opportunity to everyone.               I remember an interview at Huawei
[Microcontroller]
The first instruction after arm power on
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号