Realworld uses of Arduino as web server

What sorts of things are you guys and gals using Arduino web servers for, in real life?

I'm guessing remote monitoring and switching? Mostly domestic I expect? Aquaria, heating / cooling, security....

What clients are typical?- PC / laptop browsers, smartphones? Any roll-your-own? Other Arduina as clients?

Hi,

I am a bit surprised that nobody answered this post yet. I was thinking that there should be a good interest around Arduino on the Net, so I expected some reaction. Anyway, here is my 2c.

I have implemented a web server on Arduino MEGA, whose main task is management of a 3D printer that I am trying to build from scratch (design, mechanics, hardware, software), based on selective laser sintering (SLS) technology. Just for fun, nothing professional!

The web server, in my case, is ideal for implementing a web-based, SCADA-like user interface to the printer, based on static and dynamic pages with HTML, CSS and JavaScript/jQuery. There are pages for uploading the printing program (sort of reduced G-Code) to the SD card and other pages for real-time monitoring and regulation of all operational parameters via AJAX. I also plan to include a user manual as a set of pages with text, images, drawings and also interactive tutorials stored on the SD card and accessible from the browser.

The project itself is not complete yet, I am working on it on spare time, but is challanging and cool.

Thanks for asking,
eca

Thanks Enrico.

Maybe nobody uses it for real, just (like me, so far) to fiddle around......

I tried it as a web server, but found the challenges presented when the Arduino was behind a router firewall/nat was too difficult to overcome, and exposed to the internet the Arduino doesn't have very good security. I now use a UDP client sketch on the Arduino with an Apache (LAMP) server doing the "translating" to the internet.

I am a bit surprised that nobody answered this post yet. I was thinking that there should be a good interest around Arduino on the Net, so I expected some reaction.

Well, the question is somewhat of a "chat room" question which may not generate a lot of technical interest. Scanning the topics in this discussion group, the projects group, home automation group, robotics group, and the gallery area should provide some ideas of what people are working on.

I now use a UDP client sketch on the Arduino with an Apache (LAMP) server doing the "translating" to the internet.

As far as I understand, the idea of decoupling Arduino from the Internet using a LAMP configuration is an excellent compromise between full exposure and total isolation.

To cope with security and workload problems, some times ago I was thinking of a FastCGI interface library for Arduino, so as to use it behind Apache or lighttpd. In my idea, this solution would have avoided many security and connection problems while leveraging the connectivity potential of the Ethernet shield. I posted a question on possible interest for the matter, but the topic did not rise any interest in the community, so I gave up.

In my application of Arduino MEGA as web server I use it only connected to a local network. Another possible, yet future solution I am considering with some interest is Arduino Tre with node.js. Not yet possible but very intriguing.

Cheers,
eca

As far as I understand, the idea of decoupling Arduino from the Internet using a LAMP configuration is an excellent compromise between full exposure and total isolation.

You seem to understand correctly. The advantage is the LAMP server has the resources available to implement security, and the two-way UDP protocol I use allows the Arduino to be behind most routers without any mods to the router setup without compromising the Arduino security. If remote DNS and NTP works on the localnet, my code will.

I have retired the Arduino from being any form of web server.

After an initial tinker with the 'WebDuino' library I then played around with having the Ardiuno push data up to host server and also as publisher to PuNub, but now am getting ready to make my next move.
The other day I received in my mailbox a cute little 'Cubieboard 2', dual core ARM A20 processor that when I get time will be setup as my front end, low power home based server.

The EtherMega will simply exchange data with the Cubieboard via coms or ethernet.
This way, the Arduino can do what it does best better, and deal with real world IO.
The Cubieboard will be setup as a Linux server and configured to handle the real-time aspect of HTTP and TCP/IP connections from the big bad world. Not sure I'll use LAMP yet though.

Then I can really go to town and develop a SCADA system, yes.

