Networking, Protocols, and Devices
Networking Multiple Sensors
Topic: Networking Multiple Sensors
(Read 449 times)
Networking Multiple Sensors
Mar 26, 2012, 07:50 am
I have just discovered the joys of Arduino and continue to 'get my feet wet' experimenting with the capabilities of the system. I have with the help of the community got a simple temperature, light and humidity sensor working with an Ethernet shield that when you visit a static IP address, it displays the Temperature, Humidity, and Light Level (Analogue). This is a very simple implementation which works well for my home system (running inside a greenhouse monitoring environmental conditions), however i would like to 'step it up a notch'.
What i would really like to do, and part of this is driven by the sort of work i do in commercial buildings. Is be able to connect a device to a network, have it obtain a DHCP address from the network, and then using Bonjour or some other technology, be able to identify the device by a computer plugged into the network, and obtain temperature readings.
I figure this requires two things, firstly the Subnet, Gateway and IP address cannot be hard programmed, as these always change in corporate networks (for example my work address is a xx.xx.42.xx network, so assuming a 192.168.1.x network wont work, nor assuming the default gateway wont work either which is why i was thinking if the device gets the IP address assigned by the network it would solve that problem.
The second thing it would require is some way of knowing (without accessing DHCP servers etc), what the IP address of any device is that is plugged into the network. Apple and others seem to do this very well, and something like Bonjour or similar that could 'discover' arduino networked devices on the network would be fantastic.
Whatever way i program the computer, the idea would be that the PC does a 'scan' or 'search' for devices, which can be connected to that pump out values. On my initial example i was looking at doing temperature, humidity, air pressure and dust. but the dilemma is then how to collect those results. is there a better way to collect them than serving them up on a webpage and having the results be 'pulled' by a PC. Can results be broadcast to everyone and a computer just 'listens'. Would something like SNMP be suitable, especially when later on i may look at adding weird sensors like gas and so on?
Id appreciate anyone's thoughts on how this might be best handled. Ideally those who have done something similar and want to be able to record various parameters when both the server PC, and the client arduino network IP addresses may change.
Thanks everyone for your help!
Re: Networking Multiple Sensors
May 30, 2012, 07:08 pm
: May 30, 2012, 07:14 pm by BernieM
(I hope I'm not hijacking this thread - the two scenarios (the OP's and mine) struck me as similar enough to tack this on here (plus, there being no traffic on the original...).)
I'm in a somewhat similar situation: I have a bunch (unknown number) of devices out on a network that will be reporting data. However, rather than taking the approach of having a server constantly scanning to see what's out there, the approach I'm considering is from a different direction: that when a device comes online, it just starts feeding data to the server. As I do want this to be easy and portable for different locations, DHCP to get a network address seems to make sense. I then looked into the DHCP options to see if I could find one that would be a reasonable one to use for the DHCP server to supply the address of the http server to these devices when they come online. Nothing struck me as fitting perfectly, but option 72 seems close enough without any significant (that I can see) base of devices using it as a "standard" and thus won't interfere with any existing devices on the network.
This approach does necessitate the modification of the network library I'm using (EtherCard), but I've look at that and the needed additons seem simple enough.
(FWIW: I also ruled out DNS lookup because I don't want to require a specific host name for the server.)
Does this approach make sense? Is there a better way(s) to do something like this?