nodemcu-uploader icon indicating copy to clipboard operation
nodemcu-uploader copied to clipboard

Add Ability to Set Hostname in CLI When Uploading Files

Open liv3dn8as opened this issue 7 years ago • 2 comments

I think that it would be nice to be able to set the hostname at time of uploading. Having some sort of argument like --hostname would be nice. However, I just realized that when setting the hostname it doesn't stick after the device has been rebooted. Only if it is in the actual code. Not sure if it even makes sense then as I doubt you could really append the actual code. Maybe my idea will spark something though!

liv3dn8as avatar Apr 05 '17 20:04 liv3dn8as

You can write the hostname in a separate file and then execute it from init.lua. Like in this example (see the very first lines). Then, you just re-uploads that separate file with nodemcu-uploader.

saintcrawler avatar Apr 21 '17 21:04 saintcrawler

Thanks for the example and yes, that is a possibility but I would still have to have a file for every hostname I wanted to use. My main objective is, for example. Say someone is trying to create a Mesh Network and the configuration files are all the same. Wouldn't it be super simple to just type the wanted hostname while uploading the files to each ESP? I did manage to use 'echo' and append to the init.lua file. Which will have to do for now!

liv3dn8as avatar Apr 24 '17 20:04 liv3dn8as