I'm dabbling in a project and would like to add a feature, but I need some help from the community.
My project returns a response from the wunderground api and lights an led based on the temperature in the response. I plan to enclose the circuits and use a single led on the enclosure to display the temperature. I have most of the sketch logic knocked out, but need help with sharing the project.
If I gave this project to someone, they would need to update the sketch to include their wifi name and password, as well as the zip code where they live.
Is there a way I can do this without using the arduino ide? A use case for this would be: the user plugs the arduino into their machine, the gui loads, the user would enter variables, and then the board would get flashed with the new variables.
Is this a pie in the sky proposition, or something that could be implemented?
Thanks for your input.
-
1Without the IDE? Store the variables in eeprom and then flash just the eeprom maybe??RubberDuck– RubberDuck2017年12月30日 00:15:03 +00:00Commented Dec 30, 2017 at 0:15
-
@jsotola thanks for pointing out the typo. Do you have any suggestions or ideas on how to implement a solution?KidaStl– KidaStl2017年12月30日 03:41:53 +00:00Commented Dec 30, 2017 at 3:41
-
some kind of a script that generates the necessary eeprom image file and then calls avrdude in order to transfer the image file to arduino's eeprom .... but i would go with the answer from @per1234jsotola– jsotola2017年12月30日 05:23:50 +00:00Commented Dec 30, 2017 at 5:23
-
what are you using for the wifi module??jsotola– jsotola2017年12月30日 05:26:51 +00:00Commented Dec 30, 2017 at 5:26
-
if you are using something like an ESP8266, then it is possible that you do not need the arduino at all.jsotola– jsotola2017年12月30日 05:41:47 +00:00Commented Dec 30, 2017 at 5:41
1 Answer 1
The common way to do this is to build the configuration UI into your program. Then the user has no need to be messing with the firmware.
Since your device has WiFi this can easily be done by serving a configuration web page that is loaded in the browser. But how can you make a connection before the credentials for the WiFi router have been configured? The answer is for the device to serve as an access point (AP). So you connect a computer with WiFi to the device's AP, open the configuration page in the browser on that computer, and then configure the credentials as well as any other configurations you might like.
The configuration parameters are written to EEPROM so that they will be preserved.
In its most simple form there would be a specific IP address that must be opened in the browser but more user friendly is to create a captive portal so that after connecting to the AP any URL opened in the browser will load the configuration page.
Of course all this will increase the memory usage of your program and apparently you are using the Arduino Uno so this is fairly scarce to begin with. You'll need to determine whether there is enough extra memory for it.
-
I had wondered if having a configuration UI on a web page would be a possible solution. I think your answer should give me enough information to do some research. Thanks.KidaStl– KidaStl2017年12月30日 04:20:03 +00:00Commented Dec 30, 2017 at 4:20