diff --git a/docs/Application_guide/en/background/about-qpy.md b/docs/Application_guide/en/background/about-qpy.md index 2fc26a49ed664405eecc525eb257dbea8c0efbc5..c3a16232ac14b124338340a17328e61f60cad335 100644 --- a/docs/Application_guide/en/background/about-qpy.md +++ b/docs/Application_guide/en/background/about-qpy.md @@ -1,4 +1,4 @@ -# Introduction to QuecPython +# Introduction to QuecPython This document will start with an introduction to the Python language and then elaborate on the origin, structure, and characteristics of QuecPython. Through this introduction, you can gain a relatively comprehensive understanding of QuecPython. @@ -10,64 +10,60 @@ The following two examples compare the implementation of the same functionality .. tabset:: Reading and displaying keyboard input -``` -## Using C language - -​```c -#include - -int main(){ - int number; - float decimal; - char string[20]; - scanf("%d", &number); - scanf("%f", &decimal); - scanf("%s", string); - - printf("%d\n", number); - printf("%f\n", decimal); - printf("%s\n", string); - - return 0; -} -​``` - -## Using Python language - -​```python -number = int(input()) -decimal = float(input()) -string = input() - -print(number) -print(decimal) -print(string) -​``` -``` - -.. tabset:: Simple for loop - -``` -## Using C language - -​```c -#include - -int main() -{ - for(int i = 0; i < 10; i++){ - printf("%d\n", i); + ## Using C language + + ```c + #include + + int main(){ + int number; + float decimal; + char string[20]; + scanf("%d", &number); + scanf("%f", &decimal); + scanf("%s", string); + + printf("%d\n", number); + printf("%f\n", decimal); + printf("%s\n", string); + + return 0; } -} -​``` + ``` + + ## Using Python language + + ```python + number = int(input()) + decimal = float(input()) + string = input() + + print(number) + print(decimal) + print(string) + ``` -## Using Python language +.. tabset:: Simple for-loop -​```python -for i in range(0, 10): - print(i) -​``` -``` + ## Using C language + + ```c + #include + + int main() + { + for(int i = 0; i < 10; i++){ + printf("%d\n", i); + } + } + ``` + + ## Using Python language + + ```python + for i in range(0, 10): + print(i) + ``` As an interpreted language, Python is highly portable and can run on various software and hardware platforms. Programs written in Python do not need to be compiled into binary code in advance; they can be executed directly from the source code. Additionally, Python has the most extensive and powerful libraries among scripting languages. These libraries cover most application scenarios, such as file I/O, GUI, network programming, and database access. When developing programs with Python, many functionalities can be implemented by calling existing libraries, which eliminates the need to write everything from scratch. Currently, Python is widely used in fields such as servers, databases, image processing, and artificial intelligence due to its simple syntax and rich functionality. @@ -83,38 +79,31 @@ MicroPython is a lightweight and efficient implementation of the Python language .. details:: About Interpreters -``` + An interpreter is a concept that is opposite to a compiler. As an interpreted language, Python's source code is transformed into machine-readable and executable binary form during runtime, rather than before execution. The tool that facilitates this process is called an interpreter. -An interpreter is a concept that is opposite to a compiler. As an interpreted language, Python's source code is transformed into machine-readable and executable binary form during runtime, rather than before execution. The tool that facilitates this process is called an interpreter. +
+ +
+
+ Execution process differences between interpreted and compiled languages +
+
+ For beginners, the interpreter can be loosely understood as the runtime environment for executing Python scripts. Currently, CPython is the most commonly used Python interpreter on computers. The term "Python" in most resources and tools typically refers to CPython. In the field of embedded systems, besides MicroPython, other interpreters such as CircuitPython and PikaPython are also popular among developers in China. -
- -
-
- Execution process differences between interpreted and compiled languages -
-
-For beginners, the interpreter can be loosely understood as the runtime environment for executing Python scripts. Currently, CPython is the most commonly used Python interpreter on computers. The term "Python" in most resources and tools typically refers to CPython. In the field of embedded systems, besides MicroPython, other interpreters such as CircuitPython and PikaPython are also popular among developers in China. - -For a more in-depth explanation of Python's code execution mechanism, you can refer to online resources such as "Differences and Workings of Compilers and Interpreters" and "An Introduction to Bytecode and Virtual Machines" or consult professional books on Python. -``` - -.. details:: About REPL + For a more in-depth explanation of Python's code execution mechanism, you can refer to online resources such as "Differences and Workings of Compilers and Interpreters" and "An Introduction to Bytecode and Virtual Machines" or consult professional books on Python. -``` .. details:: About REPL -REPL, short for Read-Eval-Print Loop, is a simple interactive programming environment. REPL typically provides a Command-Line Interface (CLI) that receives user input, parses and executes it, and then returns the results to the user. In terms of functionality and usage, it is similar to the Command Prompt (CMD) in Windows or the Shell in macOS/Linux. + REPL, short for Read-Eval-Print Loop, is a simple interactive programming environment. REPL typically provides a Command-Line Interface (CLI) that receives user input, parses and executes it, and then returns the results to the user. In terms of functionality and usage, it is similar to the Command Prompt (CMD) in Windows or the Shell in macOS/Linux. -
- -
-
- Python REPL Environment -
-
-The advantage of REPL is that it makes exploratory programming and debugging more convenient. The "Read-Eval-Print Loop" cycle is usually more efficient and faster than the classic "Edit-Compile-Run-Debug" cycle. REPL is particularly helpful for learning a new programming language because it immediately responds to beginners' attempts. -``` +
+ +
+
+ Python REPL Environment +
+
+ The advantage of REPL is that it makes exploratory programming and debugging more convenient. The "Read-Eval-Print Loop" cycle is usually more efficient and faster than the classic "Edit-Compile-Run-Debug" cycle. REPL is particularly helpful for learning a new programming language because it immediately responds to beginners' attempts.

