ESP8266 & ESP32 VSCode OTA Support

Include a button to “uncheck” the device.
This functionality is important, otherwise a device will always be tagged, and the developer may confuse the “Upload by Serial USB” buttons with the “Upload by OTA/internet” buttons when updating a firmware.

It is also interesting not to select any device when resetting the VS CODE. Otherwise, the developer may mistake and “Upload by OTA” by mistake when trying to “Upload by Serial”.
I also suggest changing the device’s background color from blue to green, to draw the developer’s attention, avoiding “Upload by Serial” instead of “Upload by OTA”.


verde

Hi!

I would test what happens for ESP8266, but in theory a reboot is issued at the end of flash both for ESP32 and ESP8266 to apply the update.

Will check how to solve it.

In theory it keeps selected the latest flashed device for that project. So, if you change between projects, the flashed device will change. With the ability to deselect a device it should be solved.

VSCode Studio does not allow setting arbitrary colors on the toolbar… a “normal state” is without any background color. You can only set backgrounds for warnings, errors, etc…

We have new version of the Visual Studio Code Extension:

Release Notes

1.0.5 (2021-08-24)

  • Add configuration to disable SSL verification for local deployments
  • Add command to palette for clearing selected device
  • Device search box now also query by device name
  • Improved OTA cancellation mechanism in any step
  • Preliminar support for LZSS compression for Arduno devices
  • OTA Speedup (~15%) with HTTP Keep-Alive (see recommendations on Readme)

Is “remote console” definitively abandoned, or do you have a schedule to get it working?

I can successfully telnet into my ESP32 devices within the wlan, but doing that worldwide over thinger.io without requesting a port forwarding would have been ways more sexy…

Hi @rin67630 ,

today I have been working on it. Some advances:

Now it display messages correctly

void loop() {
  delay(1000);
  Console.println("yes! it works!");
}

4PSuEZi13E

Now it also accepts reading commands from the terminal. Can be used normally as a Serial port

void loop() {
  if(Console.available()) {
    String cmd = Console.readStringUntil('\n');
    Serial.printf("Read command: %s", cmd.c_str());
  }
}

041V4v7L3

Saving the distances, It works practically like a linux terminal, each character is echoed back to the web terminal to ensure the message arrived fine to the device.

I think it can be released tomorrow. I need to do some more testing. :wink:

2 Likes

Still working on it… some work in progress. A minimal example… it says ESP32 but it is compatible with any other device.

TiA0aJgRQx

  console.set_terminal("ESP32", [&](String cmd){
    if(cmd=="free"){
      console.println(ESP.getFreeHeap());
    }else if(cmd=="reboot"){
      console.println("device will reboot now...");
      thing.reboot();
    }else if(cmd=="model"){
      console.println(ESP.getChipModel());
    }else if(cmd=="cores"){
      console.println(ESP.getChipCores());
    }else{
      console.println("\033[31munknown cmd");
    }
  });
1 Like

Hi @rin67630, we have finally published the ThingerConsole functionality. Just take a look to the new Arduino release:

1 Like

I have already used this service from Visual Studio Code, I have a private instance. But now it seems that it has stopped working, it is not listing the devices, the token is the same that I have used in the past.

Can anybody help me?

It is a problem related with latest VS Code Studio in Windows:

This does not look good, RIGHT NOW IT BRINGS ME A LOT OF PROBLMES !! The dependency on Visual Studio Code does not make it scalable and if vulnerable to third parties. Perhaps documentation on the OTA update process with Thinger.io will help to implement a solution via REST API (Not everything has to be done by you), with this I would think about sending updates to my fleet of devices and not depending on third parties like Visual Studio Code.

It is out of our hand. You can switch back to previous VSCode version (it is mentioned in this topic); you can test any of the workarounds mentioned; or even, you can try it on Linux where it works perfectly.

We are working on other OTA processes for fleets of devices, but it will take some time.

I had the same issue, had to install linux, not the best and comfortable exit, but it works again.

As you have a private instance, there is a VSCode plugin that runs into the instance, it worth a try if you have a lot of problems.

Hope this helps.

Gracias @alvarolb y @ega, ya estoy instalando maquina virtual… :sleepy:

The workaround mentioned on the github topic worked for me. All of my devices were listed after changing this setting…

"As a workaround, it seems to work if the user sets this option in user settings in VSCode"
"http.systemCertificates": false,

2 Likes

Loving this OTA option :heart_eyes:, and it has at last forced me to swap over from using Arduino IDE to using VSC and Platformio, I wasn’t aware what I was missing :smiley:. Thank you @alvarolb

I am really looking forward to any news about the OTA for fleet updates.

2 Likes

It worked for me too!!

When I had the issue it had not been published this solution, thanks a lot @MarkAustin902

We are looking forward to updating the Arduino-Thinger library, in particular “ThingerWebConfig.h” so that the TSL/SSL bug can be fixed and make it possible to use the OTA functionality.
:pray: :pray: :pray:

If “ThingerWebConfig.h” and “WiFiManager” work on ESP32 in the year 2021, it would be spectacular.

:pleading_face: thanks, it worked for me too.

I faced a lot of troubles to enable OTA with ESP8266 and ESP32, disabling the http.systemCertificates" worked for me ! I love this feature.

1 Like

Hi - VSCode/Platformio Extension seems like a great solution for OTA deployments. Worked fine in a simple set up but I have an platformio.ini set up with multiple environments and the extension builds all of them! It would be good to set up an env section specific to the ThingerOTA and only build that one. Would it be possible to add a setting, or option to select which env is built and uploaded?