0

EDIT I am using an Genuino Uno & Yun Shield

I am a complete arduino noob

I am creating something where I need a process to execute a command on my yun shield but when I use Bridge.begin(); It scrambles all text to something like this

.ÿš2%š%šr%š%š%šr%š2%š2%º%š%š%š2%º2%º2%ºr%š2%º2%šr%šr%š%š2%šþøøþøøþúøøýýøþþþýþþøøøøúýøþÿøøþþøúýþúøøøþøýøþýúøþþøüþþøýþþøýøúø

and it just keeps adding characters. if I don't use Bridge.begin(); then it correctly prints.

I wrote this short program to replicate the bug:

#include <Process.h>

void setup() {
// put your setup code here, to run once:
// Start the bridge and serial port.
Bridge.begin();
Serial.begin(9600);

 while(!Serial){

 }
}

void loop() {
// put your main code here, to run repeatedly:
Serial.println("test");
}

So this will give the scrambled text and when you remove the Bridge.begin(); it will show the text but I really need to use a Process in my other program so as I understand I need Bridge.

  • Did you really follow the "Arduino - Process - Tutorial" ? – J. Piquard Jan 3 '17 at 16:16
  • If I use that code I get a SerialUSB not declared in this scope on the last line but if change all of them to Serial then it still gives the scrambled output – DePrestige Jan 3 '17 at 16:41
  • This may well not be workable with an Uno as the host, unless you do some serious revision to the behind-the-scenes code, as it probably assumes that there is UART for communication with the Linux module that is distinct from the USB channel to the serial monitor. That would be true on the Leonardo type system this originated with, but not on an Uno. Hence your probably probably comes from the Bridge code setting the single serial port to a different rate than you intended to use. – Chris Stratton Jan 3 '17 at 17:35
  • So @ChrisStratton do you maybe have an idea how I could make it work – DePrestige Jan 3 '17 at 20:34
0

You need to use the Console class instead of Serial. Official example here.

  • How can I then view my console because I constantly get "Connection closed by foreign host" on my serial monitor when I connect to the yun shield port in the ide (because it said to do that in the example) – DePrestige Jan 3 '17 at 21:45
  • Have you shorted the two pins on Arduino Board? If you don't know what I'm talking about I will give more information. – Štefan Schindler Jan 3 '17 at 21:48
  • No I have not I was really hoping I wouldn't need to do that where can I find something to sort them? – DePrestige Jan 3 '17 at 22:47
  • And maybe also what pins do I exactly need to sort? – DePrestige Jan 3 '17 at 22:53
  • Well, I realized that wouldn't probably be the problem (I had to do it, but I have the old Dragino Yun Shield, so it doesn't matter in your case, probably). But make sure you are not connected to the Arduino by USB cable, but via WiFi. – Štefan Schindler Jan 3 '17 at 22:54
1

Bridge and Serial both use the same pins. You cannot use them both.

Bridge runs at a much higher baud rate (230400 IIRC) than Serial, which is why it all messes up.

  • Do you maybe have an idea why my console says Connection closed by foreign host when I try to view it. – DePrestige Jan 4 '17 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.