esp32-ota icon indicating copy to clipboard operation
esp32-ota copied to clipboard

MQTT connection resets

Open zachjacobs opened this issue 5 years ago • 2 comments

Hello, I am having an issue running the esp32-ota example on a base install of Thingsboard PE. The ESP32 has the following error. I'm using ESP-IDF v3.2.3.

I (83925) MQTT_CLIENT: Sending MQTT CONNECT message, type: 1, id: 0000
I (84845) tb_ota: Connected to MQTT broker mqtt://****, on port 1883
I (84845) tb_ota: Waiting for shared attributes response
free message
free message
free message
E (84885) MQTT_CLIENT: mqtt_message_receive: received a message with an invalid header=0x42
E (84885) MQTT_CLIENT: mqtt_process_receive: mqtt_message_receive() returned -1
W (85845) tb_ota: WAIT_OTA_CONFIG_FETCHED state, MQTT not connected, wait for the connect
W (86845) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (87845) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (88845) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (89845) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (90845) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (91845) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (92845) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect

And Thingsboard error version 2.4.1:

2019-10-09 12:10:45,793 [nioEventLoopGroup-6-8] INFO  o.t.s.t.mqtt.MqttTransportHandler - [fe0d8200-85a9-45a9-****-****] Processing connect msg for client: ESP32_****!
2019-10-09 12:10:45,794 [nioEventLoopGroup-6-8] INFO  o.t.s.t.mqtt.MqttTransportHandler - [fe0d8200-85a9-45a9- ****-****] Processing connect msg for client with user name: ****
2019-10-09 12:10:45,795 [ForkJoinPool-9-worker-25] INFO  o.t.s.t.mqtt.MqttTransportHandler - [fe0d8200-85a9-45a9-****-****] Client connected!
2019-10-09 12:10:46,752 [nioEventLoopGroup-6-8] ERROR o.t.s.t.mqtt.MqttTransportHandler - [fe0d8200-85a9-45a9-****-****] Unexpected Exception
java.io.IOException: Connection reset by peer
	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
	at sun.nio.ch.IOUtil.read(IOUtil.java:192)
	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:247)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1140)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:697)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)

zachjacobs avatar Oct 09 '19 12:10 zachjacobs

Experiencing the same. Did you find a solution for this @zachjacobs ?

simonbogh avatar Dec 19 '19 22:12 simonbogh

@simonbogh @zachjacobs I have solved this problem using esp-idf 3.2 https://github.com/espressif/esp-idf/releases/tag/v3.2

aljimgar avatar Apr 25 '20 10:04 aljimgar