Re: How to send the DBUS signal to NetworkManager in user space?



On Sat, 2009-03-21 at 16:03 +0800, Franko Fang wrote:
> Dear Dan,
> 
> > How do the huawei cards start the actual data connection?
> > 
> Well, we use the 'qmi' command to start the actual data connection at
> present,  but not with AT command.
> But I think we will use AT command to do it later.

Ah, ok.  Any chance the interface between the 'qmi' command and your
hardware is documented?  Or does 'qmi' stand for "Qualcomm Management
Interface", which would of course be completely proprietary?

> > A few more questions for you:
> > 
> > 1) does the device support PPP at all on the AT-capable ttys?
> > 
>  No, in our device, we have two or more ports can support AT command,
> but only the modem port can support PPP.

How does a user (like NetworkManager) know which port is the "modem"
port?  Will the 'modem' port always be the same USB interface #, or does
the firmware need to be asked which port is which?

>  In generally, the first port of our device will be the modem port, so
> you must dial up the data connection with PPP, using the first port of
> our device.

Ok, "in general" isn't specific enough to make things work as
expected :)  There either needs to be a set rule for this (ie, usb
interface 0 is always the modem port) or else a firmware interface
should exist to that the driver can expose the necessary information to
userspace.

> > 3) Does the card advertise one or more CDC-ACM ports and one
> CDC-ETHER
> > port, or are the serial ports still driven by 'option'?
> > 
>  Well, there is one CDC-ACM port and one CDC-ETHER port on our device.
>   For the CDC-ACM port, attacthed to by serial driver 'option';

If it's a cdc-acm port, why does it need the 'option' driver?  The
cdc-acm driver should work with the port just fine; no need for
'option'.

>   For the CDC-ECM port, we develop a new driver for it, based on the
> driver 'cdc-ether.c' in the kernel.

Is that really necessary?  Is there any reason why support for your
device could not be added directly to the standard cdc-ether driver?
It's best to try to fix up the existing drivers before adding a new one
that's mostly the same code.

>   And however, we have found the solution to notify the NetworkManager
> while our device is connected or disconnected to the Internet with
> CDC-ECM port.
> 
> > For now, with NetworkManager 0.7.x, we have limited support for the
> > Option 'hso' modems and the Ericsson F3507g.  We may be able to
> support
> > these newer Huawei devices in 0.7.x too.
> > 
> > For NetworkManager 0.8/head, we have a much more flexible system
> called
> > ModemManager which will definitely have the infrastructure to handle
> > your card.  We'd love to add support for your cards to ModemManager,
> and
> > also if possible to NM 0.7.x.
> > 
>   Well, that's great. Our modem port can support AT command to dial
> up. So I think that it will best if you can make the NetworkManager or
> ModemManager to support our cards. 

Yeah, it can be supported with NM + MM, but we'd need more information
on the specific AT commands (or the qmi interface) that would be used to
do things like:

1) prefer 3g/2g, 3g-only, 2g-only
2) set the APN and username/password
3) trigger the data session connection attempt
4) how success/failure of the data session is communicated to the
controller (ie, NM)
5) how to terminate the data session

that sort of thing.

>   If any problems, please feed them back to me, then I will do my best
> to solve it for you.
>   Thanks.
> 
> >>    2. While I dial-up the data card to connect to the Ethernet, the
> NetworkManager will not be activated to refresh the information, such
> as IP, for our data card in the linux system.
> >>      I want to send some signal or method_call to NetworkManager by
> DBUS to activate it in the user space.
> >>      Which signal or method_call can I send ? How to send them?
> > 
> > This is expected because the card is not handled natively by
> > NetworkManager's 3G support.  If possible (and I think it is), we
> should
> > teach NetworkManager about your new hardware, then everything will
> work
> > happily together.
> > 
> > In return, I have a question for you too :)
> > 
> > I have a Huawei E160G card (firmware version 11.604.06.00.156) that
> I am
> > trying to make NetworkManager talk to.  The device randomly stops
> > responding to AT commands on its first serial port and must be
> unplugged
> > and replugged to make it respond again.  Could you direct me to
> somebody
> > who could help me debug this behavior and thus make Huawei cards
> better
> > supported for NetworkManager users?
> >
> Well, thanks very much for your feeding back this issue.
> But I am sorry, can you tell me more details for it? 
> Such as, how do do send the AT command, with chat or wvdial?

A small utility runs when the modem gets plugged in, and calls "AT+GCAP"
or "ATI" to determine what the modems capabilities are.  Ie, whether
it's a CDMA or a GSM device.  Very simple, uses 9600 8N1.  However,
whenever that prober runs on ttyUSB1 (usb interface 1), later when NM
tries to talk to the E160G device, the device simply stops responding to
commands.  Unplugging the device and replugging it sometimes works.

> And is there any other application try to send the AT command to our
> device through other port?

This could be the case, since the small probing utility is run twice in
parallel for each serial port; they may be sending commands to the modem
at the same time.  However, this is usually successful, but later
connections by the real connection manager (ie, NM) make the first port
randomly fail to respond to AT commands.

> And what's its phenomenon, so you think that the device has stopped
> responding?

NetworkManager will send an AT command (like AT+COPS?, or AT+GMM,
anything) on ttyUSB0 and the modem will simply not respond to that
command.  It won't respond to any subsequent commands on ttyUSB0 until
it's plugged/replugged.

When the small prober utility *isn't* run when the modem is plugged in
(and thus ttyUSB0 and ttyUSB1 are not touched until later when
NetworkManager uses ttyUSB0), things work as expected.

Any thoughts?  Are there specific restrictions on sending AT commands to
both ports of Huawei E16x modems at the same time?  If so, what are
they?

Thanks!
Dan
 
> Waiting for your feeding back, thanks very much.
>  
> Best Regards,
>  
> Franko Fang
> 2009-3-21



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