===== YUN Notes ===== * Default login is root and password is arduino In order to use the DD-Wrt side of the YUN with Arduino it is necessary to use the bridge function. This example shows using an MQTT client on the Arduino side hooked to the DD-Wrt side with the bridge. #include #include void callback(char* topic, byte* payload, unsigned int length) { // handle message arrived } YunClient yun; PubSubClient client("192.168.2.210", 1883, callback, yun); void setup() { Bridge.begin(); } ==== The aha Moment ==== ---- Instead of doing this with EthernetClient, on say, a Duemilanove with an Ethernet shield: #include ... EthernetClient eth; PubSubClient mqtt(MQTT_SERVER, MQTT_PORT, callback, eth); ... Ethernet.begin(mac); ... mqtt.connect(MQTT_CLIENTID, ....); you do this with the Yun: #include ... YunClient yun; PubSubClient mqtt(MQTT_SERVER, MQTT_PORT, callback, yun); ... Bridge.begin(); ... mqtt.connect(MQTT_CLIENTID, ....); The bridge opens the connection to the outside world from the Arduino via the OpenWRT host.