I want to give my project a simple web gui to change config options. I know I could get a shield and write some horrible html in c but I'm wondering if there is a better way. Is there another IC I could get to help with this? What's the recommended solution for an embedded web server?
You can buy an ethernet shield of any kind, ENC28J60, wifi module etc etc, and NOT do the html on the chip, just set it up as a server (usually specific the the shield/module you use). Then you can actually create a local html file on your computer, or even use any webserver on your network or even online. As long as you send the commands to the local address of your arduino. So if your Arduino ethernet module has the IP-address: 192.168.1.123 then the following form will send a command to the arduino that you can handle in the arduino code:
So if you create a simple web form to send a command to the arduino you can put this page anywhere, as long as the action is pointing at your arduino IP-address. If you want to go into the whole jquery standard it might be a bit different, unsure how asyncronious submits are handled. I want to point out that IF you put your simple html page online you dont need to and SHOULDNT open anything in your firewall or router. The code will work as long as the device you are accessing the page from is on the same network as your arduino. |
||||
|
I personally find that one of the simplest solutions to a web server is one of the two following options.
|
|||
|
I'm currently using the ESP8266 modules. They are available for little money on eBay and the like and they provide a pretty nice Wifi-Module. You can even (and I would recommend that) be programmed by the Arduino IDE using some clever core that a few people built here: https://github.com/esp8266/Arduino Using that you got a Wifi-Server built into the delivered Libraries that can provide basic functions. It can also output files from an SD card if available, there is an example for that. Aside from that the module has a lot of Flash and you might not even need the Arduino if you don't need a lot of I/O, if you need a lot of I/O then you might want to communicate across a serial link. You will need to make sure to lower the voltage for the ESP, either use a 3.3V Arduino or build a level converter between the Arduino and the ESP, like this: http://www.hobbytronics.co.uk/mosfet-voltage-level-converter It's not as easy as using a Wifi-Shield but it's very cheap to use. |
|||
|
GENERAL IDEA: I would recommend getting a simple Wi-Fi and/or Ethernet module. Then simply set up routes to receive and send data to Arduino (assuming Receive data from Arduino:
Send data to Arduino:
Now use any Web development Framework/Language ( NO ADDITIONAL MODULES SOLUTION: The above method will allow the arduino and server to communicate if they're on the same network. However, if you can constrain the server to be connected by ANOTHER SOLUTION: Add a Raspberry Pi, have it connected to Arduino by USB (Arduino's |
||||
|