Raspberry Pi Pico Development with MicroPython
@@ -122,18 +111,18 @@ Currently, MicroPython already supports dozens of hardware modules including STM ## Introduction to QuecPython -
+
Quectel has ported MicroPython to a variety of 4G and NB-IoT modules, and added a large number of wireless communication-related libraries, collectively known as QuecPython. In the [previous document](./wireless-modules.md), we introduced the module secondary development solution based on scripting languages, which is exactly the development solution of QuecPython. With QuecPython, you can use Python scripts to quickly and conveniently develop Quectel communication modules, easily implementing common IoT features such as remote control and data connection to cloud platforms. Compared to traditional microcontroller (MCU) development and QuecOpen (CSDK) development, the biggest advantage of QuecPython development lies in its simplicity. The following diagram shows the approximate workflow of traditional development and QuecPython development. It is easy to see that QuecPython, using a scripting language, only requires the initial burning of the specialized QuecPython firmware inside the module. After that, once the code is written and modified, it can be immediately run without the need for cumbersome compilation and burning steps, significantly improving the speed of code debugging. -

Comparison of Module Development Processes Based on QuecOpen and QuecPython
+

Comparison of Module Development Processes Based on QuecOpen and QuecPython
Another advantage of QuecPython is the built-in rich and practical libraries. In addition to the core standard library of MicroPython, QuecPython provides a series of IoT-related libraries, including voice calls, SMS, MQTT, and base station positioning, and supports mainstream cloud platforms such as Alibaba Cloud and Tencent Cloud. With less than 20 lines of code, a simple connection to Alibaba Cloud can be realized. -

Typical Products Developed with QuecPython
+

Typical Products Developed with QuecPython
Currently, QuecPython solutions have been applied in various scenarios such as smart home appliances, industrial control, and intelligent transportation. Companies have launched dozens of products based on QuecPython solutions, including car locators, DTUs, and 4G intercoms. Due to its low learning curve and short development cycle, QuecPython is also very suitable for rapid prototyping and course experiments. @@ -181,7 +170,7 @@ The differences between QuecPython development and traditional AT command develo QuecPython is a port of MicroPython, which is a programming language developed for resource-constrained embedded environments. As a result, there are several differences between QuecPython and CPython, which is the version of Python typically used on desktop computers. -#### Differences in Syntax and Design Philosophy +#### Differences in Syntax and Design Philosophy - QuecPython (MicroPython) is compatible with the core syntax of Python 3.4, but there are differences in some advanced usage and built-in type attributes compared to Python. The MicroPython [official documentation](https://docs.micropython.org/en/latest/genrst/index.html) provides an overview of these differences, but it may not be exhaustive. Some detailed differences may only be encountered during the development process. - MicroPython has made many streamlined design choices for resource-constrained environments. One typical design philosophy is that if users can implement certain functionality based on existing libraries, it is not integrated into the system. For example, in the CPython development, users commonly use the `datetime` library for formatted date and time output. In MicroPython, the author believes that users can manually concatenate and format the date and time information provided by the `utime` library to achieve the desired output. Therefore, MicroPython does not include a library similar to `datetime` by default. @@ -209,4 +198,4 @@ QuecPython is essentially MicroPython running on Quectel modules. Due to the lac - QuecPython currently does not include the `upip` functionality, so quick online installation of libraries is not possible. Manual porting is required. - Compatibility with MicroPython IDE tools such as Thonny and uPyCraft is not guaranteed. -In summary, MicroPython code that runs successfully on modules like ESP32 usually cannot be directly copied and run in the QuecPython environment without any modifications. Therefore, it is advisable to avoid directly applying documentation and development experience from other MicroPython hardware modules to QuecPython development. \ No newline at end of file +In summary, MicroPython code that runs successfully on modules like ESP32 usually cannot be directly copied and run in the QuecPython environment without any modifications. Therefore, it is advisable to avoid directly applying documentation and development experience from other MicroPython hardware modules to QuecPython development. diff --git a/docs/Application_guide/en/background/iot-and-low-code.md b/docs/Application_guide/en/background/iot-and-low-code.md index fa971668cccdd10aedc87fb43e6b132b833c0cff..78cf03f5758bb963daa2384c1bb73a5af50dc155 100644 --- a/docs/Application_guide/en/background/iot-and-low-code.md +++ b/docs/Application_guide/en/background/iot-and-low-code.md @@ -6,15 +6,25 @@ In the late 20th century, with the rise of computer networks and communication technologies, the Internet began to enter and integrate into people's lives. Traditional internet systems usually revolve around humans, where data generation and transmission are controlled by people, and the application of data results is reflected in individuals. Taking short videos on the internet as an example, activities such as shooting, uploading, and watching videos all require active participation from users. The short video platform analyzes and processes user-generated data, and then pushes relevant content based on preferences, ultimately influencing the users themselves. It can be seen that most processes in traditional internet systems revolve around human operation and development. -

Traditional Human-centric Internet
+
+ +
+
+ Traditional Human-centric Internet +
+
With the continuous evolution of technology, the demand for information transmission and exchange between things has been increasing. This led to the emergence of the concept of the Internet of Things (IoT). The Internet of Things is a network that connects all objects, forming an interconnected network of things-to-things. It utilizes various devices and technologies such as information sensors, radio frequency identification (RFID), global positioning systems (GPS), infrared sensors, and laser scanners to collect real-time information from objects or processes that need to be monitored, connected, and interacted with. It captures various types of information such as sound, light, heat, electricity, mechanics, chemistry, biology, and location. Through various possible network access methods, it enables pervasive connections between things and between things and people, achieving intelligent perception, recognition, and management of objects and processes. -Modern IoT is essentially an extension of the internet. It uses the infrastructure of the traditional internet as a medium for information transmission, breaking the constraints of time and space. It enables "things" to become the main producers and consumers of data, greatly reducing the distance between "people and things" and "things and things." For example, in smart agriculture irrigation, moisture sensors embedded in the soil periodically upload soil moisture information to a cloud platform. When the platform's program detects soil dryness, it remotely activates the irrigation device in the field according to preset rules, thereby controlling the soil moisture content at an appropriate level. In this scenario, human intervention is not required, and all processes are completed through interactions between things. The data involved is directly related to the "things" themselves. +Modern IoT is essentially an extension of the internet. It uses the infrastructure of the traditional internet as a medium for information transmission, breaking the constraints of time and space. It enables "things" to become the main producers and consumers of data, greatly reducing the distance between "people and things" and "things and things". For example, in smart agriculture irrigation, moisture sensors embedded in the soil periodically upload soil moisture information to a cloud platform. When the platform's program detects soil dryness, it remotely activates the irrigation device in the field according to preset rules, thereby controlling the soil moisture content at an appropriate level. In this scenario, human intervention is not required, and all processes are completed through interactions between things. The data involved is directly related to the "things" themselves. -

