Basic knowledge
What exactly is IoT technology?
Recently I heard the phrase "wherever there is someone, there is IoT technology". It is said that there are universities that open this major, and I just want to know what this major studies?
"As long as there are people, there is Internet of Things technology." I don't know the source of this sentence, I only know that there are rivers and lakes in the place of someone ~ haha. What I want to say is that the term "Internet of Things technology" is a very broad concept. It can be said that there is no such technology. It can also be said that this technology is actually the basic technology in today's three major fields: electronics, communications, and computers.
The answer "The difference and connection between the Internet of Things and the Internet?" Simply clarified the relationship between the Internet of Things and the Internet. I would like to ask, since China's access to the Internet in 1994, as the original residents of the Internet, the post-90s generation, what kind of technology does the Internet technology think?
I wondered, why didn't the Education Bureau start an Internet technology major? In fact, there is no need to open an Internet major now. Most of the undergraduate courses in computer science at universities today are technologies that the Internet will use. One of them is Web site building technology.
What are HTML, HTML5, XHTML, CSS, SQL, JavaScript, PHP, ASP.NET, and Web Services in Web site building technology? Zhang Qiuyi's answer
what? Did n’t your computer department learn this? Come here, my computer is broken, come over and fix it for me ~
In short, the Internet is an era, and the Internet of Things is also an era. The Internet of Things technology is a big convergence of today's electronics, communications, computer, and IT industry technologies. As shown in the figure, the technical composition of the Internet of Things technology (simple version).
One of the Internet of Things technology: MCU / embedded development
Intelligent hardware, hey, isn't it just a microcontroller? After all, it is a microcontroller. Smart watches, dimming LED lights, Bluetooth unlocking, WIFi sockets, etc. are now emerging. Is n’t it just microcontroller development? Microcontroller, electronics and communications majors generally teach 51 or AVR, computer departments are not in contact. The popular Arduino is also a kind of microcontroller development.
But to make a kind of intelligent hardware, it is technically impossible to program only a single-chip computer. Oops, what intelligent hardware is essentially an electronic product! . So you have to develop a smart hardware that can be easily grasped, and the electronic system design must be able to!
Electronic system design (Electronic System Design and Practice (Douban)), I am not referring to the contents of the book "Electronic System Design", but a hands-on experimental process. To be intelligent hardware, it is useless to read books widely, and it is not enough to just program a single chip! What is really useful is a practical course design, or a project experience. An electronic system design process generally goes like this.
Hardware design phase:
MCU selection
· Circuit design (circuit diagram)
· Verification circuit (breadboard, universal board)
· Circuit board design (PCB drawing)
· Send the board to the factory or make the board yourself
· Component and material management (procurement, etc.)
· After getting the circuit board
§ Solder chips and components
§ Power-on test
§ Flash the last version of the code to the chip
If you are familiar with the above hardware design stages and know what to do, you are already a qualified microcontroller hardware engineer ~ The next thing is the microcontroller software engineer, the microcontroller software is generally not too complicated, and some do not use the operating system The development of bare metal, students who have done the course design of single chip microcomputer understand.
Software design process:
Determine the software architecture (main loop? State machine polling?)
Writing software
· Debugging code (development board or self-built circuit)
Program the final version of the code into the circuit
These are not complicated. If you use a higher level chip, not a microcontroller but a microprocessor, then it is embedded development.
ARM chip architecture series
Generally, the chip of the STM32 development board on the Internet is STM32F103, that is, the Cortex-M3 core, which is still a single-chip development. If the peripheral does not have too many functions, and the single-chip microcomputer wants to use a smaller one, you can choose a chip with M0 core. Already. If you develop with Cortex-A9, do you want to develop a mobile phone or a set-top box?
The development of Cortex-A series chips, or such products, is generally impossible for one person to complete all the work independently. This embedded development technology is divided into at least four levels: hardware layer, driver layer, system layer and application layer. Every level needs someone to design. The driver and system can be transplanted. The hardware circuit board must be done by a dedicated hardware engineer. The application layer can be handed over to the application engineer. As long as the Linux system is installed, isn't it Linux application development? If you buy the embedded development board online, the projects that can be obtained can only be developed at the application layer, such as "digital photo frame system" and "video on demand system". Don't tell me to learn to transplant uboot or Linux to find a job.
Internet of Things Technology 2: Network Communication Protocol
The biggest difference between intelligent hardware and traditional electronic products is that intelligent hardware is connected to the network. To connect to the network, you need to use a network communication module and learn the network communication protocol-TCP / IP.
TCP / IP is a general term for a technology, which contains two protocols, TCP and UDP, which are located in the transport layer of the network communication layered model and are also managed by the operating system. And HTTP, DNS, URI and other technologies belong to the application layer and are located on top of TCP / UDP. Similarly, the MQTT protocol for communication devices with limited computing capabilities, which is more popular recently in the Internet of Things, also belongs to TCP.
In order to allow electronic products to have networking capabilities, as long as a communication module is connected to the main control chip in the circuit design, the code for sending and receiving network instructions is written, and the rest is the electronic product design.
At this point, it is basically a prototype of an Internet of Things product. The above are also the electronic and communication technologies that will be basically used in the Internet of Things.
Internet of things technology 3: server-side development framework
Client / Server architecture. After the intelligent hardware is connected to the background server, it is a client and a terminal. Due to the limited resources in the single-chip microcomputer, it is actually impossible to use the HTTP protocol, so the development of a universal Web server in the Internet is not suitable for this. Some manufacturers will customize protocols on top of TCP, while others port protocols that others have done well, such as MQTT, CoAP, and so on.
Server-side development is more complicated. MCU / embedded software development is okay, as long as you learn C well, you will be able to beat the world, and server-side development, use Java or Python or PHP? Anyway, it is good to choose one between Java and Python. Engineers with embedded backgrounds generally learn Python.
There are many types of Python server-side development frameworks. Web development includes Django, Flask, TornadoWeb Server, TCP server can use Twisted, and so on. MQTT has a ready-made server. Servers like this do not need to be developed by themselves and can be deployed directly.
As shown in the figure, this is a server-side framework diagram for developing an intelligent hardware. Use Redis as the shared memory of the HTTP and TCP server data. The hardware client data received by the TCP server is stored in Redis. The client obtains the hardware data from Redis through the HTTP Server server, and then displays it to the Web or mobile phone. If the user needs to control the hardware, send a request to the HTTP server, and then Flask sends instructions to Redis. After Twisted receives the instructions from Redis, it will send instructions to the corresponding hardware side, and finally the hardware performs the response operation.
In the development of this project, it is necessary to develop the HTTP server on the client side and the TCP server on the hardware side. Both Flask and Twisted can be said to be server-side development technologies in Internet technology. Now I can use these two technical frameworks for use. Are they also considered as IoT technologies? The Internet of Things technology itself is developed from existing mature technologies.
At this point, the server-side development and the previous two technologies can be regarded as a layer. The previous development of the single-chip computer / embedded and network communication can be regarded as the development of an electronic device. As long as the back-end engineer has the electronic device, he knows the device. Which interfaces (APIs) are provided, you can do background development-connect the device to the network, assign it an IP or something, configure the interface and related operations, and leave the rest to the front end.
About front-end technology
Regarding front-end technology, I am not good at writing a separate topic here. First, I am not so familiar with front-end technology. I am still in the concept of front-end technology = HTML + JavaScript + CCS, and APP development on mobile phones. Second, front-end technology and electronics. The hardware technology is too far apart. The front-end is more to communicate with the artist, coordinate with the back-end, and communicate with the designer. It may even need a certain aesthetic sense. Third, the most important thing for most projects is to achieve the stability of the equipment. , Networking, data acquisition and control. If the device is unstable, the data is wrong, you can't control it, and even the beautiful front page is useless. Fourth, if you are doing smart home and consumer electronics projects, a beautiful interface is very important for the general consumer, such as WiFi sockets, but most IoT projects need only a background management interface.
Therefore, without a front-end design, the interface is ugly!
Fourth of Internet of things technology: wireless ad hoc network
Wireless ad hoc networks, or wireless sensor networks, is definitely a subject for students of the Internet of Things majors. It belongs to the field of communications, and people from electronic and computer backgrounds don't have much concept about this. One of the most typical technologies of wireless ad hoc networks is ZigBee.
What is an ad hoc network? For comparison, for example, our WiFi, we need to use a mobile phone to connect to an SSID, and enter the password to connect to WiFi, and your mobile phone, in general, it is not possible to send Wifi to other mobile phones to connect, the WiFi network topology becomes a star Type net.
Ad hoc networks are not the same. Users do not need to enter a user name and password. They directly connect to the nearest ad hoc network device. Finally, the ad hoc network device can also be used as an intermediate node for the next level of devices to connect in. The network topology can be Star network, cluster network and mesh network. So how does the data of the wireless ad hoc network flow? Where is it going? Wireless ad hoc networks generally have a place where data is aggregated, and this place is the gateway.
But ZigBee is not connected to the Internet, it is only a LAN at most! -Isn't this easy? This is what the gateway has to deal with. Moreover, ZigBee protocol stack Z-Stack is available in Linux gateway version.
Z-Stack-ZigBee protocol stack
However, due to various reasons, ZigBee has started to decline, and the latest 6LoWPAN will gradually replace it. 6LoWPAN is a low-power wireless mesh network where each node has its own IPv6 address, allowing it to connect directly to the Internet using open standards. ZigBee uses a dedicated address on the network, which cannot be accessed by Internet hosts. The open source operating system contiki, which integrates the IPv6 / 6LoWPAN stack, will gradually replace Z-Stack.
If the university offers a wireless ad hoc network course, either ZigBee's Z-Stack or Contiki. The use of wireless ad hoc networks is not a separate development process, and its technology needs to be combined with microcontroller / embedded development.
Power problem
Yes, if you want to use wireless ad hoc networks, battery life is a problem. If it is similar to WiFi sockets, smart water dispensers, smart fans, etc., it can be used after receiving electricity from the market. These power sources are not a problem. For wireless ad hoc networks, in the big direction, all portable smart devices are limited by battery life, such as smart watches and sports bracelets. However, the breakthrough of battery technology is not a task for IoT developers. What we can do is to choose a chip with lower power consumption, design a circuit with lower power consumption, let the microcontroller sleep and use interrupt wakeup .
A certain 430 single-chip microcomputer system powered by a fruit battery
Five of IoT technology: RFID
Take a closer look at the picture of the wireless technology above, the far right, NFC / RFID. Well, yes, RFID, non-contact radio frequency identification is also the most important technology of the Internet of Things technology. Many Internet of Things books will introduce RFID. Many people think that RFID is the Internet of Things.
Before introducing RFID, briefly talk about barcodes. When going to the supermarket for shopping, the cashier scanned the barcode on the scanner and the product information and price were entered into the computer. The bar code replaces the manual entry of data by cashiers, which improves productivity several times.
However, after entering the 21st century, barcodes can no longer meet people's needs. Small storage capacity, short working distance, weak penetrability, and inability to write are all the disadvantages of barcodes. At this time RFID technology appeared. Typical applications are as follows:
(... doesn't seem strange?)
The first and second-tier cities have already implemented public transport cards, as well as campus card, using RFID technology. RFID is readable and writable, so the money for bus and campus cards can be stored in the card.
NFC is also a kind of RFID technology. At present, most mobile phones support the NFC function. It is a matter of time before mobile phones replace bus cards. If your phone does n’t have NFC, you can pretend like this:
At work, I met colleagues in the subway.
I saw that it was very convenient for him to use his mobile phone to swipe his card in and out, so he asked him how he did it, and whether he wanted to download any software.
He told me: "This is very simple, as long as the bus card is hidden in the mobile phone case."
Similarly, the development of RFID is also inseparable from the development of single-chip microcomputers, and related RFID development kits are also sold online.
Conclusion
Of course, the Internet of Things technology is definitely more than the above five. The Internet of Things itself is a big fusion of all technologies, making electronic products.