problem examples -> 04.Communication -> SerialEvent with intel galileo gen2

Hello, I tested the example 04.Communication -> serialEvent() on the intel board Galilean gen2 and serialEvent () function is not called, is there any way to fix it?

equal example: http://arduino.cc/en/Tutorial/SerialEvent

compiled with arduino-1.5.3-Intel.1.0.4

ocanen: Hello, I tested the example 04.Communication -> serialEvent() on the intel board Galilean gen2 and serialEvent () function is not called, is there any way to fix it?

equal example: http://arduino.cc/en/Tutorial/SerialEvent

compiled with arduino-1.5.3-Intel.1.0.4

A little bit late, but there is no way of fixing that (I've found the problem on Galileo -Gen 1), take a look at https://communities.intel.com/thread/55215

Fernando.

Hi,
Actually both code works. Since I use USB client port (not the audio like jack) which I guess you also use to test your code, you need to change the Serial (pins 2 and 3) to Serial1 (pins 0,1).

Code and screenshot is attached. Just make sure you select “new line” in Arduino serial monitor to send ‘\n’ after you click send along with your string you typed.

SerialEventGalileo.ino (1.45 KB)

Capture.PNG

wbadry: Hi, Actually both code works. Since I use USB client port (not the audio like jack) which I guess you also use to test your code, you need to change the Serial (pins 2 and 3) to Serial1 (pins 0,1).

Code and screenshot is attached. Just make sure you select "new line" in Arduino serial monitor to send '\n' after you click send along with your string you typed.

I don't think so... you are receiving the "echo" of your input, not the sketch output. You can verify it by adding

Serial1.println("let's see");

immediately before the line you already have:

Serial1.println(inputString);

and you will never see the hardcoded message... at least I didn't!

You are right, however, in which there is some Serial and Serial1 involved... since we are using "USB client port (not the audio like jack)"

... I'll keep trying and post if I find something...

Fernando.

ftinetti: I don't think so... you are receiving the "echo" of your input, not the sketch output. You can verify it by adding

Serial1.println("let's see");

immediately before the line you already have:

Serial1.println(inputString);

and you will never see the hardcoded message... at least I didn't!

You are right, however, in which there is some Serial and Serial1 involved... since we are using "USB client port (not the audio like jack)"

... I'll keep trying and post if I find something...

Fernando.

Well, after working a little bit more, I found that: a) serial1 is not related to anything in this case... the example works without any reference to serial1. And I've used a Gen1 Galileo with the USB client connected (not the serial console). b) The code works if, as wbadry sent in his post, there is an explicit call to the serialEvent() function, since the Galileo "system" does not add any implicit one as in the Arduino "system". c) There is not such thing as a char-by-char input, the whole input is available only when the "enter" key has been pressed and all the keys pressed (before the enter key, of course) are available, being \n the last one. I've checked this behavior with the Serial Monitor set to "New Line". I've not got to work other settings (not in a way I'm able to explain, anyway).

Summarizing: the example code in the IDE works (I'm using arduino-1.6.0+Intel, I don't know if there is some change in new IDEs) if you add an explicit call to serialEvent at the beginning or end of the loop function and the Serial Monitor is set to New Line.

HTH,

Fernando.