Raspbian Serial Port Input From Fona - Raspberry Pi Forums


i have fona/pi based phone have built, i'm having trouble reading serial port in contexts.

minicom seems communicate fona fine, , tyos (python-based) doesn't seem have trouble.

however, console/command line, , java, have trouble.

using console/command line can log data read fona entering:

cat /dev/ttyama0 > log.txt &

can dial phone number (or enter other valid command) follows:

echo atd5555555555; > /dev/ttyama0

trouble in log file, this:
atd5555555555;

ok

atd5555555555;

ok

ok

atd5555555555;

ok

ok

atd5555555555;

ok

ok

ok
and, keeps going forever. pattern seems nested loop this:

code: select all

for(int i=1;true;i++){   for(int j=0;j<=i;j++){     echo command;     for(int k=0;k<=i;k++){       echo "ok";     }   } } 
further issued commands lost in of garbage.

if close listening process , start 1 (ie. kill -9 #; cat /dev/ttyama0 &) weird looping output cut off , won't start again until issue command.

have found in java, if continuously listen output, similar response. if start listening before issuing command, , close stream when i'm done, don't have problem, , can issue multiple commands. weird looping output previous commands dies off , doesn't ever reassert itself.

tyos, doesn't seem continuous listening, hard tell if there issue there. (minicom, then, software doing expect.)

suspect issue how device configured default, i've not found symptom mentioned others, , i'm not making traction on issue otherwise. it's getting bit frustrating.

has else had issue? have idea how listen port continuously without of looping output?

i have found sending eot control character (0x04), after i've gotten response i'm looking for, seems help. still having trouble in java. (maybe multithreading issue, maybe flush needed... ?)


raspberrypi



Comments