Ayyoubzadeh/ESP32-Wiznet-W5500-Micropython

How to use the mqtt protocol

ZuWard opened this issue · 2 comments

Hello!

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

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的时候一切正常。

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后导致产生了死循环的阻塞 具体你可以打断点试试