Yun Shield Bridge Not Connecting

I am fairly new to Arduino but I recently picked up a Dragino Yun Shield to connect my Arduino Uno to my Wifi network. After many tests and several days of research I have not found another post exactly like mine and that is why I'm starting this topic.

While other Yun users have problems when they attempt to change the example code in the Arduino bridge library I can not even get the examples to work as is. The serial monitor tries to connect 4 times then asks if I am including the bridge into my code. Also I can not do any of the in browser Arduino configuration such as "YunIp/arduino/digital/13/1" to make the built in LED light up, I get a message that says "Could not connect to YunServer 146 Connection refused".

I will link a sample code if requested but it will be the exact same as any of the examples in the Arduino Bridge library.

Thanks so much guys.

While I understand that it will be the exact same, could you please post the code here? There could be variances that shouldn't be there.

Additionally, can you please provide a link to the technical details of the shield to ensure that I am looking at the exact same shield you purchased?

sonnyyu:
Arduino Leonardo with Headers $25.98 at Amazon 2nd day free shipping

Clone/Dccduino Leonardo cost ~$10.00.

Use Leonardo will make your life much easy

Dragino Yun Shield - #16 by sonnyyu - Arduino Yún - Arduino Forum

Only few dollar difference between Uno and Leonardo, do yourself a favor.

There are special installation instructions for an Uno, did you follow them? Not doing this will cause the symptoms you report: Yun Shield - Connect to Arduino Uno

ShapeShifter - I have put the jumper in place and i have also got it running on a 12V 1A power supply. i have connected to it via WiFi and have set it up as usual. my problems occur as soon as i try to use it for sketches. i have been able to communicate with the Linux side of the Yun shield.

Sonnyyu - Is the leonardo that much better to work with? i am currently trying to complete a 3rd year electrical engineering tech report and any advantage is welcome.

Below i have copied in one of the codes that i am having problems with and also the page that explains the specs of the Dragino Yun Shield.

Again thank you guys so much for the help.

Specs: http://www.dragino.com/products/yunshield/item/86-yun-shield.html

Code:

/*
Console Read example

Read data coming from bridge using the Console.read() function
and store it in a string.

To see the Console, pick your Yún's name and IP address in the Port menu
then open the Port Monitor. You can also see it by opening a terminal window
and typing:
ssh root@ yourYunsName.local 'telnet localhost 6571'
then pressing enter. When prompted for the password, enter it.

created 13 Jun 2013
by Angelo Scialabba
modified 16 June 2013
by Tom Igoe

This example code is in the public domain.

*/

#include <Console.h>

String name;

void setup() {
// Initialize Console and wait for port to open:
Bridge.begin();
Console.begin();

// Wait for Console port to connect
while (!Console);

Console.println("Hi, what's your name?");
}

void loop() {
if (Console.available() > 0) {
char c = Console.read(); // read the next char received
// look for the newline character, this is the last character in the string
if (c == '\n') {
//print text with the name received
Console.print("Hi ");
Console.print(name);
Console.println("! Nice to meet you!");
Console.println();
// Ask again for name and clear the old name
Console.println("Hi, what's your name?");
name = ""; // clear the name string
}
else { // if the buffer is empty Cosole.read() returns -1
name += c; // append the read char from Console to the name string
}
} else {
delay(100);
}
}

MrStoppable:
The serial monitor tries to connect 4 times then asks if I am including the bridge into my code.

That generally means that the communications between the sketch processor (the Uno in your case) and the Linux side (the shield in your case) is not working right. One cause is that the bridge library is out of date: Do you have the latest Arduino IDE installed? Did you try the IDE's library manager to make sure the Bridge library is up to date (even if you have just downloaded the latest IDE?) Have you added the Dragino board types to the IDE and are you using the correct board selection: http://wiki.dragino.com/index.php?title=Getting_Start_with_Arduino_Yun#Configure_Board_Type_in_Arduino_IDE

Also I can not do any of the in browser Arduino configuration such as "YunIp/arduino/digital/13/1" to make the built in LED light up, I get a message that says "Could not connect to YunServer 146 Connection refused".

You don't say so, but I'm assuming you've loaded one of the example sketches that supports that command, right? If so, it could be caused for the same reasons as above.

Sonnyyu - Is the leonardo that much better to work with?

