Check the live demo at http://try.yaler.net/~arduino/led
Because the LED is exposed through a simple RESTful web service running on the Arduino color changes can also be triggered by Pachube or other platforms offering Web hooks. Welcome to the Web of Things ! The LED can of course be replaced by a motor or a high voltage switching relay to enable more interesting browser controlled applications, e.g. for home automation.
Publishing your Arduino through the Yaler relay server makes the Arduino accessible from everywhere even if it is hidden behind a firewall or a NAT and does not have a public IP address. A single Yaler relay server instance can host many Arduinos (and any other device with a TCP Socket library, e.g. a Sheevaplug or an Android phone) and is available for non-commercial use including full source code at http://yaler.org/ (Disclosure: I founded the company developing Yaler)
Material
- Tri color LED [Ladyada | SparkFun]
- Arduino Duemilanove ATmega 328 [Ladyada | SparkFun]
- Arduino WIZnet Ethernet Shield [Ladyada | SparkFun]
-
Resistors [1 x 150 Ohm, 2 x 82 Ohm for the Ladyada LED or
1 x 180 Ohm, 2 x 100 Ohm for the SparkFun LED] - RJ45 cable
- Soldering iron
- Helping hands
- A / B USB cable
- Internet access with DHCP, no public IP address needed for Arduino
- (Optional: PC or Cloud Server with a public IP address, to run Yaler)
Remove these ads by
Signing UpStep 1: Soldering resistors and wire to the tri-color LED
- Shorten all except for the longest leg of the LED
- Solder the resistors to the LED legs as shown below
- Shorten the remaining long leg
- If you use the Ladyada LED, solder the red wire to it [as shown below]
- If you use the SparkFun LED, solder the black wire to it









































Visit Our Store »
Go Pro Today »




n/led/ HTTP/1.1
And this when I click on the RED box:
n/led/led/ff0000 HTTP/1.1
Host: try.yaler.net
It looks like the "isPut" variable never gets set to "true" and so the pins never get set.
Regards,
tamberg
sketch_jan30a:-1: error: variable or field 'receiveYalerResponse' declared void
sketch_jan30a:-1: error: 'Client' was not declared in this scope
sketch_jan30a:-1: error: variable or field 'sendPutResponse' declared void
sketch_jan30a:-1: error: 'Client' was not declared in this scope
sketch_jan30a:-1: error: variable or field 'sendGetResponse' declared void
sketch_jan30a:-1: error: 'Client' was not declared in this scope
sketch_jan30a:-1: error: variable or field 'receiveRequest' declared void
sketch_jan30a:-1: error: 'Client' was not declared in this scope
In file included from C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Ethernet.h:5,
from sketch_jan30a.cpp:29:
C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Client.h:17: error: conflicting return type specified for 'virtual void Client::write(uint8_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Client.h:19: error: conflicting return type specified for 'virtual void Client::write(const uint8_t*, size_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:50: error: overriding 'virtual size_t Print::write(const uint8_t*, size_t)'
In file included from C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Ethernet.h:6,
from sketch_jan30a.cpp:29:
C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Server.h:20: error: conflicting return type specified for 'virtual void Server::write(uint8_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Server.h:22: error: conflicting return type specified for 'virtual void Server::write(const uint8_t*, size_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:50: error: overriding 'virtual size_t Print::write(const uint8_t*, size_t)'
sketch_jan30a.cpp: In function 'void setup()':
sketch_jan30a:217: error: redefinition of 'void setup()'
sketch_jan30a:2: error: 'void setup()' previously defined here
sketch_jan30a.cpp: In function 'void loop()':
sketch_jan30a:230: error: redefinition of 'void loop()'
sketch_jan30a:7: error: 'void loop()' previously defined here
any ideas ?
Sorry for the trouble,
tamberg
Am I better off having having the webserver send simple requests to my Arduino device or the other way around.
// if (yalerCount == 56) { // sizeof("HTTP/1.1 101 ... \r\n\r\n") - 1
if (yalerCount == 75) { // sizeof("HTTP/1.1 101 ... \r\n\r\n") - 1
Now it works fine. Apparently the returned HTML is longer on the source code version that what comes back from Yaler.net.
Maybe I built the Java source incorrectly, but this fix seems to work for me.
overall, this project is very well designed
thanks for checking out this project. You're right, it's currently possible to set other colors than red, green and blue. The LED has a public interface which let's you send HTTP requests to control it. In addition to editing the button command you can use cURL, the Poster Firefox plugin or any other Web client to send an HTTP PUT request "by hand". Of course you're also right that such an interface should only allow valid settings and filter the rest.
Cheers,
Thomas
Can't get your link above to connect either.
the memory on the Arduino is pretty terse. Depending on the size of your change, that might lead to the Arduino code not running at all.
The example above on the other hand, just needs a rest.
Cheers,
tamberg
Cheers,
tamberg
In step 5 you state: "if the Yaler instance at the specified IP address is up and running". Don't really know what this means or how correct it?
Any insight?
Thanks
to serve a Web-page over a LAN the Ethernet Shield is still necessary. If the phone is connected via Wifi you might be able to access the site without a relay server or port forwarding. Otherwise, if the phone is connected to the Internet via mobile network, you'll need a public IP for your Web-server (or some sort of relay, as decribed here).
Cheers,
tamberg