Giter VIP home page Giter VIP logo

esp32-ota's Introduction

ESP32 firmware sample project for OTA update using ThingsBoard and for sending telemetry to ThingsBoard.
See all details in ESP32 OTA using ThingsBoard tutorial.

ThingsBoard is an open-source server-side platform that allows you to monitor and control IoT devices. It is free for both personal and commercial usage and you can deploy it anywhere. If this is your first experience with the platform we recommend to review what-is-thingsboard page and getting-started guide.

ESP32 is a series of low-cost, low-power SOC microcontrollers with integrated self-contained Wi-Fi and dual-mode Bluetooth. This sample application allow you to deliver a new firmware images to EPS32 with using ThingsBoard and OTA.

esp32-ota's People

Contributors

ashvayka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32-ota's Issues

Widget Error: NullInjectorError: No provider for XYZ

Hi,

I am working with a local instance of Thingsboard v3.1.1 on a Raspberry Pi 4 running Raspbian 10 (Buster). During the testing for the ESP32-OTA example I have observed an error in the provided ota widget.
image

Any help is appreciated!

MQTT connection resets

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)

Arduino IDE Support

Is there any chance for this example supports Arduino IDE environment ? Thank you.

Imosible execute "make flash monitor" following OTA-ESP32 guide

Hi! I'm following this guide https://thingsboard.io/docs/samples/esp32/ota/ but when I execute "make flash monitor" I get these errors:

"In file included from /home/admin1/esp/esp32-ota/main/main.c:10:
/home/admin1/esp/esp-idf/components/esp_event/include/esp_event_loop.h:2:2: warning: #warning "esp_event_loop.h is deprecated, please include esp_event.h instead" [-Wcpp]
#warning "esp_event_loop.h is deprecated, please include esp_event.h instead"
^~~~~~~
/home/admin1/esp/esp32-ota/main/main.c: In function 'mqtt_event_handler':
/home/admin1/esp/esp32-ota/main/main.c:76:5: error: enumeration value 'MQTT_EVENT_ANY' not handled in switch [-Werror=switch]
switch (event->event_id)
^~~~~~
/home/admin1/esp/esp32-ota/main/main.c:76:5: error: enumeration value 'MQTT_EVENT_DELETED' not handled in switch [-Werror=switch]
cc1: some warnings being treated as errors
make[1]: *** [/home/admin1/esp/esp-idf/make/component_wrapper.mk:292: main.o] Error 1
make: *** [/home/admin1/esp/esp-idf/make/project.mk:635: component-main-build] Error 2".

I'd like to know how I can solve it.

Thank you very much, I'm learning a lot with thingsboard!!!!

send telemtry and attribute in esp idf

Hello, I am a beginner.
I am looking for a solution to send telemetry and attribute to Thingsboard in esp idf
Can ota help me?
or ota is only used for updating

unable to connect through MQTT

Following logs are displayed

I (1493) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1993) MQTT_CLIENT: Sending MQTT CONNECT message, type: 1, id: 0000
W (2343) MQTT_CLIENT: Connection refused, not authorized
I (2343) MQTT_CLIENT: Error MQTT Connected
W (3503) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (4503) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (5503) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (6503) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (7503) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (8503) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (9503) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect
W (10503) tb_ota: WAIT_MQTT state, MQTT not connected, wait for the connect

Rollback to previous version if OTA update is successful but code is wrong

Hi, I have a question to see if it would be possible to go back to a previous version in the case that after an OTA update the code has some problems.

While testing some scenarios, I came across a possible failure of our system: Imagine that I compile my code and upload it using OTA and the update is successful, but something in the code is wrong and the controller is not able to connect to WiFi, can not find the token that the device uses or some kind of problem that prevents the ESP32 from connecting to the Internet or Thingsboard.

How could I make to detect one of this problems and go back to previous working versions if possible?

Thank you in advance,
Juan.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.