The Arduino platform still is a valid choice but I haven't considered it seriously for any industrial automation work I sometimes find myself doing.
Arduino has been a stone for me to stand on for a little while I played and learnt some things.


Paul

@rockwallaby: My next LAMP server will be a Raspberry Pi. The Cubieboard 2 is a Debian-type OS, so you will be using a LAMP server also, even if you may not use the MySQL part.

Hi SurferTim,
Yes, Cubieboard is Debian or for other fun, they can play Android nicely as well.
Though I am wanting to find out what the chances are of running Node.JS and if that would offer any advantages over ye' old Apache. My SQL databases grow each day, as long as I feed them 8)
More learning I dare say in the weeks to come.


Paul

SurferTim:
I tried it as a web server, but found the challenges presented when the Arduino was behind a router firewall/nat was too difficult to overcome, and exposed to the internet the Arduino doesn't have very good security. I now use a UDP client sketch on the Arduino with an Apache (LAMP) server doing the "translating" to the internet.

Same idea here. Using it as a sole web server has many challenges. I use it as a web server, but instead of connecting directly I use a LAMP setup to send http requests and it responds with xml data. Using this setup I can control multiple arduino projects from one web page. Makes for sort of a central management system.

JimboZA:
What sorts of things are you guys and gals using Arduino web servers for, in real life?

I'm guessing remote monitoring and switching? Mostly domestic I expect? Aquaria, heating / cooling, security....

What clients are typical?- PC / laptop browsers, smartphones? Any roll-your-own? Other Arduina as clients?

I am using an Ethermega Arduino compatible card to use the web server as the user interface to a home automation system. You can browse it at http://219.88.69.69/2WG/.

On my card I am using the SD card functionality to log all system activity. If you browse the system you will be able to browse the SD card directory structure - but security controls should prevent you opening any of the files.

I use client IP addresses to control one level of functionality/access (some things I can do on my secure WIFI LAN without login) and a password login for another level.

Primarily the system as currently built is a climate monitoring system but I can also open my garage door via the browser interface from anywhere. The system has one PIR detector installed (first of several) and operates as an alarm system with push email messages to my iphone when intruders are detected.

I have the system and my broadband modem in a cupboard (lock to be installed) on a UPS so that it runs continuously even when the power is off. Hopefully it is reasonably immune to tampering by intruders.

Later on I hope to extend the system to other device controlling.

I am happy to respond to questions from anyone who looks at the system and will be happy to share much of the code.

Cheers

Catweazle NZ

I feel pretty lucky stumbling into this forum, having written or at least modified my first program about a month ago. But I now have my webserver running locally and it serves up Battery voltage, Mains state, and sump level. Considering the time I have spent just to get this far, I know you must have spent a lot more to get that great system together. If you would consider giving a noob a bit of boost up, this looks exactly like I envisioned mine.

CatweazleNZ:
...
I use client IP addresses to control one level of functionality/access (some things I can do on my secure WIFI LAN without login) and a password login for another level.

...

I have the system and my broadband modem in a cupboard (lock to be installed) on a UPS so that it runs continuously even when the power is off. Hopefully it is reasonably immune to tampering by intruders.

...

I am happy to respond to questions from anyone who looks at the system and will be happy to share much of the code.

Cheers

Catweazle NZ

Any way's it's a good thing your password is not 1234 :wink:

Any ways WOW. Great system. I am guessing you have 2 sensors on your garage door?

Frédéric_Plante:
Any way's it's a good thing your password is not 1234 :wink:

Any ways WOW. Great system. I am guessing you have 2 sensors on your garage door?

This would be you then:

