Serial communication not available until opening arduino serial monitor

Hi,
I am using an RFID tag reader (https://www.sparkfun.com/products/13198) and ofSerial class to comunicate with it.
I’ve found that the reader is kind of asleep, it does not write tag id on serial port until I open Arduino serial monitor. After that, it works fine.
How can I make RFID tag reader starts automaticaly inside openframeworks?

Digging on this issue, i believe i must fire up dtr and / or rts pins. Is it possible to do this inside openframeworks?

I would greatly appreciate some pointers, am a little stuck. Thanks.

If anyone is having this problem, there is a release candidate that fixes this problem: 0.9.4 Release Candidate 1

hmm… I have same problem.
oF 0.11.0 / arch linux.

just trying to write 4 bytes continuously from OF to arduino via serial.
arduino read that bytes and control ws2812 leds.

until open serial window from arduino IDE, nothing happen on arduino side.
not fixed issue yet…?

nice to know there are solid workarounds … these have helped a lot: ofSerial fast simple serial read in OF not working properly (and linux problems too)

ofSerial.h gives an example to check if the bytes are written:

/// Check the return value to be sure the data was written.
/// ~~~~{.cpp}
ofSerial mySerial;
mySerial.setup(0, 57600);
unsigned char myByte = 225;
bool byteWasWritten = mySerial.writeByte(myByte);
if ( !byteWasWritten )
	 ofLog(OF_LOG_ERROR, "Byte was not written to serial port");

Maybe that gives a clue to what’s happening?

thank you. I checked and returned value of byteWasWritten is -1.
is it NULL?

hmm interesting …

oh thank you. I’ll checkt that.
probably I should try with ofxSerial addon. hope not heavy on raspberry pi.

According to ofConstants.h (line 375) -1 means OF_SERIAL_ERROR.
But you already figured out that there’s an error…

What kind of Arduino? Original or clone?
Maybe I have it here and can test its behavior.

ofxSerial allows control of dtr and / or rts pins and works on RPI. It is also a little bit more feature-rich, so it would be worth a try just to rule out other common problems with ofSerial.

It will take a little time to compile the first time on a PI (it. depends on ofxIO, etc), but should be very quick after that.

ah ha- it was defined value! good to know that!

it’s Arduino nano clone, but not CH340 based Chinese clone. produced by Korean company and it has micro USB port, not mini port. that’s what I prefer. I don’t have any issue before with it. but yeah somehow it’s reason…! I’ll test with original UNO.

by the way I changed plan. without raspberry pi, switching to particle photon.

thank you :slight_smile: but at the moment I have no time for checking codes and testing on raspberry pi due to schedule… so now switching to particle photon. I already tried it with OSC before but pretty sure I’ll try later!