谷动谷力

 找回密码
 立即注册
查看: 4243|回复: 4
打印 上一主题 下一主题
收起左侧

[5人赞]详解车载TBox的MQTT协议

[复制链接]
跳转到指定楼层
楼主
发表于 2024-9-28 11:37:47 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
1.基本概念
MQTT全称为消息队列遥测传输协议,是基于TCP/IP之上的应用层协议,采用发布订阅的模式,由于非轮询或周期传输消息,减小了网络带宽,不同重要度的消息采用不同的QoS等级,保证重要消息不丢失。
           
MQTT协议本身占用资源很小,通常作为客户端部署于各种嵌入式系统内,包括各种传感器、执行器,即可完成消息的订阅和发布。
           
           
2.车上的应用
MQTT协议一般部署在可以联网的ECU内,实现远程控制、远程刷写、数据上传、远程诊断、OTA等功能。
           
           
远程控制
用户通过手机APP下发远程解门锁的请求,该请求以MQTT的topic发布到云服务器,云服务器根据topic名称,将该topic发布到车载终端内,车载终端订阅该topic,当收到该topic后,解析payload的内容,将解锁报文通过CAN总线发送到门窗控制器,并将解锁结果通过topic发布到云服务器,云服务器将topic发布到手机APP,用户即成功执行了远程解锁的动作。   
           
数据上传
车载终端接受车内ECU发送的CAN报文,解析所需的信号,按周期将信号打包后,通过指定的topic将信号上传到平台。
           
远程诊断
云平台通过指定的topic下发诊断指令,终端订阅到该topic,发起向车内ECU的诊断请求,例如读取ECU的故障码,收到诊断响应后,通过指定topic将诊断结果发布到云平台。
           
3.技术细节
介绍一下MQTT协议的报文格式、端口号、以及相关的概念。
           
报文格式
MQTT报文有固定报头、可变报头、有效载荷3个部分。
固定报头组成:
报文类型:位于固定报头的第一个字节的高4位(bit 7-4),用于标识MQTT报文的类型。MQTT协议定义了14种不同类型的报文,如CONNECT(连接请求)、CONNACK(连接确认)、PUBLISH(发布消息)、PUBACK(发布确认)等。
标志位:位于固定报头的第一个字节的低4位(bit 3-0),用于某些特定类型的报文,如PUBLISH报文中的DUP(重复分发标志)、QoS(服务质量等级)、RETAIN(保留标志)等。这些标志位的具体含义取决于报文类型。   
剩余长度:紧接着报文类型之后,表示当前报文剩余部分的字节数,包括可变报头和有效载荷。剩余长度字段使用变长编码方案,最小一个字节,最大四个字节。
           
可变报头组成:
可变报头存在于某些类型的报文中,如CONNECT、PUBLISH、SUBSCRIBE等,可变报头的内容根据报文类型的不同而不同,通常包含以下字段:
报文标识符:一个两字节的字段,用于标识MQTT报文,在需要确认的报文中,如PUBLISH(QoS > 0)、PUBACK、PUBREC、PUBREL、PUBCOMP、SUBSCRIBE、SUBACK、UNSUBSCRIBE、UNSUBACK等,报文标识符用于匹配请求和响应。
其他字段:根据报文类型的不同,可变报头还可能包含其他字段,如CONNECT报文中的协议名(Protocol Name)、协议级别(Protocol Level)、连接标志(Connect Flags)和保持连接(Keep Alive)等。
           
有效载荷:
包含客户端和服务器之间传输的应用数据,不是所有MQTT报文都包含有效载荷,只有那些需要传输数据的报文(如PUBLISH、CONNECT等)才包含有效载荷。
CONNECT报文的有效载荷:包含客户端标识符(Client Identifier)、遗嘱主题(Will Topic)、遗嘱消息(Will Message)、用户名(User Name)和密码(Password)等字段。
其他报文的有效载荷:对于其他类型的报文,如PUBLISH报文,有效载荷就是实际要传输的应用消息。
           
以CONNECT报文为例,其报文格式如下:
           
固定报头:0x10(报文类型CONNECT)+ 剩余长度(根据有效载荷长度计算)
可变报头:
协议名(Protocol Name):"MQTT"(UTF-8编码)
协议级别(Protocol Level):0x04(表示MQTT 3.1.1版本)
连接标志(Connect Flags):包含多个标志位,如会话清理标志、遗嘱标志、用户名标志、密码标志等
保持连接(Keep Alive):两次发送数据的最大时间间隔(秒)   
有效载荷:客户端标识符(Client Identifier)+(可选)遗嘱主题(Will Topic)+(可选)遗嘱消息(Will Message)+(可选)用户名(User Name)+(可选)密码(Password)
           
4.Demo实操
借助MQTTX软件,我们简单实操一下。
           
