Trying to start: OTA - Select Device: nothing to select

Hello all.

I’ve just begun in Thinger and I’d like to get it to work. I see I’ll need your help.

I use VSCode / PlatformIO with Arduino Framework to code a ESP32 Pico D4, embeded in a LilyGo TTGO T3 V2.1.6 board.

I’m trying to follow this documentation instructions to perform OTA firmware update:
https://docs.thinger.io/extended-features/ota#esp32-ota

I have installed Thinger VSCode extention. I’ve through Extension Configuration, leaving everything as was, but filling in the token I’ve created with full access. I can see the rocket icon at the bottom toolbar. When I click on it, a textbox opens on top toolbar with a gray text saying Select or search a device but no device is there to select and I get no response when I type Device Name or Device ID.

What’s missing?

Thank you.
Regards,
Ciro.

Reading some examples, I found out that Thinger requires thinger.start(); in setup() procedure. So, I’ve included it in the code. But, when trying to build, I get:

image

Just to sumarize, the code contains:

#include <ESPAsyncWebServer.h>
#include <ThingerESP32.h>

#define USERNAME "Ciro_Bruno"
#define DEVICE_ID "R....Jr"
#define DEVICE_CREDENTIAL "kv3... ...1qaj9"

ThingerESP32 thing (USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

ThingerESP32OTA ota(thing);

const char *STA_ssid = "ssid";
const char *STA_senha = "psw";

...

void setup() {
...
    WiFi.begin(STA_ssid, STA_senha);
...
    thing.add_wifi(STA_ssid, STA_senha);
    thing.start();
}

void loop(){
  thing.handle();
}

Please, any comment from yours might be very usefull.
Thank you.
Regards, Ciro.

Now I found out that #define THINGER_FREE_RTOS is also required.
Including it in the code, now I can have it compiled and flashed. thing.start() gives no errors anymore.
Nevertheless, VSCode still doesn’t “find” the device. I mean:

#include <ESPAsyncWebServer.h>

#define THINGER_SERIAL_DEBUG
#define THINGER_FREE_RTOS

#include <ThingerESP32.h>

#define USERNAME "Ciro_Bruno"
#define DEVICE_ID "R....Jr"
#define DEVICE_CREDENTIAL "kv3... ...1qaj9"

ThingerESP32 thing (USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

ThingerESP32OTA ota(thing);

const char *STA_ssid = "ssid";
const char *STA_senha = "psw";

...

void setup() {
...
    WiFi.begin(STA_ssid, STA_senha);
...
    thing.add_wifi(STA_ssid, STA_senha);
    thing.start();
}

void loop(){
  thing.handle();
}

Any help will be appreciated.
Thank you.

Ok, one more step over.

Now I found out that there are two ways of getting Tokens. One of them works for selecting device and the other doesn’t.

I was trying to use the token I’ve got through the device’s configuration. In fact it was sounding me ok to have a specific token for each device. But not. The required token is a user’s token. It means that when I give or sell the device to someone, I’ve got to give a copy of my user’s token as well.

Anyway, with the user’s access token now I can find my device! Uhoo!

My question now is: Why there’s a Token fill-in field for User and another one for Workspace?

Trying to update, I get a timeout!

The device doesn’t even reset as it uses to do when I make USB update.

How could I obtain further information?

Hi,

I’ve been working with some ESP32 without project board, none of them resets when gets the firmware by USB, should be reseted by hardware.

The device resets when gets the firmware by OTA, and even I’ve noticed when I upload the firmware by OTA and ethernet connection, I need to reset the device to get the firmware correctly installed, I have a thinger resource that resets the device , after that the new firmware runs without issues.

Hope this helps.

Hello @ega

I guess you’re right.

Cool! Would you share it?

Thank you very much.
Regards, Ciro.

Yes sure,

    thing["Restart"] = []()
    {
      ESP.restart();
    };

It is just a button, when it is pressed at the device’s api, the device restarts.

Hope this helps.

you mean a button at Thinger dashboard?

Anyway, I’ve got a problem with Thinger OTA.

Every time I use ThingerESP32OTA ota(thing); to create the OTA instance, the FTP server doesn’t accept connections anymore.

I use HenrikSte / ESP32FTPServer in the code and Filezilla as FTP Client in the computer. They’ve been very dependable together, but when I use Thinger OTA, they hardly connect.

I’m quite sure we won’t find the reason. I guess I should look for an alternative for OTA.

Hi,

I dont use any FTP server at the uC, nor FTP client at the computer, do you use it for a particular reason or exclusively for the OTA? Note that the OTA does not need that connection, the example does not invoques any other connection than the thinger native.

Yes, at the device’s dashboard, the API.

image

Hope this helps.