Sheepdog Software HOME

ArduServer / FarWatchWatchers

Serving web pages and raw TCP/IP with Arduinos.
Input and output across a LAN or the internet.
Remote Sensing. Internet of Things.

This is a "new" (3/19) homepage for my information about Arduservers, FarWatchWatcher, and related matters. There is an "archive version" of what was here before... in all it's... glory(?) (gory). It had got somewhat out of control!

If you are not familiar with the sensor reading "FarWatch" system, the best place to start may be a new FarWatch, FarWatchWatcher, Arduserver-for-FarWatch page I wrote at the end of February 2023... It was a fresh attempt, and did a better... and shorter!... job, I think.

Use this to skip to note about 'https://bit.ly/InfoByPcID' if that's what you are here for.



  Arduserver? (overview)

An "Arduserver" is any small, inexpensive device that can have sensors and outputs to local electronics, and can be connected to the internet so that people can see what the sensors see and/or alter the state of the outputs of the Arduserver... from anywhere in the world!

Arduserver, because the first one was in an Arduino. Since then, I've made Arduservers in Arduino-IDE-programmable Teensys and ESP8266s... but as long as your device meets the criteria in the first paragraph, by all means- call it an "Arduserver" with my blessing!

I have released code for creating many Arduservers over the years.


(Current!) latest and greatest!...

Free sourcecode and discussion of Arduserver 'ar202', May 23

Forgive me, but I am rather pleased with ar202. Sadly, the supporting webpage is little sparse. But! AR202 is merely an refinement and extension of the first one mentioned in the "Previous incarnations" section below, the one created Feb 23. Most of what you see on that page applies to ar202 as well. Not using the extra features of ar202 won't "cost" you anything, and ar202 performs the old tasks BETTER.




Previous incarnations...

ALMOST "Latest and greatest" at 5/23: created Feb 2023. Predecseeor of ar202, and reading this might help you understand details of ar202. (202 is a big upgrade of this one.) Parts cost about $40. It is built in an Adafruit Feather Huzzah. Full discussion, and sourcecode, for my Huzzah Arduserver, with two temperature/humidity sensors... and a monitored digital input.

