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

支持 FogCloud MQTT #54

Open
stackia opened this issue Jan 1, 2025 · 4 comments
Open

支持 FogCloud MQTT #54

stackia opened this issue Jan 1, 2025 · 4 comments

Comments

@stackia
Copy link
Owner

stackia commented Jan 1, 2025

目前对 platform == 2 (FogCloud) 的设备采用轮询 HTTP API 方式获取状态。

FogCloud 也同时提供了 MQTT 接入方式,使用 https://github.com/stackia/libdeye/blob/81501c0405a67c43900399359332d46577ac8578/src/libdeye/cloud_api.py#L162 可以获取到 MQTT 连接信息。

FogCloud MQTT 的控制消息和旧的 Deye MQTT 并不一样。新的协议叫做 "combo protocol",通过 4 byte 消息来控制设备。

需要研究是否能直接接入 FogCloud MQTT 来获取实时状态推送。

@stackia
Copy link
Owner Author

stackia commented Jan 1, 2025

半年前逆向的一些笔记,时间久远有些细节我已经忘记了

4 bytes
first two byte is always 2, 17

third byte: fourth byte
1 电源: 0 -> off, 1 on
2 扫风: 0 -> off, 1 on
3 童锁: 0 -> off, 1 on

6 水泵: 0 -> off, 1 on
7 负离子: 0 -> off, 1 on
8 模式
9 风速
10 湿度

例如
关闭电源:0x02, 0x11, 0x01, 0x00
打开电源:0x02, 0x11, 0x01, 0x01
设置模式:0x02, 0x11, 0x08, 0x??

@sususweet
Copy link
Contributor

半年前逆向的一些笔记,时间久远有些细节我已经忘记了

4 bytes
first two byte is always 2, 17

third byte: fourth byte
1 电源: 0 -> off, 1 on
2 扫风: 0 -> off, 1 on
3 童锁: 0 -> off, 1 on

6 水泵: 0 -> off, 1 on
7 负离子: 0 -> off, 1 on
8 模式
9 风速
10 湿度

例如 关闭电源:0x02, 0x11, 0x01, 0x00 打开电源:0x02, 0x11, 0x01, 0x01 设置模式:0x02, 0x11, 0x08, 0x??

FogCloud MQTT 的协议官方有开放出来吗,或者说是否稳定可用?另外请问上面的协议是FogCloud的吗?

@stackia
Copy link
Owner Author

stackia commented Jan 3, 2025

这些协议是逆向德业 app apk 后分析出来的。具体是否可用我也不清楚,因为我手上没有 platform == 2 的设备。

德业应该是采购了 FogCloud 的服务,从获取到的 MQTT server domain 能看到是 fogcloud.io 域名。具体协议细节在 FogCloud 官网并没有查到。

@sususweet
Copy link
Contributor

这些协议是逆向德业 app apk 后分析出来的。具体是否可用我也不清楚,因为我手上没有 platform == 2 的设备。

德业应该是采购了 FogCloud 的服务,从获取到的 MQTT server domain 能看到是 fogcloud.io 域名。具体协议细节在 FogCloud 官网并没有查到。

德业app加了壳,逆向起来有点麻烦,能否分享一下逆向后的源代码,我看看能否适配。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants