Well, if i connect to the modem directly with Putty for example and execute the same command I'm getting the expected feedback. I also tried different modems with the same result. I think for some reason the response is not ending up the file handle. If you look at the first code I posted you see that the loop to output the response should only be entered if there is anything in the filehandle. But it never entered it. In the second code it's just getting stuck as there is nothing in the filehandle as well.
Could you maybe explain more detailed (or provide links) what you mean with "more explicit file handle discipline"? I'm not a very experienced programmer so I would need more input to understand :)
I tried both now - read and sysread. But both loops are not beeing entered at all:
#Reading the response
while ( read(PORT,$read,2048) )
print "using read:\n";
while (sysread(PORT, $sysread, 10000))
print "using sysread:\n";
Here's what's happening:
Enter AT command:ATI0
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||