连接配置:我们这里配置连接到MQTTX的测试服务器,当然,实际使用时,一般连接到我们自己的MQTT服务器。
连接配置         
           
发布消息:我们模拟发布一个解锁的topic,然后再订阅这个topic,实际应用中,我们连接到自己的MQTT服务器以后,发布topic消息,服务器会把该topic消息发送到车载终端。
发布解锁topic         
   
可承接汽车电子、嵌入式软件开发和测试相关的需求,包括C、Matlab、Python、C#、CANoe等。

开源项目链接:
基于UDS on CAN的Bootloader的刷写上位机:
https://github.com/sydyg/UDS-on-Bootloader.git
OSEKNM协议栈:
https://github.com/sydyg/OSEK_NM

嵌入式/汽车电子测试、开发学习课程链接:
https://mv0qxzpryx9.feishu.cn/wiki/H3JCwYIVGiEOKSk9VkQcxTJ9nRf?from=from_copylink


九二,汽车行业,域控软件架构师。
熟悉汽车电子和嵌入式开发测试✍。
跟大伙聊聊天、交朋友。
喜欢的朋友可以关注和赞赏。


+15

最近谁赞过

回复

使用道具 举报

沙发
发表于 2024-11-21 18:22:45 | 只看该作者

路过顺便顶楼主
+10
回复 支持 反对

使用道具 举报

板凳
发表于 2024-12-6 04:30:57 | 只看该作者

Виды щебня

Хотите создать идеальное покрытие для вашего участка или дорожного покрытия? Тогдаотсев идеально подойдет для вас!
Наш высококачественный отсева щебня обеспечит прочность, долговечность и надежность вашего покрытия. Благодаря правильной фракции отсева,
он обладает отличной укладываемостью и прекрасно дренирует воду, что делает его идеальным выбором для любых работ - щебень в ростове на дону с доставкой.
+10
回复 支持 反对

使用道具 举报

地板
发表于 2024-12-6 17:30:45 | 只看该作者

Сертификация

Сертификат ТР ТС – документ, подтверждающий безопасность продукции и соответствие требованиям
конкретного технического регламента Таможенного Союза. Быстро оформим сертификация тс.
+10
回复 支持 反对

使用道具 举报

5#
发表于 2025-3-21 17:54:31 | 只看该作者

Casino Wplay: Your Elemental Orient to Online Gaming in Colombia

Jamesgop ??? 2024-12-6 04:30
Хотите создать идеальное покрытие для вашего участка  ...

Are you searching an eye to a top-tier online casino sense in Colombia? Look no above than Casino Wplay, a leading principles that has bewitched the Colombian gaming market near storm. Whether you're a prepared sportswoman or a beginner exploring the crowd of online gambling, Wplay offers an rousing, secure, and simple setting tailored to your needs. In this sweeping lodestar, we’ll dive into all you need to differentiate up Casino Wplay, from its victim offerings and bonuses to its juridical standing and tips payment maximizing your experience.

What is Casino Wplay?

Casino Wplay is inseparable of Colombia’s main online gambling platforms, operated before Aquila Wide-ranging League S.A.S. Launched in 2017, it holds the account of being the in front online casino to inherit a entitle from Coljuegos, the hinterlands’s endorsed gambling regulator. This milestone not one solidified Wplay’s credibility but also set a benchmark destined for permitted online gaming in Colombia. Today, Wplay is synonymous with eminence pleasure, offering a boundless picking of casino games, sports betting options, and restricted promotions.

With a meet on delivering a localized experience, Wplay caters specifically to Colombian players, supporting payments in Colombian Pesos (COP) and providing character bolster in Spanish. Whether you’re spinning the reels on slots or placing bets on your favorite sports conspire, Wplay ensures a seamless and enjoyable experience.

Why Choose Casino Wplay https://wplay-co1.krw0.com/ ?

When it comes to online casinos, players sooner a be wearing loads of options. So, what makes Casino Wplay wait out? Here are some opener reasons why it’s a top election recompense Colombian gamers:

1. Legal and Regulated Gaming
Casino Wplay operates supervised a sanction from Coljuegos, ensuring full compliance with Colombian gambling laws. This means you can portray with peaceableness of haul, knowing your funds and in the flesh information are secure.

2. Distinct Bold Piece
Wplay boasts an stimulating library of games, including:
- Slots: From classic fruit machines to present-day video slots with immersive graphics.
- Plateau Games: Blackjack, roulette, baccarat, and poker variants.
- Live Casino: Real-time gaming with businesslike dealers owing an authentic casino vibe.
- Sports Betting: Wager on football, basketball, tennis, and more, with competitive odds.

3. Limited Bonuses and Promotions
Fresh players can kickstart their journey with a big-hearted greeting bonus, while regulars enjoy relentless promotions like unengaged spins, cashback offers, and loyalty rewards. Agree to an watch on Wplay’s promotions page to overstress your winnings.

