lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] hayes commands popping up in ppp stream


From: chrysn
Subject: Re: [lwip-users] hayes commands popping up in ppp stream
Date: Fri, 14 Nov 2014 14:12:16 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

hello sylvain,

thank you for your quick reply.

On Fri, Nov 14, 2014 at 11:54:45AM +0100, Sylvain Rochet wrote:
> I feel dazed and confused, is this really a thing which is actually 
> usual in the wild or is it specific to your modem ?

i've seen it at least in different simcom devices (the voltage warnings
pop up both with SIM900D and SIM340 series). judging from the quality of
their documentation, it would not be a surprise if that were a
peculiarity of their own. (i've seen strange things going on with zte
modems too, but it's long ago and a little of a blur).

> AFAIK modems usually use DTR level to switch from data mode to command 
> mode, which is an OOB mechanism so it doesn't need dubious parsing. I 
> know about the "pause +++ pause" mechanism but it is nowadays rarely 
> used since it is prone to erroneous termination, and +STRING+ is not it.

at least with the SIM900, the DTR pin is labelled as input, used to
enable some sleep modes.

(i'd be very careful with that kind of oob mechanisms from a
synchronization point of view, but then again, i'd much rather have a
modem on a clean spi interface with cs and interrupt than all that
asynchronous serial stuff, but i digress.)

> HDLC frames always start with 0xff 0x03 in case of PPP over serial line, 
> which goes to the following with the added HDLC flags:
>   0x7e 0xff 0x03 ... 0x7e
> 
> While your "ASCII frame" will probably be:
>   0x7e 0x0d(\r) 0x0a(\n) 0x2b(+) ... 0x7e
> 
> So you can probably split up those frames without much issue.

that sounds doable; i reckon i'd need to send any encountered 0x7e
immediately, and if it's followed by a \r, send that to the at-command
unsolicited response parser until the next 0x7e.

from what i can tell, there won't be a 0x7e ('~') or 0x7d ('}') in the
ascii output. thanks for the pointer to hdlc, i wouldn't have noticed
that there are two separate layers involved when i looked over the lwip
ppp code.

> Well, this looks like an ugly hack, I am not sure this belong to the 
> lwIP stack, especially if this is specific to one modem. It actually 
> breaks the HDLC framing protocol.

you are right, that's better handled by the modem specific [:-(] driver
part.


i'm curious, though: if what the sim900d does is not The Right Way, how
would a process communicating with a gsm modem know when, for example,
the cell signal strength changed, a call comes in or the modem connects
to another cell? (granted, there's a dedicated ring pin, but there are
many conditions, and assigning a gpio per feature is not how i want to
run my pcbs.)

best regards
chrysn

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]