9:45:47 GET /17823/ HTTP/1.1 (24.114.96.88) [17823]
19:45:47 HOST 219.88.69.69
19:45:59 GET /40198/ HTTP/1.1 (24.114.96.88) [40198]
19:45:59 HOST 219.88.69.69
19:46:07 POST /10265/ HTTP/1.1 (24.114.96.88) [10265]
19:46:07 HOST 219.88.69.69
19:46:07 PASSWORD NOK
19:52:17 GET /2WG/ HTTP/1.1 (24.114.96.88) [43943]
19:52:17 HOST 219.88.69.69
19:52:41 GET /43034/ HTTP/1.1 (24.114.96.88) [43034]
19:52:41 HOST 219.88.69.69
19:53:05 GET /43039/ HTTP/1.1 (24.114.96.88) [43039]
19:53:05 HOST 219.88.69.69
19:53:13 GET /ACTIVITY.DIR/ HTTP/1.1 (24.114.96.88) [/SDCard//ACTIVITY/]
19:53:13 HOST 219.88.69.69
19:53:29 GET /2790/ HTTP/1.1 (24.114.96.88) [2790]
19:53:29 HOST 219.88.69.69
19:53:49 GET /19017/ HTTP/1.1 (24.114.96.88) [19017]
19:53:49 HOST 219.88.69.69
19:53:56 GET /46011/ HTTP/1.1 (24.114.96.88) [46011]
19:53:56 HOST 219.88.69.69

That IP address maps to Quebec.

Yes - two sensors - one that detects the door fully closed, one that detects the door fully open. If both are HIGH or LOW then the system generates iphone push email alerts of an error condition. (Both LOW is OK for 15 seconds while the door is opening.)

Also two wires off a relay to open/close the door and another two wires to drive a 5V buzzer when the door is moving and before it moves when automatically closing.

Cheers

Catweazle NZ

How do you get the IP address of an incoming?

JimboZA:
How do you get the IP address of an incoming?

byte l_rip[] = { 0,0,0,0 };
G_EthernetClient.getRemoteIP(l_rip);

If the first three bytes match your WIFI/Local LAN then the client is logged in locally and you can relax the security.

You can double check that the user is local by extracting the HOST value from the html request. If the HOST value is your external IP address then the user is likely external and has come through your broadband router which has forwarded the html request to your Arduino board.

By recording the IP addresses of failed html requests (e.g. invalid hacker URLs, multiple failed password attempts) you can ban the ip address simply by ignoring it for all future html requests - valid and invalid.

Cheers

Catweazle NZ

The Ethernet.getRemoteIP() function is not in the standard ethernet library. It requires a library code modification.
http://forum.arduino.cc/index.php/topic,135082.0.html

Does your entire server reside on the arduino? My ISP provider has some space where I can host a webpage which I have just done. I had thought that it would be most efficient to somehow push data to this webpage, but whatever method you are using seems to work just fine. Could you explain briefly how you do it, just to get me pointed in the right direction.

Pizzanova:
Does your entire server reside on the arduino? My ISP provider has some space where I can host a webpage which I have just done. I had thought that it would be most efficient to somehow push data to this webpage, but whatever method you are using seems to work just fine. Could you explain briefly how you do it, just to get me pointed in the right direction.

Yes - my Ethermega card is the web server. It receives client html requests from the local WIFI LAN and WWW, parses them to determine what is required and then dynamically generates and transmits html pages according to the html (http: URL) request.

I have a fixed external IP address of 219.88.69.69 with my ISP which allows me to access the system from the WWW. I could buy and link a website name but that is not necessary.

My broadband router is a DHCP server and assigns the Ethermega card a fixed IP address based on the mac address that my program code assigns to the Ethermega card. (UDP NTP does not seem to work if you assign the Ethermega's fixed IP address within your program/sketch code.) My broadband modem also uses port forwarding to send external WWW port 80 http traffic (html requests) to the fixed IP address of the Ethermega card.

For the underlying core technologies (ethernet, UDP NTP, email, SD card, etc) I started with Arduino example programs. I studied them carefully and then modified them according to my needs. Other application functionality was built from scratch based on my extensive software development background.

It started my project on 15th August and has about 6,000 lines of code. This will give you some idea of the development effort. There is no brief explanation.

Catweazle NZ