fizista / micropython-umqtt.robust2

MIT License
49 stars 7 forks source link

TypeError in reconnect #2

Closed juansezoh closed 4 years ago

juansezoh commented 4 years ago

Hi,

When the 'connect' response is 'None'?. Any idea?.

Traceback (most recent call last): File "main.py", line 97, in <module> File "/flash/lib/robust2.py", line 111, in reconnect File "/flash/lib/robust2.py", line 104, in reconnect File "/flash/lib/simple2.py", line 268, in connect TypeError: 'NoneType' object is not subscriptable

Thanks.

fizista commented 4 years ago

What version did you upload?

On which device did this problem occur?

What version of Micropython has the device?

juansezoh commented 4 years ago

Hi, thanks for your prompt response.

Version is: umqtt.robust2: New version 2.0.2 Device: Lopy4 1.20.rc13 Micropython: 1.9.4

Is it possible that executing 'resp = self._read(4)' line 267 in simple2.py requires a little delay?.

Can you also tell me how can I make the Debug in the console complete? Is client.DEBUG = True enough? Only a few errors come out.

fizista commented 4 years ago

In version 2.0.2 of the robust2 library there is a comment in line 104. So there shouldn't be an error there.

Please install the latest version of robust2.

When DEBUG=True, only the exceptions captured by this library are displayed.

So it's not really a complete debugging tool, but rather a preview of the problems.

It could be improved, but we have a limited amount of RAM on the devices.

fizista commented 4 years ago

If you need to debug the code, you can use MQTTClient class from the file: https://github.com/fizista/micropython-umqtt.robust2/blob/master/tests.py

fizista commented 4 years ago

I threw in a new version. Try it.