Object-centric IoT +
+ +
+
+ Object-centric IoT
@@ -22,7 +32,7 @@ Currently, the definition and scope of IoT are still evolving and developing, so Today, IoT has become a new information infrastructure and a model for socio-economic development. It has a wide range of applications and innovations in infrastructure fields such as industry, agriculture, environment, transportation, logistics, and security, as well as in areas closely related to daily life such as homes, healthcare, education, finance and services, and tourism. It effectively promotes the intelligent development of these areas, enables more rational use and allocation of limited resources, improves industry efficiency, and greatly enhances people's quality of life. -With the rapid development of the economy and technology, the fantasy of "everything connected" from over 20 years ago has begun to become a reality. From various smart devices and smart homes around us to the latest concepts of smart Earth and the "metaverse," IoT provides strong support for these technological transformations. +With the rapid development of the economy and technology, the fantasy of "everything connected" from over 20 years ago has begun to become a reality. From various smart devices and smart homes around us to the latest concepts of smart Earth and the "metaverse", IoT provides strong support for these technological transformations. ### Architecture of IoT @@ -34,7 +44,13 @@ A complete IoT application involves various technologies, processes, and roles. The Terminal Layer, also known as the Perception Layer or Perception Control Layer, is the most fundamental layer in the IoT architecture. The core function of the Terminal Layer is to interact with the physical world, enabling the perception of real-world objects (such as environmental parameters and device status) and control of specific devices. -

Typical Terminal in Contemporary Smart Homes: Smart Bulb
+
+ +
+
+ Typical Terminal in Contemporary Smart Homes: Smart Bulb +
+
The Terminal Layer is where the majority of physical IoT devices (such as sensors and RFID) reside. Sensors play a crucial role in information gathering and identification by converting physical quantities from the real world into electrical signals. In actual IoT devices, in addition to sensors, there are usually components such as controllers for coordinating and controlling all functionalities and components, as well as communication modules for network connectivity. @@ -44,7 +60,13 @@ The Network Layer is responsible for transmitting the data collected by devices The Access Layer mainly deals with the functions of the physical layer and data link layer in the traditional OSI model, which essentially involves various methods for devices to access networks and establish interconnections. In terms of media, it can be divided into wired network access and wireless network access. Wired network access methods include Ethernet, serial communication (such as RS-232 and RS-485), and USB, among others. Wireless network access methods include Wi-Fi, Bluetooth, cellular networks (such as 2G/3G/4G/5G, which will be detailed in the [next document](./wireless-modules.md)), and low-power wide-area networks (such as LoRaWAN and NB-IoT), among others. -

Wireless Routers Serve as the Gateway to the Network in Many Scenarios
+
+ +
+
+ Wireless Routers Serve as the Gateway to the Network in Many Scenarios +
+
The Transport Layer is built on top of the Access Layer and includes communication protocols for data reporting and delivery. Compared to internet terminals, most IoT terminal devices currently have limited available resources in terms of processing power, storage capacity, and network speed. Therefore, they tend to use communication protocols that consume fewer resources, such as MQTT (Message Queuing Telemetry Transport) and CoAP (Constrained Application Protocol). These protocols are based on the publish/subscribe model, enabling bidirectional communication between devices and platforms. They also support features like data encryption and compression. @@ -52,7 +74,13 @@ The Transport Layer is built on top of the Access Layer and includes communicati The Platform Layer is the intermediate layer in the IoT architecture where data is processed, stored, and analyzed. In the past, this layer was typically composed of independent servers. With the development of technologies like microservices and cloud computing, modern IoT platform layers typically include cloud-based system platforms, data analytics engines, and middleware, enabling developers to build and deploy applications on top of the IoT infrastructure. -

Microservices Architecture of the ThingsBoard Platform
+
+ +
+
+ Microservices Architecture of the ThingsBoard Platform +
+
The Platform Layer serves as an intermediate service that connects devices and industrial applications. It plays a pivotal role in the overall IoT architecture by hosting abstracted business logic and standardized core data models. A typical platform layer not only enables fast device connection but also provides powerful modular capabilities to meet various requirements in industry application scenarios. @@ -70,11 +98,17 @@ To better illustrate the architecture and development process of IoT, let's revi For most engineering projects, understanding and refining requirements is the first step in development. Starting development work without a thorough understanding of requirements can often impact development efficiency and the outcome, and even lead to irreparable losses. -In the case of the air conditioner project, the initial requirement might be as simple as "remotely turning on the air conditioner." Faced with this requirement, most people would envision a scenario and process like this: +In the case of the air conditioner project, the initial requirement might be as simple as "remotely turning on the air conditioner". Faced with this requirement, most people would envision a scenario and process like this: > Press a button in an app on a mobile phone or tablet. The app sends a command to the server, and the server sends a command to a local device in the user's home, which controls the air conditioner to start. -

Conceptual Remote Control of an Air Conditioner
+
+ +
+
+ Conceptual Remote Control of an Air Conditioner +
+
Clearly, the information included in this description is too vague and contains a lot of assumptions. It is not sufficient to support the development of a complete project. Therefore, it is necessary to refine the content and overall process through in-depth communication with the stakeholders (customers). For this type of project, the information to be understood includes, but is not limited to: @@ -103,7 +137,13 @@ Combining the IoT four-layer architecture introduced earlier and the refined req In fact, most IoT engineering projects include these three aspects. In simpler terms, IoT development often involves developing the "ends" of data (data generation and consumption) and the "middle" (overall logic). -

