I am running Raspbian Jessie 8 on Raspberry 3 and I followed the answer to the question Why my program won't communicate through ttyAMA0 on Raspbian(jessie)? But I still can't get my program to connect through serial GPIO pins.
I ran gpio readall command on the terminal and it said that PINS 15 and 16 (RX and TX) for serial is set to ALT5, but it needs to be ALT0. So, I ran the following command on the terminal.
gpio mode 15 ALT0; gpio mode 16 ALT0;
It changes the state of pins settings. However, my program keeps complaining that it can't connect to the serial port. I also noticed that once I reboot my PI, RX and TX pins changes back to ALT5. Am I missing something? or Any hints or clues will be greatly appreciated.