Replace individual files via USB + ESPtool or comparable?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Wookbert
Normal user
Posts: 132
Joined: 06 Nov 2020, 03:17

Replace individual files via USB + ESPtool or comparable?

#1 Post by Wookbert » 18 Nov 2021, 15:50

Not specifically an ESPEasy questions, more general: Is it possible to send a text file containing SSID and WPA2/3 password via USB to an ESP32 (which previously has been flashed with the necessary binaries), so that on the next boot cycle it connects to that WLAN? We’d like to avoid the Wireless Access Point code implementation.

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Replace individual files via USB + ESPtool or comparable?

#2 Post by Ath » 18 Nov 2021, 15:58

Are you talking about an ESP running ESPEasy or 'plain' Arduino code?

To start with, the ESP is not in your network yet, so no way to access it, unless you connect to the AP provided by ESPEasy, and send the commands to configure WiFi. For 'plain' Arduino you will have to implement that yourself, probably by using some library/project that supports that.
/Ton (PayPal.me)

Wookbert
Normal user
Posts: 132
Joined: 06 Nov 2020, 03:17

Re: Replace individual files via USB + ESPtool or comparable?

#3 Post by Wookbert » 18 Nov 2021, 16:42

Plain Arduino. Fully aware, that one can’t send anything via WiFi to the ESP, if it’s not connected to the WLAN 😂. That’s why I mentioned USB.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Replace individual files via USB + ESPtool or comparable?

#4 Post by ThomasB » 18 Nov 2021, 22:11

You can do it with ESPEasy. Just send these text commands via USB serial port:
WifiSSID #namehere#<CR>
WifiKey #keyhere#<CR>
save<CR>
reboot<CR>

You can do it in your custom Arduino code too. But you have to create functions that read the serial port and act on what you send it. To send the info either use PuTTY or create a companion PC app that sends the file (or prompts the user to enter the credentials).

It's only code, how hard could it be?

- Thomas
Last edited by ThomasB on 18 Nov 2021, 22:13, edited 1 time in total.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Replace individual files via USB + ESPtool or comparable?

#5 Post by TD-er » 18 Nov 2021, 22:12

I do plan to implement the Improv API to ESPEasy, so that it will be possible to use the latest added feature of the web flasher to allow to configure the node right after connecting it to USB.
This is either right after flashing, or a node that's simply not configured to connect to WiFi.

I plan to have that added for the next nightly build.

Implementing Improv isn't that hard as it is a fairly simple protocol.

There is also a variant for ESP32 using the bluetooth radio for initial deployment, which allows to create an app for it.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 31 guests