Common IoT Application Structure
+
+ +
+
+ Common IoT Application Structure +
+
#### Development Content Organization @@ -111,7 +151,13 @@ With a clear overall framework for the project, developers can further analyze t For the device-side development, the goal is to create a Wi-Fi-based smart plug. Therefore, during the development process, developers need to control the Wi-Fi chip or module to implement the necessary network configuration, connection, and bidirectional communication with the cloud platform. Additionally, the smart plug needs to integrate an infrared emitter to control the air conditioner via infrared signals. Developers need to consider factors such as the emission power and installation angle of the infrared emitter, as well as study the infrared codes for controlling the air conditioner. -

Typical Structure of a Smart Plug
+
+ +
+
+ Typical Structure of a Smart Plug +
+
The development of the application side is relatively straightforward. Develop a smartphone app for Android that provides a graphical user interface, receives user commands, sends them to the cloud, and displays status information obtained from the cloud on the app interface. This process is not significantly different from developing a regular app. @@ -163,7 +209,6 @@ Currently, low-code development finds extensive applications across various doma
- Furthermore, low-code development has gained significant popularity in physical enterprises. It helps organizations achieve the modernization of their traditional production systems at lower costs while accelerating digital transformation efforts. By empowering non-professional users to create applications and automate processes, low-code development technologies enable organizations to become more agile and responsive to ever-changing business needs. In summary, low-code development represents a revolutionary approach to software development, enabling a broader range of individuals to participate in the application development process. It enhances development efficiency and quality, reduces costs and complexity, and caters to diverse business requirements across various scenarios. @@ -208,7 +253,7 @@ NodeMCU can run on low-cost Wi-Fi chips such as ESP8266 and ESP32, which integra MicroPython is a "lite" version of Python that runs on microcontrollers and small-scale embedded systems, retaining Python's syntax and interactive programming experience while adapting to resource-constrained devices. This means that developers can use familiar Python syntax and tools to write and debug code without the need to learn new languages or environments. MicroPython also inherits Python's Read-Eval-Print Loop (REPL) mode, allowing developers to directly enter code on the device and immediately see the execution results, which helps with rapid testing and idea validation. -To facilitate the use of MicroPython for Python developers and educators, it supports multiple hardware interfaces and libraries. For example, MicroPython can communicate with sensors, displays, motors, and other external devices via interfaces such as SPI, I2C and UART, and achieve wireless connectivity and remote control through network modules. Additionally, MicroPython provides specific libraries for microcontrollers and embedded systems, such as `machine`, `network`, and `uasyncio`. +To facilitate the use of MicroPython for Python developers and educators, it supports multiple hardware interfaces and libraries. For example, MicroPython can communicate with sensors, displays, motors, and other external devices via interfaces such as SPI, I2C and UART, and achieve wireless connectivity and remote control through network modules. Additionally, MicroPython provides specific libraries for microcontrollers and embedded systems, such as `machine`, `network`, and `uasyncio`.
@@ -218,7 +263,6 @@ To facilitate the use of MicroPython for Python developers and educators, it sup
- In this chapter, we will provide more information about MicroPython. Please refer to [Introduction to QuecPython](about-qpy.md) for details. #### Characteristics of Low-code Hardware Development @@ -239,4 +283,4 @@ Abstraction of details is a programming technique that hides unnecessary or irre Modularity is a programming principle that breaks down a large program into small, independent modules, each with its functionality and interface, which can be reused and combined. Programming languages and frameworks that support modularity allow developers to flexibly call existing functional modules and combine them according to different needs, enabling the implementation of complex functionality. For example, in MicroPython, the hardware interface modules make it easy for developers to use various hardware devices such as I2C, SPI, and UART. They can import the corresponding modules and create objects to communicate with and control these devices. -Based on the analysis above, we can see that low-code development frameworks have the following advantages: they simplify the programming process and improve development efficiency, abstract hardware devices for enhanced portability, and leverage existing resources to expand functionality. In summary, low-code development frameworks are a programming paradigm that adapts to changes in the times and technological advancements. They allow more people to participate in innovation and creation, and bring their ideas and dreams to life. \ No newline at end of file +Based on the analysis above, we can see that low-code development frameworks have the following advantages: they simplify the programming process and improve development efficiency, abstract hardware devices for enhanced portability, and leverage existing resources to expand functionality. In summary, low-code development frameworks are a programming paradigm that adapts to changes in the times and technological advancements. They allow more people to participate in innovation and creation, and bring their ideas and dreams to life. diff --git a/docs/Application_guide/en/background/wireless-modules.md b/docs/Application_guide/en/background/wireless-modules.md index d2f687d14e1f002fef9e32d1c4ad76f986a354c0..bbd6587cff27cb029da4fb2867b421d2f2ec5340 100644 --- a/docs/Application_guide/en/background/wireless-modules.md +++ b/docs/Application_guide/en/background/wireless-modules.md @@ -11,9 +11,9 @@ In the [previous section](./iot-and-low-code.md), we introduced the four-layer s .. details:: About Communication There are many types of wireless communication in the IoT and they are applicable to various scenarios, so there are great differences in the specific functional structure and technical details, but their basic processes and patterns are similar. For the sake of understanding, we will use an analogy of communication between people. - + Imagine a scenario where two individuals are located on adjacent mountaintops and need to communicate with each other in the absence of modern electronic devices. - +

@@ -22,7 +22,7 @@ In the [previous section](./iot-and-low-code.md), we introduced the four-layer s
The simplest and most direct method is to shout and use sound as the information carrier while relying on air as the transmission medium. However, when the distance between the two individuals is far enough, the sound will be attenuated or interfered with, making this method impractical. In such cases, visual signals can be used for communication. The two individuals can use colored flags or torches as the information carrier while relying on light as the transmission medium. However, this method requires a prerequisite: both parties need to reach a consensus about the meaning of different flags or torch signals. Therefore, they can achieve low-efficiency but relatively reliable communication between distant mountaintops. - +

