I am trying to get the RSSI value from a Option modem installed as ttyHS4 (control) and ttyHS5 (data) on a Linux board. Expected result shows up on console but the fgets just does not capture any console output data.
if ((f=popen("echo -e \"AT+CSQ\r\n\">dev\ttyHS4","r"))==NULL){
perror("popen");
exit(1);
}
while (fgets(buff,sizeof(buff),f){
printf(":%s:\n",buff);
}
I tested with "echo \"TEST\"" in the popen command and code above was able to print out the ":TEST:" string. With the ttyHS4 output, I only can get a few output on the console but the fgets + fprintf does not get any data to work on.
Please advise where I could have faulted.