Copy config data to Arduino?

I'm creating a device that connects via WiFi and downloads a json string from the internet, parses the string, and displays the information on an OLED display. Everything is working nicely in my test application.

However, I have hard-coded the SSID and password for the WiFi connection, as well as the URL for the json data. Ideally, I'd like to write a desktop application that allows a user to set some parameters, then copies those parameters to the Arduino over a USB serial connection.

I am trying to avoid making the user install the Arduino IDE, libraries, and source code simply to add their own SSID and password.

Can anyone share a sample application that does something similar?

Can anyone share a sample application that does something similar?

For the PC? Or for the Arduino?

kb0wwp:
I am trying to avoid making the user install the Arduino IDE, libraries, and source code simply to add their own SSID and password.

One option would be to have some code in setup() that allows the user to enter the data and saves it to the EEPROM memory. You could arrange a short timeout so if the user does not respond it will use the data previously stored, or if the user had never stored anything, it could use default values that you had included in the program. However this would require some means for the user to type in the details - for example via a terminal program such as puTTY on her/his PC.

You could write a short Python program (or whatever language you like) to take the place of the terminal program in a more user friendly way. Perhaps tell the user to plug in their Arduino and then run the Python program whenever they need to change the details.

Whether the data is entered using a program you write, or a terminal program, the Arduino should run perfectly well without either when no changes are needed.

...R

PaulS:
For the PC? Or for the Arduino?

Both, I guess. I'm envisioning a small Windows app that can be downloaded that will allow the user to connect via USB, and set some parameters (ssid, password, URL with json data, data element to be displayed, etc.) which are then uploaded to the device.

I could write an application similar to the Google Chromecast - the user connects to the "temporary" Chromecast WiFi access point, enters the info, the Chromecast restarts and connects to the user's WiFi router. However, I'm afraid the amount of code needed would exceed the storage capacity of the NodeMcu.

I'm trying to do this without making the user download extra applications, like Putty, or the Arduino IDE.

Robin2:
You could write a short Python program (or whatever language you like) to take the place of the terminal program in a more user friendly way. Perhaps tell the user to plug in their Arduino and then run the Python program whenever they need to change the details.

Yes, that's exactly the kind of example I'm looking for. I've tried Googling, but I'm apparently not using the right terminology to narrow it down.

Robin2:
One option would be to have some code in setup() that allows the user to enter the data and saves it to the EEPROM memory. You could arrange a short timeout so if the user does not respond it will use the data previously stored, or if the user had never stored anything, it could use default values that you had included in the program. However this would require some means for the user to type in the details - for example via a terminal program such as puTTY on her/his PC.

You could write a short Python program (or whatever language you like) to take the place of the terminal program in a more user friendly way. Perhaps tell the user to plug in their Arduino and then run the Python program whenever they need to change the details.

Whether the data is entered using a program you write, or a terminal program, the Arduino should run perfectly well without either when no changes are needed.

...R

Wait... as I noodle your post, I'm thinking of how I can replace Putty with my own serial communications application. When the device starts, the setup() code checks to see if it gets a response from my Windows application - if so, wait for new data to be saved and uploaded. If it sees no connection, carry on with its original programming.

I think I may be able to do this without an example app. Thanks!

I think you should choose the AP mode configuration setup instead of Putty or speacial program. AP mode way is more clear and not that capacity hunger. There are too many examples out there, you will be suprised.

omersiar:
I think you should choose the AP mode configuration setup instead of Putty or speacial program. AP mode way is more clear and not that capacity hunger. There are too many examples out there, you will be suprised.

"Arduino AP mode setup" - I just needed to know the right thing to Google and there's the info I need. Thanks!

kb0wwp:
to see if it gets a response from my Windows application - if so, wait for new data to be saved and uploaded.

I have not used Windows for a long time. This Python - Arduino demo may be helpful. I believe it will work with Windows if you edit the references to the serial port.

see if it gets a response

This can be a bit of a chicken and egg problem. Usually when a PC program opens the serial port it causes the Arduino to reset. I normally use that to get the Arduino to send a message to the PC program so the PC program know the Arduino program is ready. Then the PC program can send data. And if there is no PC program listening then the Arduino can just ignore all this.

...R