I don't want to put words in sonnyyu's mouth, but there are some good reasons for using a Leonardo, the biggest is that is the same processor that is in the official Arduino Yun board, and will therefore require the fewest changes while trying to use it with the Dragino Yun Shield.

A big advantage to the Leonardo is that it USB support built into the processor, while the UNO uses a separate USB interface chip connected to the same Tx/Rx (pins 0 and 1) that are used for communications with the shield. This is why you must put the jumper on the Uno board, to disable the USB interface. Since the USB interface on the Leonardo is separate from pins 0 and 1, it does not need to be disabled - you will still be able to load sketches over the USB port, and you will be able to use the Serial Monitor to talk to the sketch over the USB, even while using the Yun Shield.

On the Leonardo, the Serial class talks over the USB port, while the Serial1 class talks over pins 0 and 1 to the Linux processor. The Uno doesn't have a native USB port, it uses the Serial class to talk over pins 0 and 1 to the USB chip. But in your case, the USB chip is disabled, so it is using that channel to talk to the Linux board - that's a significant difference: the official Bridge library uses Serial1, which is present on the Leonardo, while the Uno only has Serial. Therefore, Dragino had to modify the library to use Serial instead of Serial1 to talk to the Linux side. This is why it is critical to load Daragino's board definitions into the IDE, and to select the correct board type.

Today I have purchased an Arduino Leonardo and connected it to my Yun shield. I have added the different board types with the dragino Yun to my arduino IDE list and have selected the "Arduino Leonardo - Dragino Yun" option. I have loaded a few different programs onto my set up via the COM port and the wifi connection and I am still getting the same problems as before. The serial monitor is still timing out and i am still getting "Could not connect to YunServer 146 Connection refused" when trying to send commands through my browser. I have now also turned off all of my firewalls on my computer just so that I know that is not the problems and it has not helped so far.

Is it possible that my Dragino Yun shield is simply defective?

http://www.ibuyopenwrt.com/index.php/dragino

Working list of Dragino and Arduino Leonardo IDE sample code

Reset to factory settings

ShapeShifter:
...
I don't want to put words in sonnyyu's mouth, but there are some good reasons for using a Leonardo, the biggest is that is the same processor that is in the official Arduino Yun board, and will therefore require the fewest changes while trying to use it with the Dragino Yun Shield.

A big advantage to the Leonardo is that it USB support built into the processor, while the UNO uses a separate USB interface chip connected to the same Tx/Rx (pins 0 and 1) that are used for communications with the shield. This is why you must put the jumper on the Uno board, to disable the USB interface. Since the USB interface on the Leonardo is separate from pins 0 and 1, it does not need to be disabled - you will still be able to load sketches over the USB port, and you will be able to use the Serial Monitor to talk to the sketch over the USB, even while using the Yun Shield.

On the Leonardo, the Serial class talks over the USB port, while the Serial1 class talks over pins 0 and 1 to the Linux processor. The Uno doesn't have a native USB port, it uses the Serial class to talk over pins 0 and 1 to the USB chip. But in your case, the USB chip is disabled, so it is using that channel to talk to the Linux board - that's a significant difference: the official Bridge library uses Serial1, which is present on the Leonardo, while the Uno only has Serial. Therefore, Dragino had to modify the library to use Serial instead of Serial1 to talk to the Linux side. This is why it is critical to load Daragino's board definitions into the IDE, and to select the correct board type.

Perfect explanation!!!

Upgrade Yún shield's firmware

Hello, you managed to run the project with the shield yun ?

I am developing a similar project with shield yun.

Morning

To all people, with Problems connecting Dragino shield & Arduino (Uno|Mega) via Bridge.

i struggled days with this Problem

on Dragino-side:

root@ardyun01mega:/etc/config# cat /root/set-stty.sh

#!/bin/sh
/bin/stty -F /dev/ttyATH0 115200 clocal cread cs8 -cstopb -parenb

root@ardyun01mega:/etc/config# cat /etc/rc.local

Put your custom commands here that should be executed once

the system init finished. By default this file does nothing.

/root/set-stty.sh
exit 0

on Arduino side call the Bridge Library with the proper BAUD-rate:

Bridge.begin(115200);

(Edit)
I use it for this Project, i post the solution in the comments
http://www.lucadentella.it/en/2015/08/04/irrighino/