Interference with UART

Hello Everyone. I am currently having trouble with wiringSerial with openframeworks. I am using ofxOMXPlayer addon to display videos to the screen.

In the update function, I have the code:

while(serialDataAvail (serialHandle))
	{
		std::cout << serialGetchar(serialHandle) << std::endl;
	}

I tested by using a temporary integer data type to hold the return from serialDataAvail and outputting it’s value. It is always 0.

The serial input is coming from an Arduino Uno. The code uploaded to the board is:

void setup() {
  Serial.begin(115200);
}

void loop() {
  Serial.println("Hello Pi");
  delay(2000);
}

Something inside openframeworks is not allowing the UART to be read or written to. I have tested my connections using minicom and it is working perfectly (I am using a bi-directional logic converter). I have disconnected GPIO TX & RX and connected the raspberry pi and arduino uno by USB (the new port that showed is /dev/ttyUSB0, when using TX & RX pins, I used /dev/ttyAMA0, nothing else exists in ls -l /dev/tty*).

Of course, inside set up has the following:

if(wiringPiSetup() == -1)
	{
		std::cout << "WiringPi Start Error" << std::endl;
		return;
	}
	
	if( (serialHandle = serialOpen(SERIAL_PORT.c_str(), SERIAL_BAUD) < 0) )
	{
		std::cout << "Wiring Serial Port not able to open" << std::endl;
		return;
	}

The entire program compiles and runs, displaying the videos I want. I have created a config make-file to include the entire wiringpi library. Including wiringPi.h and wiringSerial.h is fine.

If you need some more information on my code please let me know. Thank you in advance if you can help me out :smile:

Edit:
I have completely solved all errors by abandoning wiringSerial and directly accessing the UART using this guide.
http://www.raspberry-projects.com/pi/programming-in-c/uart-serial-port/using-the-uart
I’m not sure if the rules say I cannot link out from this website. Any mod can delete the link from this thread. But if others have this problem, they should know it’s a lot easier to avoid using wiringSerial.

-Kantel