Sign up ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

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?

share|improve this question

4 Answers 4

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:

<form action="http://192.168.1.123/acommand=1">
<input type="submit" value="click to send command">
</form>

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.

share|improve this answer

I personally find that one of the simplest solutions to a web server is one of the two following options.

  1. Buy a serial cable, and transmit data using the Serial port on your Arduino. You can transmit data to a PC, and use PHP to read the serial port and display the data you would like.

  2. Buy a Raspberry Pi. You will be doing the same as step 1, however you don't need a serial cable to use serial between Pi and Arduino. However you might need a 3.3V / 5V converter, which depends if the arduino serial port outputs data at 3.3V or 5V.

share|improve this answer

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.

share|improve this answer

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 arduino_ip to be your Arduino's IP), and GET and POST being HTTP verbs:

Receive data from Arduino:

GET http://arduino_ip/data

Send data to Arduino:

POST http://arduino_ip/data

Now use any Web development Framework/Language (PHP, Node.js, Python) to receive and send data.

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 USB to Arduino, you can use Node.js, Python (even PHP) to directly communicate to Arduino.

ANOTHER SOLUTION:

Add a Raspberry Pi, have it connected to Arduino by USB (Arduino's Serial), and the use Raspberry's Ethernet to bring in networking (Raspberry Pi can host a server itself)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.