@@ -31,16 +31,16 @@ In the [previous section](./iot-and-low-code.md), we introduced the four-layer s
This rudimentary two-individual communication process encompasses the basic elements of a communication system: the information source, destination, channel, information carrier, and encoding rules. The information source refers to the originator and sender of information; The destination is the receiver and processor of information; The channel is the pathway through which signals are transmitted between the source and destination; The information carrier is the physical quantity that carries the information; And the encoding rules is the agreed representation of information. - + Modern communication systems also encompass similar elements but in a more complex and efficient manner. Users who have used dial-up access may be familiar with the term "modem". Telephone lines and networks are designed to transmit analog audio signals ranging from 300 Hz to 3400 Hz and are not suitable for direct transmission of network data. To enable bidirectional communication between computers over telephone lines, two basic requirements must be met: - + - Through the operating system and network interface, convert user raw data into standardized data formats that can be recognized and transmitted between network devices. This process, which involves standardizing data formats to improve information transmission efficiency and system effectiveness, is typically referred to as "coding". The corresponding process at the receiving end is known as "decoding". - Through the modem, convert digital signals into analog signals suitable for transmission over telephone lines, and vice versa. This process, which involves various transformations of the original signal to enable publication through different communication media or carriers, is typically referred to as "modulation". The corresponding process at the receiving end is known as "demodulation". The purpose of modulation and demodulation is to adapt to the channel characteristics, overcome channel interference, and enhance signal transmission quality. - + In addition to telephone lines, there are many other communication media available, such as radio waves, optical fibers, and satellites. Different communication media possess distinct characteristics and advantages, requiring the use of different encoding and modulation techniques. For example, a radio wave can be propagated through the air without physical connections but is easily interfered with by other radio waves. To allocate and utilize frequency spectrum resources, techniques such as frequency multiplexing, code multiplexing, and orthogonal multiplexing are employed. Optical fibers can transmit high-speed and high-capacity optical signals with low loss, high bandwidth, and resistance to interference, but require special optoelectronic conversion devices to achieve optical-to-electrical signal conversion by using pulse code modulation, phase modulation, and frequency-shift keying. Satellites can provide coverage over extensive areas for long-distance communication but require high-power transmitters and receivers. Techniques such as multiple access, frequency-hopping spread spectrum, and quadrature phase shift keying are employed to facilitate communication between satellites and ground stations. - + Communication technology is an interdisciplinary science involving various disciplines, including information theory, signal processing, circuit theory, microwave technology, antenna technology, and network technology. However, as users or ordinary developers, you do not need to delve into excessive details. Various terminal devices and communication modules handle most aspects for us. Our focus should be on selecting and utilizing specific communication methods. - +

@@ -52,15 +52,15 @@ In the [previous section](./iot-and-low-code.md), we introduced the four-layer s The table below lists the characteristics and usage scenarios of commonly used wireless communication technologies in IoT, considering the diverse requirements of different IoT applications. -| Communication Technology | Transmission Rate | Transmission Distance | Power Consumption | Cost | Application Scenarios | -| :----------------------: | :---------------: | :-------------------: | :---------------: | :----: | ------------------------------------------------------------ | -| Wi-Fi | High | Short | High | Medium |
  • Indoor wireless networking
  • Smart homes
| +| Communication Technology | Transmission Rate | Transmission Distance | Power Consumption | Cost | Application Scenarios | +| :----------------------: | :---------------: | :-------------------: | :---------------: | :----: | --------------------------------------------------------------------------------------------------- | +| Wi-Fi | High | Short | High | Medium |
  • Indoor wireless networking
  • Smart homes
| | Bluetooth | Medium | Short | Medium | Low |
  • Asset tracking
  • Location tags
  • Medical sensors
  • Smartwatches
| -| Zigbee | Low | Short | Low | Low |
  • Wireless sensors
  • Smart homes
| -| UWB | High | Short | High | High |
  • High-precision positioning
| -| 4G | High | Long | High | High |
  • Mobile communication
  • Vehicle tracking
  • Smart cities
| -| NB-IoT | Low | Long | Low | Medium |
  • Remote meter reading
  • Manhole cover detection
| -| LoRa | Low | Long | Low | Medium |
  • Campus coverage
  • Offshore fishing vessel monitoring
| +| Zigbee | Low | Short | Low | Low |
  • Wireless sensors
  • Smart homes
| +| UWB | High | Short | High | High |
  • High-precision positioning
| +| 4G | High | Long | High | High |
  • Mobile communication
  • Vehicle tracking
  • Smart cities
| +| NB-IoT | Low | Long | Low | Medium |
  • Remote meter reading
  • Manhole cover detection
| +| LoRa | Low | Long | Low | Medium |
  • Campus coverage
  • Offshore fishing vessel monitoring
