Page 1 of 1

Connecting to PC via USB, while power supply is ON

Posted: Sun Jan 05, 2020 6:47 pm
by ajocius
My ESP32 is running on it's own power supply (via 3,3V power input, not micro USB) and has quite few sensors physically connected. Is it ok to connect ESP32 to PC using USB cable without switching off external power supply? I would like to adjust code without dismantling ESP32 from it's current location.

Is there any other way to replace main.py file on ESP32 (ftp, wifi?)

Re: Connecting to PC via USB, while power supply is ON

Posted: Sun Jan 05, 2020 7:46 pm
by MostlyHarmless
This very much depends on how your power supply is implemented and what protective diodes are in place. I would expect that your regular power supply is based on some type of voltage regulator. Even though they can withstand some back-voltage (which is a common thing when power is cut), there are limits to that.

Check this StackExchange discussion for some insights.

The next question would be "is the USB port properly protected from back-voltage?" As per USB 2.0 spec that is not allowed.


Regards, Jan

Re: Connecting to PC via USB, while power supply is ON

Posted: Mon Jan 06, 2020 12:01 am
by jimmo
In addition to the power supply you're using, it also depends on your ESP32 board. (i.e. how the USB 5V->3.3V regulation works and protection diodes on the board).

In general though, it is common for boards to be able to support this, but there are many that don't.
ajocius wrote:
Sun Jan 05, 2020 6:47 pm
Is there any other way to replace main.py file on ESP32 (ftp, wifi?)
FTP: There are a few different implementations of FTP servers for MicroPython.

WiFi: Use WebREPL. This comes with the firmware. See the ESP8266 instructions (same for ESP32) here: https://docs.micropython.org/en/latest/ ... -over-wifi

Re: Connecting to PC via USB, while power supply is ON

Posted: Mon Jan 06, 2020 8:36 am
by ajocius
Great, thank you both! Too many ifs and buts when it comes to power supply, I know too little about protection circuits on my board, but if webrepl solution works, then it is even better :) I have enabled webrepl on my board, but could not see the way to copy over file. I see it now in documentation and will test it out.