To run a webserver on the University network, change the PORT=80 of the web server to something over 1024. Most routers will leave ports over 1024 alone.
For example:
If you use port=1234
and the web server IP address was 192.168.1.100,
Then the URL would be: http://192.168.1.100:1234
The :1234 on the end overrides the default port=80 in your browser.
I don't think that would work, unfortunately. :-/ If the router does NATing, how will the router know which computer on the internal network it should forward the connection to?
I really like the idea of using e-mail like this, but only for alerts or for having regular updates sent to you. For controlling stuff, you'd be much better off if you could get rid of the need to poll info like that.
The only solution I see is this: If you have some programming skills as well as access to a computer on the internet, you could make a server application on that server. Then, you get your laptop to establish a connection to the server (inside -> outside will work) and keep the connection up. If the connection is lost, the laptop tries to re-establish the connection every minute or something.
The server-app would also need to listen to a second port, to accept commands from a frontend written in php (or some other web scripting language with socket support). So..
Laptop:
- Laptop connects to server
- Keep connection alive, while redirecting any incoming traffic to the Arduino
- If connection is broken, wait a minute and retry point 1.
Server:
- Listen for connections from two ports above 1024 (one for the laptop, one for the web-frontend)
- Relay all data from web-frontend -> laptop -> Arduino.
Web-frontend:
- Display graphical stuff of choice, with links going to something like backend.php?data=stuffyouwanttosend.
- backend.php gets data, connects to Server, sends, and redirects the user back to the web-frontend.
If course, this has an important flaw, namely the Arduino's inability to send data to the front-end. This is easily remedied by writing another php-script and hosting it with the web-frontend, let's call it log.php. You add an Internet Explorer control to the VB program running on your laptop, and whenever the Arduino sends data, you do an
InternetExplorer.Navigate "http://frontendaddress.com/log.php?data=" + data$
Log.php formats and logs the data and stores it in a file or a database, so that the web-frontend can retrieve it and display graphs, history, current temp/light/etc.
Now for project ideas...
- I made my Arduino send NEC IR signals to control my tv a while back. Web remote control goes pretty well with my girlfriends new WiFi-enabled cellphone, and can with a little effort be extended to control our dvd-player and other IR-controlled equipment as well.
- (I also have some vague plans of combining the IR-remote with data pulled from a web tv-guide, so I can "schedule" stuff I really want to see and when it begins, the Arduino+pc sets the right channel)
- Place simple switches in your doors and log when they are opened and closed (used this to bust my little sis in sneaking around my room back when I lived with my mom ::)).
- How about temperature and light logging?
- Control of media playback. It doesn't really involve the Arduino but it goes well with the whole tv-control system. Have a computer connected to your tv, make the ir-remote set the tv to the right channel, launch the right movie on media-computer. Not sure how you'd want to do this.. Perhaps a VB program using either WMP or vlc components, or simply reading up on vlc's telnet/socket control function.