| ### What Is a Cellular Network? @@ -74,8 +74,6 @@ A cellular network, also known as a mobile network, is a wireless communication
- - As shown in the diagram above, the core idea of a cellular network is to divide a large service area into multiple smaller cells. Each cell is equipped with a base station responsible for wireless communication with mobile devices within that cell. These base stations are interconnected through wired or wireless connections, forming a network that covers the entire service area. In traditional theory, these cells are designed as hexagonal, circular, or square shapes, with hexagons being the most common. The interconnection between cells enables complete coverage of the region, resembling a honeycomb, which is why this technology is referred to as cellular networks. Nowadays, the coverage areas of many base stations no longer have a cellular shape, but the term has persisted.
@@ -86,21 +84,20 @@ As shown in the diagram above, the core idea of a cellular network is to divide
- .. details:: From 1G to 5G The term cellular networks was initially proposed by Bell Labs in the United States in 1947 and was first commercially deployed in Japan in 1979. The early cellular networks, known as the mobile communication systems of "The 1st Generation (1G)", could only provide analog voice telephony services. The 1G systems adopt Frequency Division Multiple Access (FDMA) technology to allocate different users to different frequency channels. Although the 1G systems started the era of mobile communication, they had some limitations, such as low spectrum efficiency, limited service types, lack of high-speed data services, poor security, and high device costs. - + To address the issues in analog systems, the 2nd Generation (2G) mobile communication systems, also known as digital mobile communication technology, emerged in the early 1990s. The 2G systems employed digital modulation techniques and adopted either Time Division Multiple Access (TDMA) or Code Division Multiple Access (CDMA) technology. The 2G systems brought significant improvements over the 1G systems, including increased system capacity, improved security, voice call quality, and the introduction of data services. The most representative 2G system is the Global System for Mobile Communication (GSM) widely used in Europe, which enabled global roaming and became one of the most adopted standards worldwide. - + With the development of the internet, there was a growing demand for data services. To achieve higher data transmission rates, enhancements were introduced based on the 2G systems, such as General Packet Radio Service (GPRS) and Enhanced Data for GSM Evolution (EDGE). These technologies, referred to as 2.5G or 2.75G, provided higher data transfer rates compared to 2G but still could not meet the demand for high-speed broadband data services. - + In 2001, the 3rd Generation (3G) mobile communication systems, aiming at digital multimedia mobile communication, entered the commercial stage. The 3G systems adopted advanced Wideband Code Division Multiple Access (WCDMA) technology and utilized higher frequency bands with larger system bandwidth for data transmission, resulting in further improvements in data transfer rates. The 3G systems enabled simultaneous transmission of voice and data, supporting multimedia services such as images, music, and videos. Notable 3G systems include CDMA2000 in North America, WCDMA in Europe and Japan, and Time Division-Synchronous Code Division Multiple Access (TD-SCDMA) in China. These technologies were based on the standard IMT-2000 (International Mobile Telecommunications 2000) formulated by International Telecommunication Union (ITU). - + Along with the development of 3G networks, enhancements were introduced, such as High-Speed Downlink Packet Access (HSDPA), High-Speed Uplink Packet Access (HSUPA), and Enhanced High-Speed Packet Access (HSPA+). These technologies, known as 3.5G or 3.75G, provided higher data transfer rates and better user experiences compared to 3G. - + In 2011, the 4th Generation (4G) mobile communication systems, designed for digital broadband data mobile internet communication, were officially launched. The 4G systems are based on the flat network architecture and are upgraded on the basis of the Long Term Evolution (LTE) of 3G systems. The LTE systems employed key technologies such as Orthogonal Frequency-Division Multiple Access (OFDMA), Adaptive Modulation and Coding (AMC), and Multiple-input Multiple-output (MIMO), significantly improving spectrum efficiency and network performance. The 4G systems offered extremely high data transmission speeds, over 50 times faster than 3G networks, providing video transmission quality the same as high-definition television. The most representative 4G system is Long Term Evolution Advanced (LTE-A), which operates in Time Division Duplexing (TDD) or Frequency Division Duplexing (FDD) modes. LTE-A adopted technologies like Carrier Aggregation (CA), relaying, and Coordinated Multiple Point (CoMP), making breakthroughs in network capacity and coverage. - + With the rapid development of emerging technologies and applications such as smart devices, the Internet of Things (IoT), and cloud computing, the demand for mobile communication continues to increase. To meet the requirements of human information society in the future, the 5th Generation (5G) mobile communication system has emerged. 5G systems provide not only higher data transfer rates, lower latency, and increased reliability but also support massive connections and diverse business scenarios. Currently, 5G mobile communication systems have penetrated various fields such as industry, healthcare, and transportation, integrating deeply with devices and objects, enabling the vision of the Internet of Everything, providing strong support for social and economic development and improving the quality of human life. Cellular networks, as a wireless communication technology, have undergone five generations of development since the creation. Each generation corresponds to different technologies and standards, providing users with higher data transmission speeds, better voice call quality, and a range of new features and functionalities. From 1G's analog voice communication to 5G's ubiquitous connectivity, cellular networks have become an indispensable information infrastructure in modern society. @@ -127,19 +124,19 @@ In terms of speed and bandwidth, IoT does not demand high requirements. Since Io Currently, in China, the most commonly used cellular communication standards in the IoT field include LTE Cat 4, LTE Cat 1, and NB-IoT. The table below compares their characteristics. -| Feature | LTE Cat 4 | LTE Cat 1bis | NB-IoT | -| :-------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | -| Downlink Speed | 150 Mbps | 10.3 Mbps | 250 kbps | -| Uplink Speed | 50 Mbps | 5.2 Mbps | 250 kbps | -| Network Coverage | Global LTE Networks | Global LTE Networks | Requires deployment of new or upgraded base stations | -| Mobility | Supports high-speed mobility | Supports mobility up to 100 km/h | Does not support mobility | -| Latency | Millisecond-level | Millisecond-level | Second-level | -| Cost | High | Low | Low | -| Power Consumption | High | Low | Low | +| Feature | LTE Cat 4 | LTE Cat 1bis | NB-IoT | +| :-------------------: | :-------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: | +| Downlink Speed | 150 Mbps | 10.3 Mbps | 250 kbps | +| Uplink Speed | 50 Mbps | 5.2 Mbps | 250 kbps | +| Network Coverage | Global LTE Networks | Global LTE Networks | Requires deployment of new or upgraded base stations | +| Mobility | Supports high-speed mobility | Supports mobility up to 100 km/h | Does not support mobility | +| Latency | Millisecond-level | Millisecond-level | Second-level | +| Cost | High | Low | Low | +| Power Consumption | High | Low | Low | | Application Scenarios | HD video surveillance, routers, sales terminals, etc., requiring high-speed data transmission | Shared payments, industrial control, in-vehicle payments, public network intercom, POS, etc., requiring medium-speed data transmission | Water meters, electricity meters, gas meters, etc., requiring low-speed data transmission and stationary usage | -| Voice Support | Supports VoLTE (Voice calls) | Supports VoLTE (Voice calls) | Does not support voice calls | -| Antenna Configuration | 2x2 MIMO (Multiple Input Multiple Output) | 1x1 SISO (Single Input Single Output) | 1x1 SISO (Single Input Single Output) | -| Bandwidth | 20 MHz | 1.4 MHz | 180 kHz | +| Voice Support | Supports VoLTE (Voice calls) | Supports VoLTE (Voice calls) | Does not support voice calls | +| Antenna Configuration | 2x2 MIMO (Multiple Input Multiple Output) | 1x1 SISO (Single Input Single Output) | 1x1 SISO (Single Input Single Output) | +| Bandwidth | 20 MHz | 1.4 MHz | 180 kHz | ## Introduction to Modules @@ -163,7 +160,7 @@ The main chip, also referred to as the baseband chip or modem chip by some manuf ## Application Modes of Modules -Just like different people use the same Android phone in different ways, some users will safely use the factory system and features, while others are keen on unlocking, fastboot, root and other operations to further develop the device. Similar to mobile phones, modules also have two types of application modes: Standard Mode and Custom Development Mode. +Just like different people use the same Android phone in different ways, some users will safely use the factory system and features, while others are keen on unlocking, fastboot, root and other operations to further develop the device. Similar to mobile phones, modules also have two types of application modes: Standard Mode and Custom Development Mode. ### Standard Mode @@ -175,21 +172,19 @@ As shown in the diagram, in Standard Mode, the module is connected to the main c .. details:: About AT Commands -``` -AT command is one of the oldest and most widely-used communication command sets in the industry. It establishes a complete bidirectional communication mechanism between users (or MCUs) and modules. Users (or MCUs) control the module by sending AT commands, which include various functions such as network connection, voice call, and positioning. The module then returns the execution results and status to the user. This "send and receive" mechanism and the simple processing method are well-suited for embedded environments with limited resources. Nowadays, most modules on the market come with built-in AT server programs that can receive, parse, and execute specific AT commands. + AT command is one of the oldest and most widely-used communication command sets in the industry. It establishes a complete bidirectional communication mechanism between users (or MCUs) and modules. Users (or MCUs) control the module by sending AT commands, which include various functions such as network connection, voice call, and positioning. The module then returns the execution results and status to the user. This "send and receive" mechanism and the simple processing method are well-suited for embedded environments with limited resources. Nowadays, most modules on the market come with built-in AT server programs that can receive, parse, and execute specific AT commands. -
- -
-
- Operation Mode of AT Commands -
-
-``` +
+ +
+
+ Operation Mode of AT Commands +
+
For developers using modules in Standard Mode, the main development effort lies in the user app running on the MCU. The business codes in the app need to include complex functionalities such as sending AT commands and parsing return values, including handling Unsolicited Result Codes (URC), which is challenging for beginners. -In addition to the AT command functionality, modules in Standard Mode can also serve as wireless network cards, providing a range of network services, including PPP dial-up networking, to the MCU or other host devices. +In addition to the AT command functionality, modules in Standard Mode can also serve as wireless network cards, providing a range of network services, including PPP dial-up networking, to the MCU or other host devices. ### Custom Development Mode @@ -213,54 +208,52 @@ The following examples demonstrate the codes for flashing an LED using both the .. tabset:: LED Flashing Code -``` -## Using QuecOpen (CSDK) - -​```c -#include "ql_application.h" -#include "ql_gpio.h" -#include + ## Using QuecOpen (CSDK) -static quec_gpio_cfg_t led_gpio_cfg[] = -{ - {GPIO_PIN_NO_75, PIN_DIRECTION_OUT, PIN_NO_EDGE, PIN_PULL_DISABLE, PIN_LEVEL_LOW} -}; + ```c + #include "ql_application.h" + #include "ql_gpio.h" + #include -static void led_test(void *argv) -{ - ql_gpio_init(led_gpio_cfg[0].gpio_pin_num, led_gpio_cfg[0].pin_dir, led_gpio_cfg[0].pin_pull, led_gpio_cfg[0].pin_level); + static quec_gpio_cfg_t led_gpio_cfg[] = + { + {GPIO_PIN_NO_75, PIN_DIRECTION_OUT, PIN_NO_EDGE, PIN_PULL_DISABLE, PIN_LEVEL_LOW} + }; - while (1) + static void led_test(void *argv) { - ql_gpio_set_level(led_gpio_cfg[0].gpio_pin_num, PIN_LEVEL_LOW); - ql_rtos_task_sleep_s(1); - ql_gpio_set_level(led_gpio_cfg[0].gpio_pin_num, PIN_LEVEL_HIGH); - ql_rtos_task_sleep_s(1); + ql_gpio_init(led_gpio_cfg[0].gpio_pin_num, led_gpio_cfg[0].pin_dir, led_gpio_cfg[0].pin_pull, led_gpio_cfg[0].pin_level); + + while (1) + { + ql_gpio_set_level(led_gpio_cfg[0].gpio_pin_num, PIN_LEVEL_LOW); + ql_rtos_task_sleep_s(1); + ql_gpio_set_level(led_gpio_cfg[0].gpio_pin_num, PIN_LEVEL_HIGH); + ql_rtos_task_sleep_s(1); + } } -} -application_init(led_test, "led_test", 2, 2); -​``` + application_init(led_test, "led_test", 2, 2); + ``` -## Using QuecPython + ## Using QuecPython -​```python -from machine import Pin -import utime as time + ```python + from machine import Pin + import utime as time -led = Pin(Pin.GPIO15, Pin.OUT, Pin.PULL_DISABLE, 0) + led = Pin(Pin.GPIO15, Pin.OUT, Pin.PULL_DISABLE, 0) -def led_test(): - while 1: - led.write(0) - time.sleep(1) - led.write(1) - time.sleep(1) + def led_test(): + while 1: + led.write(0) + time.sleep(1) + led.write(1) + time.sleep(1) -if __name__ == "__main__": - led_test() -​``` -``` + if __name__ == "__main__": + led_test() + ``` However, using scripting languages for development filters many low-level details, which makes them less flexible and controllable compared to traditional C language development. Additionally, scripting languages generally have lower performance and slower execution speed compared to C language. Therefore, they may not be suitable for scenarios with high performance and real-time requirements. @@ -268,14 +261,14 @@ However, using scripting languages for development filters many low-level detail The following table compares the standard mode, CSDK custom development, and scripting custom development from multiple perspectives. You can choose the most suitable development solution based on your specific requirements. -| Feature | Standard Mode | Custom Development (CSDK) | Custom Development (Scripting Language) | Remarks | -| :--------------------: | :-----------: | :-----------------------: | :-------------------------------------: | :----------------------------------------------------------- | -| Material Costs | ⭐⭐ | ⭐ | ⭐ |
  • During custom development, the module can be used as the system controller, saving costs on additional MCUs.
