Community
cancel
Showing results for 
Search instead for 
Did you mean: 
CChri35
New Contributor II
969 Views

Serial connection seems to be refused (at least one way)

Jump to solution

Hi!

I'm trying to do a reliable serial connection between a Windows PC and an Edison. On the PC I'm using

the Arduino Serial Terminal with 9600 Baud. I have opened a terminal on the Edison an typed

"cat /dev/ttyGS0". When I send something with the Arduino Terminal only sometimes the Strings

arrive at the Edison (<10%). When I do a "echo "test123" > ttyGS0" on the Edison, the String arrives

at the Arduino Termial with 100%.

How can this be?

Christoph

1 Solution
Diego_V_Intel
Employee
76 Views

Hello Christoph.P,

I had issues sending serial data to the Edison from the Arduino IDE in the past. The Edison wasn't receiving the data. The reason was the way the data was being sent. I used the Serial.write() method but it seems that the Edison needs to receive the carriage return and the newline characters. I used then the Serial.println() method to send data and it worked fine. You might be facing this same issue.

On the other hand, if you are sending data by typing it in the Serial Monitor, you have to upload a sketch initializing the Serial port first. You can initialize the Serial port with the line Serial.begin(9600);. The sketch should have that line at least to configure the Serial port. Then you should be able to send and receive the serial data.

Regards,

Diego.

View solution in original post

3 Replies
Diego_V_Intel
Employee
77 Views

Hello Christoph.P,

I had issues sending serial data to the Edison from the Arduino IDE in the past. The Edison wasn't receiving the data. The reason was the way the data was being sent. I used the Serial.write() method but it seems that the Edison needs to receive the carriage return and the newline characters. I used then the Serial.println() method to send data and it worked fine. You might be facing this same issue.

On the other hand, if you are sending data by typing it in the Serial Monitor, you have to upload a sketch initializing the Serial port first. You can initialize the Serial port with the line Serial.begin(9600);. The sketch should have that line at least to configure the Serial port. Then you should be able to send and receive the serial data.

Regards,

Diego.

View solution in original post

CChri35
New Contributor II
76 Views

Ok. When I upload a sketch first with the "Serial.begin(115200)" command I can receive everything fine. But how todo something äquivalent in my eclipse c++ project?

Diego_V_Intel
Employee
76 Views

Hi Christoph.P,

What the Serial.begin() method does is initialize the Serial port. So, if you are using Eclipse or any other environment, you should initialize the Serial port. The MRAA library might be helpful for you to initialize the Serial port. Take a look at this guide; it might be helpful for you: https://software.intel.com/en-us/node/558579 IoT - Updating and selecting update options for the UPM and MRAA libraries | Intel® Developer Zone

Regards,

Diego.

Reply