4. Mobile-Friendly Rostrum
Whether you’re at cosy or on the open to, Wplay’s mobile-optimized place and dedicated app guarantee you not miss a half a second of the action. Compatible with both Android and iOS devices, it delivers mirror-like gameplay and easy navigation.

5. Native Payment Options
Wplay supports a multiplicity of payment methods tailored to Colombian users, including:
- Bancolombia
- Efecty
- Visa/Mastercard
- PSE (Pagos Seguros en Linea)
Deposits and withdrawals are fast, secure, and hassle-free.

How to Become infected with Started with Casino Wplay

Happy to solder together the fun? Signing up with Casino Wplay is energetic and straightforward. Follow these steps:

1. Visit the Authentic Website: Headmaster to the Wplay homepage (wplay.co).
2. Ledger an Account: Click “Sign Up” and seal in your details, including your personage, email, and phone number.
3. Verify Your Identity: As a regulated platform, Wplay requires sameness verification to concur with Coljuegos standards.
4. Alluvium Funds: Select your preferred payment method and count up loot to your account.
5. Claim Your Extra: Arouse the receive offer and start playing!

Head Games to Jolly along a fool around at Casino Wplay

Casino Wplay offers something payment everyone. Here are some in fashion picks to take a shot:

Overwhelm Slots at Wplay
- Book of Numb: An Egyptian-themed speculation with spaced out payout potential.
- Starburst: A vibrant, fast-paced hollow whole for beginners.
- Gonzo’s Quest: Fasten the hunt seek after for unseen treasures with cascading reels.

White-hot Casino Favorites
- Actual Roulette: Lay on your lucky numbers with existent dealers.
- Dynamic Blackjack: Check your skills against the forebears in genuine time.
- Mad Experience: A exciting game show-style acquaintance with beefy attain opportunities.

Sports Betting Highlights
Football reigns transcendent in Colombia, and Wplay delivers with national betting markets on Liga BetPlay, worldwide leagues, and chief tournaments like the Copa America.

Tips for the benefit of Pleasant at Casino Wplay

While gambling is pretty much about luck, a few strategies can add to your trial and boost your chances of celebrity:

1. Plonk down a Budget: Decide how much you’re agreeable to go through and stick to it.
2. Leverage Bonuses: Speak meet offers and unengaged spins to stretch your playtime without extra cost.
3. Learn the Games: Routine uncontrolled versions of slots or flatland games to realize the rules first betting unfeigned money.
4. Risk Dapper on Sports: Research teams, stats, and odds up front placing your wagers.
5. Drama Responsibly: Contain breaks and keep off chasing losses to provision the diversion alive.

Is Casino Wplay Ok and Legit?

Absolutely. As a Coljuegos-licensed practitioner, Wplay adheres to finicky regulations to protect light-complexioned play and performer protection. The plank uses SSL encryption to safeguard your evidence and offers forthright terms and conditions. Additionally, Wplay promotes important gambling with tools like deposit limits and self-exclusion options.

Wplay vs. Other Colombian Online Casinos

How does Wplay stack up against competitors like Bet365 or Rushbet? While all furnish trait gaming, Wplay’s edge lies in its:
- Localized Wisdom: Designed specifically for Colombian players.
- First-Mover Advantageously: As the innovator of legal online gaming in Colombia, it has built a intense reputation.
- Sports Betting Blurred: A standout have a role for sports enthusiasts.

Decisive Thoughts on Casino Wplay

Casino Wplay is more than barely an online casino—it’s a gateway to premium entertainment object of Colombian players. With its right backing, mixed games, and player-centric features, it’s no catch red-handed that Wplay remains a favorite in the market. Whether you’re spinning slots, playing reside blackjack, or betting on your favorite team, Wplay delivers a thrilling and trustworthy experience.

Fit out to nightclub in? By wplay.co today, assertion your welcome extra, and pioneer why Casino Wplay is the go-to pre-eminent as a replacement for online gaming in Colombia!

---

SEO Optimization Notes
- Primary Keyword: "Casino Wplay" – Really integrated into the caption, headings, and throughout the content.
- Unoriginal Keywords: "online casino Colombia," "Wplay games," "Coljuegos licensed casino" – Used contextually to lift relevance.
- Character: H1, H2, and H3 headings emend readability and keyword placement.
- Set forth Count: ~700 words, nonpareil principles through despite ranking without overwhelming readers.
- Internal Linking Break: Links to speculative bold guides or bonus pages could be added if element of a larger site.
- Call to Vim: Encourages visits to the official placement, aligning with user intent.

This article is designed to authority soberly as regards searches correlated to "Casino Wplay" while providing valuable low-down to readers. Acquit me certain if you'd like adjustments!
+10
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2025-4-5 02:01 , Processed in 0.479773 second(s), 53 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表