Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync blogs 2025-02-07-11-03-26 #1475

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ Build a reliable, efficient and industry-specific Internet of Vehicles platform

## [Industrial IoT | Unified Namespace | Sparkplug](https://www.emqx.com/zh/blog/category/industrial-iot)

- [先进制造企业为何选择 EMQ 助力数字化升级](https://www.emqx.com/zh/blog/why-manufacturing-enterprises-choose-emq) ([Edit](https://github.com/emqx/blog/blob/main/zh/202502/why-manufacturing-enterprises-choose-emq.md))
- [如何在离线环境下部署 EMQX ECP](https://www.emqx.com/zh/blog/how-to-deploy-emqx-ecp-in-an-offline-environment) ([Edit](https://github.com/emqx/blog/blob/main/zh/202501/how-to-deploy-emqx-ecp-in-an-offline-environment.md))
- [高效管理物联网边缘节点:利用 EMQX ECP 实现边缘服务配置的版本管理与参数化下发](https://www.emqx.com/zh/blog/efficient-management-of-iot-edge-nodes) ([Edit](https://github.com/emqx/blog/blob/main/zh/202410/efficient-management-of-iot-edge-nodes.md))
- [OPC UA 与 OPC DA:选型指南](https://www.emqx.com/zh/blog/opc-ua-vs-opc-da) ([Edit](https://github.com/emqx/blog/blob/main/zh/202406/opc-ua-vs-opc-da.md))
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ Explore more with & via EMQ.
## [EMQX Open Source | Broker](https://www.emqx.com/en/blog/category/emqx)
EMQX is the world's most scalable open-source MQTT broker with a high performance that connects 100M+ IoT devices in 1 cluster, while maintaining 1M message per second throughput and sub-millisecond latency.

- [Integrating LwM2M with MQTT Using EMQX: A Step-by-Step Guide](https://www.emqx.com/en/blog/integrating-lwm2m-with-mqtt) ([Edit](https://github.com/emqx/blog/blob/main/en/202502/integrating-lwm2m-with-mqtt.md))
- [Introducing EMQX Platform Smart Data Hub: A New Era of Intelligent MQTT Data Processing](https://www.emqx.com/en/blog/introducing-emqx-platform-smart-data-hub) ([Edit](https://github.com/emqx/blog/blob/main/en/202501/introducing-emqx-platform-smart-data-hub.md))
- [Quick Start of EMQX MQTT Cloud Service](https://www.emqx.com/en/blog/quick-start-of-emqx-mqtt-cloud-service) ([Edit](https://github.com/emqx/blog/blob/main/en/202501/quick-start-of-emqx-mqtt-cloud-service.md))
- [Efficient IoT Communication with LoRaWAN & MQTT](https://www.emqx.com/en/blog/lorawan-and-mqtt) ([Edit](https://github.com/emqx/blog/blob/main/en/202411/lorawan-and-mqtt.md))
Expand Down
166 changes: 166 additions & 0 deletions en/202502/integrating-lwm2m-with-mqtt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
## Introduction to the LwM2M Protocol

Lightweight M2M (LwM2M) is a lightweight IoT device management protocol developed by the Open Mobile Alliance (OMA). It is based on the Constrained Application Protocol (CoAP) and designed specifically for resource-constrained IoT devices, such as sensors and smart meters. These devices are typically battery-powered and have limited CPU, memory, and network resources.

### Protocol Stack Structure

The LwM2M protocol stack has the following characteristics:

1. **Application Layer:** In addition to a standard set of object resource models, it allows users to define custom object models.
2. **Transport Layer:** Typically uses CoAP over UDP, balancing lightweight communication with a certain level of reliability.
3. **Transport Security:** Utilizes the DTLS protocol with support for multiple security modes, including Pre-Shared Key, Raw Public Key, and X.509 certificates.
4. **Network Layer:** Primarily based on UDP with IPv4/6 or SMS. It can also be deployed over networks like NB-IoT, TCP, or LoRaWAN.

![Protocol Stack Structure](https://assets.emqx.com/images/808ffadc53b4ca2ba0af54b39868a61a.png)

### Resource Model

The resource model is the core of the LwM2M protocol, defining communication rules between the client and server. Clients report data to the server following this model, while the server sends read, write, execute, and other commands to the client.

The relationship between the client, objects, and resources is shown below:

- A client can have multiple resource types, each associated with a specific object.
- All standard objects and resources are identified by fixed IDs maintained by the OMA LwM2M Registry.

![Resource Model](https://assets.emqx.com/images/c06be1948effd185f49ea74ef7044edc.png)

For example, the object ID for temperature sensor devices is `3303`, defining the following resources:

- `Resource 5700: Sensor Value` (current temperature reading)
- `Resource 5701: Sensor Units` (units of the temperature reading, e.g., Celsius or Fahrenheit)
- `Resource 5601: Min Measured Value` (minimum recorded temperature)
- `Resource 5602: Max Measured Value` (maximum recorded temperature)

The LwM2M protocol supports various operations on objects and resources, including:

- **Read:** Retrieve the current value of a resource.
- **Write:** Set a new value for a resource.
- **Execute:** Invoke functions defined on resources.
- **Observe/Notify:** Subscribe to resource changes and receive real-time notifications.

### Advantages

- **Lightweight:** Minimal network overhead, ideal for resource-constrained devices.
- **Remote Management:** Standardized resources enable firmware updates, status queries, and monitoring.
- **Flexible Resource Model:** Supports custom resource definitions for specific applications.
- **Security:** Ensures data security with DTLS-based encryption.

### Key Use Cases

- **Smart Cities:** Managing streetlights, traffic sensors, and environmental monitoring devices.
- **Transportation:** Vehicle tracking, fleet management, and vehicle health monitoring.
- **Industrial IoT:** Monitoring and managing factory machinery, sensors, and actuators.
- **Smart Agriculture:** Remote management of soil sensors, weather stations, and irrigation systems.
- **Smart Manufacturing:** Enhancing production line efficiency and predictive maintenance.
- **Healthcare:** Managing wearable health monitors and medical devices.

## Integrating LwM2M Protocol with EMQX

EMQX is a scalable and feature-rich MQTT message broker designed for IoT and real-time communication applications. In addition to full [MQTT protocol](https://www.emqx.com/en/blog/the-easiest-guide-to-getting-started-with-mqtt) support, EMQX manages non-MQTT protocols like STOMP, MQTT-SN, CoAP, and LwM2M via gateways.

EMQX features a powerful built-in LwM2M gateway that efficiently connects various LwM2M devices. It supports UDP and DTLS connections, ensuring secure and stable device communication. With the EMQX Dashboard, users can easily manage devices. The LwM2M gateway also excels in message conversion, enabling seamless translation between LwM2M messages and JSON-formatted MQTT messages. This facilitates structured data parsing and analysis while enabling flexible device control through JSON messages. The bidirectional conversion enhances EMQX's capabilities in IoT device management and data interaction, providing strong support for complex IoT applications.

### Enabling the LwM2M Gateway

EMQX 5.x and later versions allow enabling the LwM2M gateway via the EMQX Dashboard.

1. Start EMQX (e.g., version 5.8.4) with the following command and map ports 1883, 18083, and 5684 to the host machine.

```shell
sudo docker run -d --name emqx584 \
-p 18083:18083 \
-p 1883:1883 \
-p 5783:5783/udp emqx/emqx:5.8.4
```

1. Open the EMQX Dashboard, navigate to **Management → Gateway**, and enable the LwM2M gateway:

![Management → Gateway](https://assets.emqx.com/images/81660ca53c39e3bb508b1bdd72739fcc.png)

1. Keep the default settings, and the gateway will be successfully enabled upon seeing the success message:

![Gateways](https://assets.emqx.com/images/33f93da2301d601aa344ce93486684c1.png)

### LwM2M Client and Message Exchange

In this example, you can either choose to manually compile and install [wakaama](https://github.com/eclipse/wakaama) to provide LwM2M client support, or use a precompiled Docker image for testing. Here's an example using Docker:

1. Use a Docker container to start an LwM2M client and observe its interaction via MQTTX-CLI:

```shell
sudo docker run -it --rm --network host emqx/mqttx-cli
```

1. Subscribe to the `up/#` topic to receive messages generated by the LwM2M client:

```shell
mqttx sub --topic up/#
```

1. Start the Wakaama command-line container using Docker:

```shell
sudo docker run --rm -it --network host heeejianbo/my-wakaama:1.0
```

1. Within the container, use the following command to establish a LwM2M client connection:

```shell
lwm2mclient -l 57830 -p 5783 -h 127.0.0.1 -4 -n testlwm2mclient
```

1. When you observe the following message in the MQTTX client, it indicates that the LwM2M client has successfully logged into EMQX:

```shell
topic: up/register, qos: 0
{"msgType":"register","data":{"objectList":["/1","/1/0","/2/0","/3/0","/4/0","/5/0","/6/0","/7/0","/31024","/31024/10","/31024/11","/31024/12"],"lwm2m":"1.1","lt":300,"ep":"testlwm2mclient","b":"U","alternatePath":"/"}}
topic: up/resp, qos: 0
{"msgType":"observe","is_auto_observe":true,"data":{"reqPath":"/3/0","content":[{"path":"/3/0","value":"W3siYm4iOiIvMy8wLyIsIm4iOiIwIiwidnMiOiJPcGVuIE1vYmlsZSBBbGxpYW5jZSJ9LHsibiI6IjEiLCJ2cyI6IkxpZ2h0d2VpZ2h0IE0yTSBDbGllbnQifSx7Im4iOiIyIiwidnMiOiIzNDUwMDAxMjMifSx7Im4iOiIzIiwidnMiOiIxLjAifSx7Im4iOiI2LzAiLCJ2IjoxfSx7Im4iOiI2LzEiLCJ2Ijo1fSx7Im4iOiI3LzAiLCJ2IjozODAwfSx7Im4iOiI3LzEiLCJ2Ijo1MDAwfSx7Im4iOiI4LzAiLCJ2IjoxMjV9LHsibiI6IjgvMSIsInYiOjkwMH0seyJuIjoiOSIsInYiOjEwMH0seyJuIjoiMTAiLCJ2IjoxNX0seyJuIjoiMTEvMCIsInYiOjB9LHsibiI6IjEzIiwidiI6MzEwNDg1ODkwM30seyJuIjoiMTQiLCJ2cyI6IiswMTowMCJ9LHsibiI6IjE1IiwidnMiOiJFdXJvcGUvQmVybGluIn0seyJuIjoiMTYiLCJ2cyI6IlUifV0="}],"codeMsg":"content","code":"2.05"}}
```

1. Connect another MQTTX-CLI client to interact with the LwM2M device:

```shell
sudo docker run -it --rm --network host emqx/mqttx-cli
```

1. Send a read command to the `testlwm2mclient` created in step 3 to retrieve the device's firmware version:

```shell
mqttx pub --topic dn/testlwm2mclient -m '{"msgType": "read", "data": {"path": "/3/0/3"}}'
```

1. You will observe that the subscribed client from step 1 receives the response, showing the firmware version as `1.0`:

```shell
topic: up/resp, qos: 0
{"msgType":"read","data":{"reqPath":"/3/0/3","content":[{"value":"1.0","path":"/3/0/3"}],"codeMsg":"content","code":"2.05"}}
```

At this point, a simple LwM2M connection and command exchange example has been completed.

### Managing LwM2M Clients

Through the EMQX Dashboard, users can manage LwM2M clients, view details, and perform operations via the **Clients** page under the respective gateway.

![LwM2M Clients](https://assets.emqx.com/images/405528527fb19cba25f50e5c527d2a92.png)

<center>LwM2M Clients</center>

<br>

![LwM2M Client Info](https://assets.emqx.com/images/7c5b24affde8fa1b637a7b13c585c60e.png)

<center>LwM2M Client Info</center>

## Conclusion

The LwM2M protocol is a powerful solution for resource-constrained IoT devices, offering efficient communication and robust security. EMQX simplifies LwM2M integration by providing an intuitive interface and seamless interoperability with MQTT. This enables comprehensive device data collection, processing, and analysis for IoT applications.


<section class="promotion">
<div>
Talk to an Expert
</div>
<a href="https://www.emqx.com/en/contact?product=solutions" class="button is-gradient">Contact Us →</a>
</section>
69 changes: 69 additions & 0 deletions zh/202502/why-manufacturing-enterprises-choose-emq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## 前言

先进制造是指通过集成信息、自动化、现代管理与制造等技术,实现产品设计、制造、检测、管理和服务等全生命周期的智能化和高效化。

随着物联网、云计算、人工智能等新一代信息技术的发展,工业物联网作为连接设备、生产线、工厂、供应商和客户的桥梁,成为了推动先进制造发展的关键力量。

为了应对先进制造场景中海量设备的数据采集与交互问题,EMQ 映云科技凭借全球领先的「云边端」连接与数据平台,通过自主研发的 MQTT 软件,为企业提供实时、稳定、可靠的数据连接方案,成为先进制造企业数字化转型的优势选择。

## 发展趋势

当前,先进制造业正经历着深刻的变革,主要体现在以下几个方面:

1. **数字化转型:**通过调动生产、销售等各个环节的有效数据,提高生产效率和产品质量,同时降低运营成本。
2. **智能化升级:**利用人工智能、机器学习、边缘计算等新技术,先进制造工厂能够实现数据驱动的智能决策和自动化生产。
3. **联网化扩展:**越来越多的生产设备和系统被连接到一起,形成一个庞大的工业物联网生态系统。
4. **服务化转变:**从单纯的产品销售向提供一站式的服务解决方案转变,满足客户日益增长的需求。
5. **可持续发展**:进一步减少能源消耗和环境污染,推动循环经济模式的发展。

这些趋势不仅改变了行业的运作方式,也对企业的 IoT 基础设施提出了更高的要求。特别是在数据处理的速度、安全性和灵活性方面,许多制造企业开始寻求更加专业化的技术人员来帮助其构建可靠的智能化工厂和设备运营平台。

## 行业痛点

在迈向先进制造的过程中,企业面临诸多挑战,其中数据采集和管理问题尤为突出:

1. **海量数据处理难**:工业环境中产生的数据量巨大且类型复杂,如何快速有效地收集、存储并分析这些数据成为一大挑战。
2. **实时数据传输慢**:某些关键应用领域(例如:自动驾驶汽车、医疗监控等)对于数据传输的延迟非常敏感,任何延误都可能导致严重后果。
3. **安全性考量不足**:随着更多设备接入互联网,网络安全风险也在增加,确保数据的安全性和隐私保护变得至关重要。
4. **跨平台兼容性差**:不同厂商提供的硬件和软件之间可能存在兼容性问题,这限制了数据的有效整合与共享。
5. **缺乏标准化流程**:由于没有统一的标准指导,企业在实施先进制造项目时往往需要自行摸索,增加了项目失败的风险。

这些问题得不到妥善解决,将直接影响到企业的竞争力和发展潜力,寻找一个既懂技术又了解业务需求的专业伙伴显得尤为重要。

## 选择 EMQ 的理由

面对上述挑战,EMQ 提供了一套完整的先进制造解决方案,旨在帮助企业克服困难,顺利推进数字化转型进程。在先进制造领域,旗舰产品 EMQX Platform 能够为众多应用场景提供以下服务:

1. **大规模设备连接**:EMQX 支持数百万乃至上亿台设备的同时在线连接,适用于各种规模的企业部署。通过分布式架构设计,轻松应对高并发流量冲击,并保证稳定可靠的通讯性能。
2. **高效数据流转**:凭借优化后的 MQTT 协议栈以及灵活的消息路由机制,EMQX 确保了数据能够在云端、边缘节点及终端设备间迅速传递,满足了实时性较高的业务场景需求。
3. **增强安全保障**:EMQX 内置多种安全特性,包括身份验证、访问控制、加密传输等,能够有效防范潜在威胁,保护用户数据免受非法入侵。
4. **简化运维管理**:EMQX 还提供了图形化的界面和 API 接口,使得管理员能够方便地监控整个系统的运行状态,及时发现并解决问题。
5. **促进生态合作**:EMQ 积极与其他主流云服务商和技术提供商(如 Azure 和 aws 等)展开合作,共同打造开放共赢的智能物联生态,助力企业实现全球化融合创新。

通过提供稳定可靠的数据连接解决方案,EMQ 帮助制造企业实现设备之间的无缝通信,支持实时数据分析,从而优化生产流程、减少停机时间和浪费。同时,通过与人工智能技术的深度融合,EMQ 帮助企业从海量数据中提取有价值的信息,推动预测性维护、故障诊断等智能化应用的发展,进一步助力先进制造企业在激烈的市场竞争中脱颖而出。

## 应用案例

- [**汽车制造企业选用 EMQX 搭建智能物联平台**](https://www.emqx.com/zh/customers/building-an-intelligent-manufacturing-platform-based-on-emqx)

EMQ 与国内知名运营商合作,通过微服务架构方式,为某领先的汽车制造企业开发了一个全新的工业物联网平台,构建起新一代黑灯工厂的智能化数字底座。

- [**轮胎制造企业选用 EMQX 构建工厂数据引擎**](https://www.emqx.com/zh/customers/smart-factory-data-engine-based-on-emqx)

EMQ 为某轮胎制造企业建设智慧工厂提供了工业物联网数据方案,满足万级生产和能源设备接入、百万级测点数据高实时并发等生产需求,帮助该企业无缝融合 IT 与 OT 数据,实现智能化运营。

- [**化工生产企业选用 EMQX 驱动智能生产平台**](https://mp.weixin.qq.com/s?__biz=Mzg3NjAyMjM0NQ==&mid=2247499077&idx=1&sn=1a9934a6d5035b47172d164dc5aa926f&scene=21#wechat_redirect)

基于边缘计算技术,EMQ 为化工行业构建高度互联、高效通信、高性能运行的智能服务平台,实时收集和分析生产过程中的各种数据,通过智能化决策促进化工企业的可持续发展。

- [**饮料生产巨头选用 EMQX 构建先进制造平台**](https://www.emqx.com/zh/customers/a-global-leader-builds-a-smart-production-hub-with-emq)

通过与 EMQ 的深度合作,全球领先的饮料生产企业利用实时采集的高质量数据,构建起食品和饮料生产的先进制造平台,显著提升了生产效率和产品质量。

长期以来,EMQ 凭借自身强大的技术研发实力和丰富的行业经验,在先进制造企业实现数字化转型的过程中发挥着重要作用,赢得了全球范围内众多知名品牌的信赖和支持。截至目前,EMQ 已经为国内数十家制造企业的数字化转型、智能化升级提供了完整的数据支持和服务。

## 结语

随着 5G 商用化进程加快、人工智能技术不断成熟以及相关政策法规逐步完善,越来越多的制造企业加入到数据驱动智能生产的大潮之中。

未来,EMQ 也将继续秉承「连接物理世界、数字世界和人工智能」的理念,持续投入研发资源,推出更多符合国内外市场需求的产品和服务,探索先进制造、智能制造的美好明天。