At 3/19, the "bigger and better" Arduserver (source code supplied) is in a Sparkfun ESP8266 Thing Dev. (Sparkfun "ESP8266 Thing- Dev"... Cost: $18 (plus p&p, March 2019 (Up $1 from Oct 17... Trump's trade war with China made electronics more expensive.))



New 8/21, Just too cool? The image is of an rather hastily named Arduserver I'm calling the "ArduHuzzahI2C-One". (The white thing... breadboard... is 5 x 80 mm. This new Arduserver can read (and provide to all of the internet) the readings from two temperature/ relative humidity sensors (think "indoors"/"outdoors", perhaps). (Adafruit HTU31D breakouts, $6 (each) 8/21) Likely would run in a Sparkfun "Thing". Certainly works in an Adafruit Huzzah ESP8266 ($17 8/21)... but get this: Ttures: ±0.2°C from -0~100°C, Humidities: ±2% at 20% to 100% relative humidity, at a temperature range of 0 to 70°C. Do you know what a thermometer with that resolution and range would cost?! One drag: The wires can't be very long.

A very limited web page has been done about it.

I must thank Rui Santos for his BRILLIANT code, illustrating an 8266 with a different I2C sensor's routines and web-serving software running together nicely.



----------------------------
  (Details of the various Arduservers... except the 8/21 one, sorry.... below - This was just an overview.)



Online ArduServer demos-

Want to see one in action? The following page describes specific servers which are usually online for you, and has links to them. Directory of online ArduServers.



  It gets better! FarWatchWatchers... (overview)

Arduservers are hardware. (Running software explained in these pages.) Set up an Arduino someplace you care about, but aren't always able to be at... and "visit" any time you like to check anything you can connect a sensor to an Arduino for.)

But you have to remember to go, check.

Or, set up an Arduserver, maybe just across your LAN, watching anything that interests you... the water temperature and light levels in your fish tank?

I also offer software which will automatically fetch the readings of the sensors offered by the Arduservers. And plot a graph. And record the data to a file on your hard drive. Free. (But it runs under Windows. Sorry.)

I call that software "FarWatchWatcher".

Some FarWatchWatchers can sound an alarm if, say, the temperature the Arduserver is watching falls below a certain level.

"FarWatch" (a system of hardware and software) was a precursor of the Arduserver project. That goes back to about 1982... it has had a few design refinements and bug fixes over the years. For some things it is still better than the Arduserver line... but it is a lot more work to set up, and needs a "proper" PC in which to run... so expensive, too. I do have a page with an entry page for FarWatch, though, for the interested.

  (Details below - This was just an overview.)



  Related matters... (overview)

First for this section: Some warnings. If you "go out" on the internet, there are dangers.

---
A different product: not quite an Arduserver... it can't be accessed with a web browser. Not "just" a FarWatchWatcher. But the ArduSimpSrv achieves the same ends as an Arduserver + FarWatchWatcher... by a different route.

---
Pre-requisite knowledge: If you want to start serving web pages, there are a number of general skills you will need before you will have an Arduserver "visible" to the world. (And beyond.)

  (Details below - This was just an overview.)



The Details


  Arduservers- Details...

A minor point: In the overview, I provided a link to the Sparkfun ESP8266. Experts on the ESP8266 often criticize my fondness for that particular ESP8266... but for novices, it has much to recommend it.

December 2016 Arduserver in an ESP8266

Arduserver in an ESP8266!

(What I said, December 2016. My enthusiasm hasn't waned since.)...

Too cool! There is now a little micro-processor-with-WiFi which can "do" all of the basic Arduserver stuff... and only cost you $16!! ($18 by March 2019... but Trump's trade war has increased cost of electronic devices coming out of China.) You'll have to add a few resistors and a light sensor. Big deal. All the Arduservers need them. You DON'T have to supply an internet controllable LED. There's one on the board. The general, provided- by- the- experts demo program for creating a web-server only needed minor tweaking to make an Arduserver out of the device.

(Still: Comments from December 2016) It has been around for a while, even the specific "complete product" which has me all excited, built around the Wonder Chip that makes it all possible, the ESP8266.

Some time before 12/2016, Sparkfun created what they call the ESP8266 Thing. (It comes in two versions. Both $16 in 2016, $18 March 2019. I opted for the "Dev Board" version.)

(More comments from December 2016)... It isn't "an Arduino", but, with one of the increasingly common "add on" packages, you can use the basic Arduino IDE to program the Thing. I've used such add-on packages without grief.

(More comments from December 2016)... And, oh by the way, it runs at EIGHTY megahertz! (An Arduino Pro Mini runs at 8 or 16 megahertz, depending on the voltage variant you are using.

Use the link at the top of this section for all the software, etc, to create an Arduserver in an ESP8266, including an explanation of how to use an ESP8266 for an Arduserver. That Arduserver uses slightly different commands to turn the LED on or off, and there's a separate command to read the value on the analog input, but the basic "ArduServer" features are there. The code also includes software to read a 1-Wire temperature sensor. (I've tested it with a DS18B20. It "should" also work with DS18S20 or DS1822.)

Oh.. and it does crude "pulse counting"... adequate for a wind speed sensor.

The web-page generated by that Arduserver is suitable for FarWatchWatcher.

Besides the Arduserver software, which you pretty well have to figure out for yourself... I provide the code, but not a lot in the way of tutorial... I wrote, back in 2016, more for you about the Sparkfun Thing will be found on my dedicated page.

N.B.: The analog input to the Thing should not be subjected to more than 1.0 volts. Not a deal breaker, but you'll have to set the light sensor up accordingly.

(End of section about "December 2016 Arduserver in an ESP8266"

Details of older Arduservers languish in the as- yet- un- weeded material below, on the beige background.



  FarWatchWatchers- Details...

Two new FarWatchWatchers, January 2019

A new version of FarWatchWatcher, to go with the software I created for my 8266 Arduserver... or with the IOT device of your choice, if you can insert a line into the output the IOT device produces. (That software would "fit" in other IP/TCP capable Arduinos, too.)

The 8266 Arduserver isn't new, and most of the code for it would run in any IP/TCP capable Arduino. But I hadn't given you a like to its page before now.

All of the various "FarWatchWatcher" applications let you gather data from IOT devices and use the data. "Gather" across your LAN (easy) or the internet, depending on how widely visible your IOT device is. Most will build graphs of the data in real time. Most will save the data gathered in a machine readable file.

This version of the Arduserver lets you use the 8266's internal counters (2), and reports what they have got to in the webpage... both in human friendly, and in machine friendly forms.

Let me mention a reason for wanting a counter! If you are using electronics to supervise something, sometimes it is hard to achieve a sufficiently high polling rate to "see" some transient events. My pulse train trick, which needs a counter, is a neat solution to the problem.

Details of older FarWatchWatchers languish in the as- yet- un weeded material below, on the beige background. For a time, I started to use the name "ArduserverWatcher", but now I am moving towards FarWatchWatcher for all of my "watchers".



  Related matters- Details...

Be careful

A wise person once said "If you want to be safe, do nothing."

I want to do something, so I've given up being completely safe... but I try to avoid being reckless.

(Another saying for you, from the world of aviation: "There are old pilots, and there are bold pilots. But there are no old bold pilots.")

Putting a server on your LAN creates new ways for things to go wrong. Putting a server on the internet will, if you aren't careful, give the Bad Guys a way into parts of your system which you don't want them in.

I've written more on the safety aspects of putting a server on your system. I'm afraid I don't have "the answer"... but maybe I can make you aware of some of the questions you need to ask?

---
ArduSimpSrv

The ArduSimpSrv... HTML-less TCP/IP client / server remote sensing.

Going a step further, I have produced Arduino and Windows code for what I call ArduSimpSrv. This is still an Arduino server, but it is not a web server, it is a more Simple S(e)rver. Good because it demands less of the Arduino, leaving space for more code to do things besides communicating with clients. Bad because you will have to adapt the client software I provide, to meet your wants regarding access to your ArduSimpSrv.

The complete code for the ArduSimpServer is on a page of it's own, if you want to "skip to the answer". The tutorial explaining the design and development of the ArduSimpSrv will help you understand what is there.

Despite being "simple", the ArduSimpSrv, like most of the Arduservers, can both accept commands from out on the web, and act on them... i.e. turn Arduino outputs on or off. ("Take it high or low", if you prefer that way of saying the same thing)...

...AND...

... it can, upon request, send a message out across the internet, reporting what it is seeing with a locally attached sensor.

I haven't touched this project in years at March 2019... but it worked well enough when I last "played" with it. It comes from an era when Arduinos were small, and IP/TCP wasn't as well implemented. Probably not "necessary" today. We have better support libraries, and the "big guns" of Teensys and ESP8266s (and bigger Arduinos) to throw at the job. But my pages about it, from back then, remain online, just in case they help you with some project you are working on.

---
Pre-requisite knowledge

I would like to tell you that anyone can create and set up an Arduserver on the internet after reading just a few tutorial pages. (If you just want to use one made by me, you can "just plug it in"... practically!)

I'm afraid, though, that an Arduserver is a full blown web server. No webserver can "just be plugged in" to a LAN, let alone to a LAN in a way that makes it (safely) visible from anywhere on the internet.

If you haven't already learned "all about" the basic elements of putting anything on the internet, I invite you to the series of pages I've written for you. (The early pages in that series take you through the less complicated issues of getting a server visible inside your LAN... a necessary first step.)

If you haven't worked much with IP addresses, DDNS, ports, servers: Scan the next few paragraphs, and the list, say to yourself "That sounds fun"... and then go off to the pages about putting things on the internet. You will thank me, in the long run! Or waste a lot of time learning the ropes the hard way, as I did... gathering "scraps" of knowledge in the wrong order!

Connecting to the internet: I have written tutorial pages about IP addresses, the DNS, dynamic addresses, etc., several times! The set of pages I mentioned a moment ago is my "latest and greatest" at March 2019. However, an earlier guide to TCP/IP stuff may be more to your taste. (If you happen to read both, I'd be interested in your views.) Both try to help you understand how to set a server up on a LAN/ And then to do the additional steps to make the same system serve to the internet. There are also many details in various pages about my different ArduServers and ArduSimpSrv... and in my FarWatch pages. The sorts of things you will find out about are....

Yes... you have some work ahead of you. But it isn't insurmountable!



What is "https://bit.ly/InfoByPcID"?


Some of the Arduservers and FarWatchWatchers generate references to https://bit.ly/InfoByPcID

That takes you to https://wywtk.com/fw/du/by-pc-id.htm. (If you'd rather go to by-pc-id.htm over a secure connection, I applaud your carefulness. I messed up while making the bit.ly. Sigh.)

In any case, the purpose of by-pc-id.htm is to give you information about what the different Arduservers are serving up. Each Arduserver has a unique ID. They usually start "ICH" or "ICT". You should be able to get that from the graph created by an FWW app which you are using to view the , or out of the page served. (At 8/21, very few Arduservers have the latter feature.)

Why the layers on layers?

Think about it. Each Arduserver is in a different place, it's sensors exposed to different environments.

So what the numbers served up "mean" different things. One might be the temperature in an attic, expressed in degrees Fahrenheit. Another might be the temperature in a kitchen, in degrees Celsius.

They almost always arrive as mere numbers. Sometimes even with arcane units, to avoid the nuisance of fractions. (For instance, 234 might be sent when the temperature is 23.4)

So you need some sort of guide.

There are already Aruservers out there which are running identical software with identical arrays of sensors. The "what is this sensor showing" can't be put "into" the Arduserver easily... unless you want the overhead, and opportunity for trouble that having "variations" of the SERVER software to manage this.

But if somewhere "external" you can look up "what Arduserver is operating from [a given URL]", and "where (geographically) is it", and "what are the sensors reading" and "how were the numbers encoded", then you have everything you need, as a user, don't you? Within a system that the admin can manage robustly.

(I'm quite pleased that my little gray cells managed to come up with this neat solution. It is actually elegantly simple and reliable, in comparison to any other system I've thought of so far for dealing with the matters it resolves.)

Your thoughts, as always, welcome... even appreciated!



A little digression...


Sorry, folks... I couldn't resist! I hope you find this widget as cool as I do. Play with it... See what happens when you drag on it with your mouse. You can easily add one to your site, free. Just visit www.revolvermaps.com. You have many options on the widget design page, which is a paragon of user-friendliness. At one point, you can track individual pages or page sets... I'm not sure that "page sets" is still supported.

But! Great news! In "the very old days" (before 10/17) Revolvermaps were Flash based. They have used Javascript since before that. You can update old scripts to new ones without losing old visitor data. The code is not HTML 5 compliant, but validates under 4.01 Transitional.

A RevolverMap also gives you access to lists of what countries you were visited from. More at my page for web page authors. On modest devices... Kindles and iPads, for instance... you won't see the revolving globe that others see, but you still see something. (Don't you?)

If you are prepared to give up the space required for the RevolverMap in the HTML for the page served by your Arduino, you can even have one on your Arduino-served-page. This is demonstrated in the ArduServer2. The original ArduServer, running as it does in very limited hardware, does not have the space to run a RevolverMap. <;-;>






Below here... still undergoing "weeding"... sorry. Please write and complain if you find things below that you wished had been above here, not down in the "bargains basement".
(There is also "weeded" stuff in the footer than you might want.)

Overview...

The Arduino is a hobbyist-friendly microprocessor. For $10 you can own a computer more capable than the one on-board the Apollo spacecraft. And the software to program it costs nothing.

An ArduServer (my term) is a web server built in an Arduino. The only client software you require is an ordinary web browser, e.g. Firefox.

Some of the demo servers described in these pages feature an LED and a light sensor. With an ArduServer you only need a browser to turn the LED on or off, and you can "see" what the light sensor sees... from anywhere in the world! (Latest, greatest Arduserver (Esp8266 based) costs $20. See "New December 2016", below. (An "expensive" ESP8266 costs $15. I added $5 for a few discretes.)

The LEDs and light sensors are just "stand ins" for whatever effectors and sensors you want to access across a LAN, or across the internet.

Some of the other Arduserver described here are mainly intended post readings from sensors attached to the Arduserver to the internet, for use from anywhere.

And then there's the ArduSimpSrv (my term). It is easier to make... so the Arduino is not as "stressed" by the serving, and thus more other things can be done in it than if the Arduino has to be a web server. It also has an LED and light sensor, again as "stand ins". But an ArduSimpSrv needs "bespoke" client software. I provide some for Windows, and would be very happy to provide publicity for an equivalent program for Linux. (See my ArduSimpSrv page for details.)

If parts of this page seem "dated", well, maybe they are! But I hope that they will reassure you that the idea of an Arduserver has stood the test of time!?

Today, you can build one more easily than the early ones were built. For the same money, you will have more power. Or build one for less than $20. Imagine having a simple computer for $20, not so long ago. Let alone a webserver.

There were already ways to do a minimal Arduserver quite inexpensively in October 2017 when I am gave this page an overhaul.Now, in February 2019, what we had in 2017 seems crude.

Today? I would "go with" the ESP8266 "answer". That means using a wireless connection to your LAN, which I don't particularly like, and it would mean "installing" the support material for the ESP8266 in your Arduino IDE, which you may be reluctant to do. Fair enough (!)... but, although I was reluctant to do that sort of thing long ago, I've done it numerous times since without regrets. But, even with a "poor" and "expensive" ESP8266 (from Sparkfun... which is what I would do, for reasons explained elsewhere), it would be $17 (plus p&p, Oct 17)

(By the way: If you have added boards, such as the 8266, to your Arduino IDE's capabilities, remember: It is best to set the IDE for the sort of board you are going to work with "today" before connecting the Arduino to your development system.)

If I didn't want to go the ESP8266/ wireless route? Though I haven't tried it, I would be very surprised if the following wouldn't support an Arduserver well...

Ummm... as I started researching this, October 2017, I found that wired alternatives seem to be falling out of the marketplace! Bah, humbug! But you can find them... but be prepared for having to dig around a bit. Sorry!

On option: the Arduino of your choice, connected to an Arduino Ethernet Shield 2. Sparkfun sell them as their "DEV-11166". ($25, Feb 1019. (It was $45, Oct 17) Plus p&p). Sparkfun won't be your cheapest option.. but they are reliable, and give you support. (Something nominally similar was on sale, eBay, for $5!) Speaking of "support", note, for instance, the information about the "Arduino.cc"/"Arduino.org" "war" which was causing nuisance for people using this shield in Oct 17.

The Teensy, which I HAVE used, details below, allows you a WizNet820 wired connection to the LAN... (£36 (plus p&p, Oct 17) from HobbyTronics.co.uk, plus a Teensy. Get the Teensy WIZ820io Ethernet & Micro SD Card Adaptor, which was part of my "£36", too.) but, like the ESP8266, would require an enhanced IDE. As I said... that enhancement is NOT a big deal... and going that route would save you money over the Ethernet Shield+ Arduino route.

Enough about hardware! Moving on...


Specific ArduServers and the ArduSimpSrv-

1) The original "ArduServer" is inexpensive! (But if you don't have a ENC28J60 interface already, skip over this to the next item, unless you are working on a very tight budget, or curious!)

The original ArduServers was built for $40 with a Microchip ENC28J60 chip on a NuElectronics shield and a ModernDevice RBBB with just a little Atmega168, which has only 16k of storage! (NuElectronics is no longer with us, and for a minimal (but quite adequate!) Arduserver today, you would spend less than $40.

(This page was started in 2011. Please see my "March 2015 ENC28J60 update" page before buying or using one of them! (That page will open in a new tab. Just close it to come back here.))

The RBBBs will take more modern chips, and are, October 2011, supplied with Atmega 328s, your choice of 5v or 3v3 versions. Kits (easy): $13. Kit with USB one-cable/ many Arduinos "BUB": $25.) (You will need a BUB or equivalent with RBBBs and similar.)

Although a Wiznet W5100 interface is probably worth the slightly greater expense, the SheepdogGuides tutorial for the original ArduServer has information on general issues which you may find resolves one or more mysteries for you.

The complete code for the ArduServer, first version, is on a page of it's own, if you want to "skip to the answer". The tutorial explaining the design and development of the ArduServer will help you understand what is there.

2) ArduServer2... I've written notes, with Arduino code, on my second ArduServer, "ArduServer2", but they (at the moment) are intertwined with general ArduServer notes... sorry. I am working on untangling them.

The Arduserver2 is Wiznet W5100 based. (This section was written before I'd "met" the Teensy and Wiz820io. See Arduserver3 (below) for what, Dec 2014, I think is even better than an Uno, etc, and a W5100)

One of the "Wiznet" boards is probably "the way to go" for a beginner... even though it is a little more expensive. I'd avoid the ENC28J60 boards... there's a reason they're cheap!

Taking your first steps into this territory? One answer would have been an Uno + Shield, or the Sparkfun Ethernet Pro ($55, Oct 11 (no SD card carrier)) which gives you the two of them on one PCB, if you are ready to commit "an Arduino" which always has an ethernet shield "attached". (But hat product has been retired. Sigh.) There's also the "official" "Arduino Ethernet", with or without PoE module, as suits your needs. (You can retrofit one). (About $60 , Oct 11, for one without PoE.) www.coolcomponents.co.uk used to offer something nice. And notes. Gone, Oct 17. Then there's the Freetronics EtherTen (was$70... Oct 2011... But "now", October 17: $45!! With micro SD card carrier!)... and it even has a PoE ("Power over Ethernet") option.)

The complete code for the ArduServer2 is on a page of it's own, if you want to "skip to the answer". The tutorial explaining the design and development of the ArduServer will help you understand what is there.

ArduServer2 was retired, still working, November 11th, 2014. It's place on the web was given to...


3) ArduServer3... Built in a Teensy, with a Wiz820io ethernet module.

The complete code for the ArduServer3 is on a page of it's own, if you want to "skip to the answer". The tutorial explaining the design and development of the ArduServer will help you understand what is there. Although I was using a Teensy 3.1, the code should need little, if any, tweaking to work in a regular Arduino.

The code the link above takes you to does work, and has been "tidied up" for reading. It is presented in a web page. Alternatively, the Teensy code I am actually using in Arduserver3 as of early December 2013 is available in the zip file the link will take you to. It hasn't been "prettied up" for reading. But a few odds and ends of the functioning of Arduserver3 have been tidied.

I enjoy the challenge of Making It Work. Writing it all up is less enthralling, and sometimes I wonder if anyone even reads these things. I give away the sourcecode... you don't even have to "register", etc. So it would be NICE if SOMEONE, anyone, would "vote" for the YouTube video, "Like" the Arduserver Facebook page, mention Arduserver in a forum, etc, etc???

Special note applying to Teensies: This is a fairly esoteric issue, so don't let it worry you if you don't want to fuss with it. Every Teensy 3 has a unique Ethernet media access (MAC) address burnt into it. The number will be different on every Teensy 3. It isn't overwritten by the bootloader flashing process. If you want to access this, to ensure that you don't get MAC address conflicts on your LAN (unlikely, unless you have more than one "home made" device on the LAN, but possible, if you are using the "set in code" method used in my ArduServer3 software), see the Teensy MAC address thread at the PJRC forum. Be sure to read past the first post, to see the suggestions for improvements which were given.

Arduserver 3 support circuits:

-

(A small point: I believe that the Wiz820io probably needs about 175mA of 3v3 available to it. So don't try to power it from the 3v3 pin on a Teensy.. at best, that should not be asked to supply more than 100mA. The PJRC.com shield ($6) includes a voltage regulator to power the Wiz820io, from the general 5v supplied to the Teensy.



What next?

With the things you can learn in these tutorials, you are 90% of the way to a system with a web cam or IP cam mounted on a pan and tilt bracket which can be controlled from across the internet! (Arranging to view, across the net, what the camera sees is another matter... which you will have half solved along the way to getting your ArduServer or ArduSimpSrv working.)

That's just one of many, many possibilities. How about a system which allows you to control the setting of your home's thermostat? I'd combine that with your alarm system. When you go out, and set the alarm on your home, it would automatically set the thermostat back to a lower setting. On days when you return home at a fixed time, the Arduino handling the alarm would turn the heat back up ahead of your arrival, just in time for the house to be warm when you arrive. And on other days, a quick visit to a webpage served by the ArduServer in your home could turn the thermostat up in advance of your earlier- than- usual return.

So many ideas... so little time! With the basic tools explained in these tutorials, a whole world of new projects become (almost) trivial.

In March 2013, I had a new burst of energy, and wrote some "new" pages, pulling together many things I've learned about client/ server computing. (The Arduserver is an example of client/ server computing, as are the IP cams I was speaking about a moment ago.) I hope you will find useful my March 2013 pages about client/ server computing. I hope the enthusiastic hobbyist/ student will find them accessible that they (hobbyist/ enthusiast) will not have (undue!) trouble accomplishing the things described in the pages.

STOP PRESS:.. It seems that maybe there's an element of bad advice in some of the pages this leads to.

It may be a bad idea to use any of the following at the same time as a W5100 based shield....

... and D13, but this last one only if you "care" that on the shield it goes to an LED, and from there through a resistor to ground. (This merely parallels the same thing on many Arduino and clone boards... BUT, to digress from the digression, BE AWARE that the software behind "setup()" and "loop()" pulse D13 high briefly before executing whatever you specified in "setup()".)

Of course, I unwittingly used some of those lines in my designs. The designs SEEM to work, but it would be a good idea to take what I've put on those lines and move them elsewhere. I will gradually be revising my designs as follows....

In every case, to modify the software is easy... but you will need to look carefully to see whether what is currently online has been modified or not.

To change the line used for, say, the phototransistor watching the LED in, say, ArduServer2, the line....

client.print("<br>Analog input 0 reads: <b>");
client.print(analogRead(0));

... must be changed to...

client.print("<br>Analog input 1 reads: <b>");
client.print(analogRead(1));

... and you are done! (You'll have to move one wire on your breadboard, too, if you had it wired for the original design.)

(Digression: Is nothing every easy? In 99.0% of my code, such a change would merely have been a matter of changing something like the "const byte bLEDpin=8;" at the start of the program. But in this case, to avoid fighting with... not hard... getting the prompt to identify the channel, I took a shortcut and specified the channel explicitly instead of a global variable. Sigh.)

Sorry! I could have done without this, too! When will the Official Arduino Site have proper documentation of the ethernet shield and library??


Oops. And that's not all. In using arrays, I may have fallen for a dangerous "gotcha". I've written an article about the gotcha for you... Don't use array element, say, 4, if you declared the array with int MyArray[4]. In some ways, I will be pleased if this has happened! It would explain some uncharacteristically flaky behavior from my Arduino programs for IP/TCP. I've never done Arduino work which gave rise to such perplexing crashes, with so little help from "the system", as that connected with the different Arduservers. When they work, they work well. But sometimes a small change to a program leads to dependably weird behavior.





Extensions...

Once you have an Arduserver working, consider the following...

I now offer (see the "weeded" section, above, programs like my FarWatchWatcher.

For a time, I started to use the name "ArduserverWatcher", but now I am moving towards FarWatchWatcher for all of my "watchers".

The FarWatchWathers specifically for the Arduserver are well along. One can plot the data harvested. At least two write the harvested data to a machine readable file, a .csv file, to make it easy to import the data into a spreadsheet or database at your leisure.)

A "better", but less trivial answer would be to have ArduserverWatcher write the data it collects directly to a database. The only impediment to that solution is that you not only need an Arduserver and an ArduserverWatcher, but also something like an always on MySQL server, and the ability to put database access into your ArduserverWatcher code. (The latter should be possible with Lazarus/ Piette's ICS/ MySQL... all free).

The last two requirements are not an insuperable barriers... just "little extras" which may leave you content at the "Arduserver writes to .csv file for eventual integration into database" solution. But the "bigger" solution really is "better". I just wish I had time to implement it myself! So many projects, so little time. Sigh.

xxx

xxx

Below: Some scraps left behind, for now, from efforts to get this page under control in Oct 11! (The effort predating the one before the one of March 19!

(There are search tools, etc., in the page footer, after the scraps.)


ArduServer:

A device for serving a webpage to LAN or internet, using just....

You don't need to leave your "big computer" connected to the Arduino, or switched on, once you've used it to program the Arduino... if your router can handle DynDNS updating.. as many can. (If your's can't, your PC can do the job, but then it will need to be left on.)

For one of the ArduServers presented here, you don't need more than...

All of my Arduservers monitor some inputs of the Arduino, and present information about what has been seen on the webpage served. What input you monitor, what reports you generate are easily modified.

All of my Arduservers allow users of the page served to "issue commands" (by clicking buttons on the webpage returned by the webserver). The Arduino, in response to the command, changes the state of one of its outputs. This behavior can be modified easily, too.

Not because it is useful, but because it is cute, and illustrates everything, in my ArduServer demos, the output turns an LED on or off, and the sensor is a light sensor the LED is up against. So on the web page you can "see" the LED turned on or off.

Solved for you: the problems of overcoming the fact that you probably don't have a static IP address for your internet connection.

Solved for you: how to present data collected from inputs to the Arduino as part of the material on the webpage.

Solved for you: how to put buttons on the webpage which allow people viewing the webpage change the state of outputs from the Arduino. That also works if the computer viewing the page and the Arduino are on the same LAN.



A few words from the sponsors...

Please get in touch if you discover flaws in this page. Please mention the page's URL. (wywtk.com/lut/ldn150inifiles/HTU31-new tut 23222.htm).

If you found this of interest, please mention in forums, give it a Facebook "like", Google "Plus", or whatever. If you want more of this stuff, help!? There's not much point in me writing these things, if no one feels they are of any use.



index sitemap
What's New at the Site Advanced search
Search tool (free) provided by FreeFind... whom I've used since 2002. Happy with it, obviously!

Unlike the clever Google search engine, this one merely looks for the words you type, so....
*    Spell them properly.
*    Don't bother with "How do I get rich?" That will merely return pages with "how", "do", "I"....

Please also note that I have three other sites, and that this search will not include them. They have their own search buttons.

My SheepdogSoftware.co.uk site, where you'll find my main homepage. It has links for other areas, such as education, programming, investing.

My SheepdogGuides.com site.

My site at Arunet.




Contact this page's editor, Tom Boyd. Please cite page in subject line: "shegui Arduserver.com index.htm"




Test for valid HTML

Page has been tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org. It passes in some important ways, but still needs work to fully meet HTML 5 expectations. (If your browser hides your history, you may have to put the page's URL into the validator by hand. Check what page the validator looked at before becoming alarmed by a "not found" or "wrong doctype".)

AND passes... Test for valid CSS


Why does this page cause a script to run? Because of the Google panels, and the code for the search button. Also, I have my web-traffic monitored for me by eXTReMe tracker. They offer a free tracker. If you want to try one, check out their site. Why do I mention the script? Be sure you know all you need to about spyware.

....... P a g e . . . E n d s .....