| -| Threshold | ⭐ | ⭐⭐⭐ | ⭐ |
  • Module manufacturers usually offer CSDK development support and related services to key customers.
| -| Development Difficulty | ⭐ | ⭐⭐⭐ | ⭐ |
  • CSDK development requires developers to have experience with RTOS or Linux development, making it challenging for regular MCU developers.
  • Standard mode only requires users to know MCU serial communication and string processing methods without any special requirements.
  • Scripting language development only requires users to know basic syntax without any special requirements.
| -| Development Cycle | ⭐ | ⭐⭐⭐ | ⭐ |
  • The complexity of CSDK development determines its longer development cycle and higher development costs.
| -| Maintenance Costs | ⭐⭐ | ⭐⭐⭐ | ⭐ |
  • The modular development nature of scripting languages ensures long-term stability, and the OTA upgrade feature is included, making remote upgrades easy to perform.
| -| Flexibility | ⭐ | ⭐⭐⭐ | ⭐⭐ |
  • In standard mode, developers usually use some limited features such as serial communication and ADC.
  • With scripting language development, developers can access most of the module's resources through built-in function libraries.
  • With CSDK development, developers have direct control over all available resources based on their own needs and ideas.
| -| Performance | - | ⭐⭐⭐ | ⭐⭐ |
  • Scripting languages generally have lower performance compared to the C language. Therefore, in scenarios that require high-speed execution, precise timing, or a large number of resources, scripting language development is not recommended.
| -| Power Consumption | ⭐ | ⭐⭐ | ⭐⭐ |
  • The power consumption level of a typical 4G module during autonomous sleep is in the mA range.
  • In standard mode, maximum power savings can be achieved by MCU cutting off module power, resulting in power consumption as low as 1/10 of the other development solutions.
| -| Ecosystem | ⭐⭐⭐ | ⭐ | ⭐⭐⭐ |
  • Both standard AT command development and scripting language development have ample publicly available resources and tutorials online.
  • CSDK development lacks an open ecosystem.
| \ No newline at end of file +| Feature | Standard Mode | Custom Development (CSDK) | Custom Development (Scripting Language) | Remarks | +| :--------------------: | :-----------: | :-----------------------: | :-------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Material Costs | ⭐⭐ | ⭐ | ⭐ |
  • During custom development, the module can be used as the system controller, saving costs on additional MCUs.
| +| Threshold | ⭐ | ⭐⭐⭐ | ⭐ |
  • Module manufacturers usually offer CSDK development support and related services to key customers.
| +| Development Difficulty | ⭐ | ⭐⭐⭐ | ⭐ |
  • CSDK development requires developers to have experience with RTOS or Linux development, making it challenging for regular MCU developers.
  • Standard mode only requires users to know MCU serial communication and string processing methods without any special requirements.
  • Scripting language development only requires users to know basic syntax without any special requirements.
| +| Development Cycle | ⭐ | ⭐⭐⭐ | ⭐ |
  • The complexity of CSDK development determines its longer development cycle and higher development costs.
| +| Maintenance Costs | ⭐⭐ | ⭐⭐⭐ | ⭐ |
  • The modular development nature of scripting languages ensures long-term stability, and the OTA upgrade feature is included, making remote upgrades easy to perform.
| +| Flexibility | ⭐ | ⭐⭐⭐ | ⭐⭐ |
  • In standard mode, developers usually use some limited features such as serial communication and ADC.
  • With scripting language development, developers can access most of the module's resources through built-in function libraries.
  • With CSDK development, developers have direct control over all available resources based on their own needs and ideas.
| +| Performance | - | ⭐⭐⭐ | ⭐⭐ |
  • Scripting languages generally have lower performance compared to the C language. Therefore, in scenarios that require high-speed execution, precise timing, or a large number of resources, scripting language development is not recommended.
| +| Power Consumption | ⭐ | ⭐⭐ | ⭐⭐ |
  • The power consumption level of a typical 4G module during autonomous sleep is in the mA range.
  • In standard mode, maximum power savings can be achieved by MCU cutting off module power, resulting in power consumption as low as 1/10 of the other development solutions.
| +| Ecosystem | ⭐⭐⭐ | ⭐ | ⭐⭐⭐ |
  • Both standard AT command development and scripting language development have ample publicly available resources and tutorials online.
  • CSDK development lacks an open ecosystem.
| diff --git a/docs/Application_guide/en/media/background/about-qpy/csdk-and-qpy-dev-steps-en.png b/docs/Application_guide/en/media/background/about-qpy/csdk-and-qpy-dev-steps-en.png new file mode 100644 index 0000000000000000000000000000000000000000..8f39c7e95c25dc93ff9b8229b384c519b09f0c92 Binary files /dev/null and b/docs/Application_guide/en/media/background/about-qpy/csdk-and-qpy-dev-steps-en.png differ diff --git a/docs/Application_guide/en/media/background/about-qpy/qpy-intro-en.png b/docs/Application_guide/en/media/background/about-qpy/qpy-intro-en.png new file mode 100644 index 0000000000000000000000000000000000000000..4db6ea2387ff93a53c3f193f86d971fc6a2dcca0 Binary files /dev/null and b/docs/Application_guide/en/media/background/about-qpy/qpy-intro-en.png differ diff --git a/docs/Application_guide/en/media/background/about-qpy/qpy-solutions-en.png b/docs/Application_guide/en/media/background/about-qpy/qpy-solutions-en.png new file mode 100644 index 0000000000000000000000000000000000000000..d02e2df678d8b4c4f26a66c2257d4c23889077ea Binary files /dev/null and b/docs/Application_guide/en/media/background/about-qpy/qpy-solutions-en.png differ