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

How to use the mqtt protocol #6

Open
ZuWard opened this issue Jan 17, 2024 · 2 comments
Open

How to use the mqtt protocol #6

ZuWard opened this issue Jan 17, 2024 · 2 comments

Comments

@ZuWard
Copy link

ZuWard commented Jan 17, 2024

Hello!

Sorry, how should I use the mqtt protocol to connect to the mqtt server on micropython+esp32 after using this driver

@Antonio0307
Copy link

Hello!

Sorry, how should I use the mqtt protocol to connect to the mqtt server on micropython+esp32 after using this driv
这个esp32+5500连接成功后,遇到个奇怪的现象,就是做TCP服务端的时候,revc(5),接受服务端发过来的数据,不足5那么他就阻塞,超过5,那么数据就分开来发,用wifi的时候没问题。MQTT有个库,可以用,使用wifi的时候一切正常。

@ZuWard
Copy link
Author

ZuWard commented Jan 26, 2024

Hello!
Sorry, how should I use the mqtt protocol to connect to the mqtt server on micropython+esp32 after using this driv
这个esp32+5500连接成功后,遇到个奇怪的现象,就是做TCP服务端的时候,revc(5),接受服务端发过来的数据,不足5那么他就阻塞,超过5,那么数据就分开来发,用wifi的时候没问题。MQTT有个库,可以用,使用wifi的时候一切正常。

使用wifi的时候可以使用官方的mqtt的库 但是使用这个仓库的驱动时 就没办法用那个东西了, 因为那个库的usocket和仓库里带的socket并不适配缺少一些方法

至于你说的阻塞 我猜想 应该是to_read -= len(recv)导致的to_read依旧大于0 进入了循环然后self.available()返回0后导致产生了死循环的阻塞 具体你可以打断点试试

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