shigetsu:

It could be a timing issue. If you're missing the first few characters, then put in a small time delay before sending the message. It could be that the receiving hardware can't quite prepare for the message before your program is sending it out.

As an example, a long, long time ago, I had a similar problem with a different bit of equipment. In that case, it was due to a timing issue. You see, when you send a carriage return to a teletype (excedrin headache ASR-33), you need to wait a little while before sending the next character, unless you wanted to see it smudged through the center column as the printhead is returning to the left margin.

A few years later, working with some video terminals, I encountered something similar: Some sequences (clear screen, IIRC) needed an extra character time before you sent anything else, or the next character would be dropped. At least it wouldn't smudge somewhere on the screen... 8^)

Later still, working on a cow feeding system--(Don't ask!)--I encountered yet more systems where you needed to give a pause between particular control sequences. It's a relatively common thing to encounter in lots of embedded systems. Give it a try to see if that helps. (Just to prove it to yourself, I'd go ahead and use a significant delay, such as a couple seconds, to see if it clears things up. If so, then trim the time down until you get as much speed as you can reliably get. Then back off a bit.)

--roboticus

Update: After looking at your code, I notice that you're using the AT command codes to talk to your modem. You could insert the sequence "ATD;,\015" into your command sequence to provide a delay. (You can adjust the delay by setting the appropriate value in the S8 register. See an AT command reference for details.


In reply to Re: Lost characters using Device::Modem by roboticus
in thread Lost characters using Device::Modem by shigetsu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.