Page 4 of 12 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 119

Thread: Howto: Connect ZTE MF627 3G modem with NM0.7

  1. #31
    Join Date
    Jul 2005
    Beans
    152

    Re: Howto: Connect ZTE MF627 3G modem with NM0.7

    I'm on Jaunty with the same symtoms as others, install udev-extras but get no icon on desktop etc

  2. #32
    Join Date
    Dec 2008
    Beans
    27

    Re: Howto: Connect ZTE MF627 3G modem with NM0.7

    I've been wrestling with one of these on Jaunty for a few weeks now, and come to some interesting conclusions.

    It has been working, but erratically in that sometimes it just does not want to make a connection - I think many people here have experienced this. It was getting so bad, including the symptom of the device spontaneously unmounting, that I thought it was a fault with the dongle and I got "3" to send me a new one under warranty. Guess what? the new one behaves exactly the same, so it's not the hardware.

    I was using usb_modeswitch, but then I found AT+ZCDRUN and turned off the zero-CD mode permanently. That seems to have stopped the weird dismounts (also speeds up the device plug-in time), but the connection problem is no better.

    To try to get a handle on things I've been playing with the raw ttyUSB devices, and this is where things are erratic. E.g. sometimes the output (responses to AT commands and unsolicited messages) has one blank line between items, sometimes three. Sometimes one port is detected as a modem, sometimes two. Sometimes when I send a command to the port it is echoed back in the output, sometimes not, etc.

    The cause of this turns out to be the stty modes of the ttyUSB ports. They are not consistently initialised, presumably just picking up random settings. The single/triple blank line symptom depends on the value of icrnl. Whether the port is detected as a modem seems to depend on the echo flag (it should be off). Twiddling these setting once the port is created [ stty flags </dev/ttyUSBx ] can improve matters.

    Should usbserial set known stty modes when it creates a port, or is it up to an application to set them? If the latter then should it be NM, or the "option" driver (which is what the ZTE actually seems to be)? Seeing that it affects how a port is detected, I guess they should be set pretty early on.

    I'm sure that if the stty modes were set to a known state, then at least the behaviour would be consistent, and if there are other bugs it might be possible to identify them.

    I'd file a bug report but I'm not sure where to direct it!

    BTW, I sniffed out the modeswitch string that 3's Windows software uses to switch the device mode, and it's not the same as the 628+, which is what usb_modeswitch.conf tells you to use.

    The actual string is: "55534243b8b79c82240000008000068500000024000000000 0000000000000"

    This does switch the device, but as I've stopped using this anyway I don't know if it makes it any more stable.

    Another BTW, I recommend enabling serial debug in NM, then you can see the conversation with the modem in the log. Add the line
    export NM_SERIAL_DEBUG
    to /etc/init.d/NetworkManager somewhere near the top.

    I hope this is useful, and that the issue can be taken forward. I'm going to be away for a week and probably won't be able to follow this until I get back.

    Cheers
    Rick Jones

  3. #33
    Join Date
    Jun 2009
    Beans
    12
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto: Connect ZTE MF627 3G modem with NM0.7

    Rick - it sounds like you're making really good progress, so I hope you're able to put a bit more time to this.

    My symptoms are very similar to yours. Your theory about how the ttyUSBx devices are allocated to functions on the device rings true with me - I suspect that NM is occasionally trying to communicate with the device down the telemetry channel (which *seems* to stream back a signal strength heartbeat, plus information on currently connected network) and that causes lots of fail.

    I'm similarly frustrated, particularly when on the move - it can sometimes take 30-45 minutes to get a stable connection. It should work, but oh heck, it's a frustration now.

  4. #34
    Join Date
    Dec 2007
    Location
    Chisinau, Moldova
    Beans
    20
    Distro
    Kubuntu Karmic Koala (testing)

    Re: Howto: Connect ZTE MF627 3G modem with NM0.7

    There are several layers that have to be fixed for ZTE modems to work in Ubuntu. It's way too hard to get them connected, so things need to improve.
    I own a MF637 modem, and even in Karmic things are very bad. Sometimes it takes a lot of time to get the modem up and running.

    We should report bugs for each component, to help the developers, so I suggest:

    1) „/var/lib/misc/usb.ids” does not contain information about ZTE. This is the file that lsusb uses to tell us the device names.
    The lines in bold have to be added:
    Code:
    19d2  ONDA Communication S.p.A.
         2000  ZTE Virtual CD-ROM
         0031  ZTE MF6xx Broadband Modem
    2.a) the package usb-modeswitch has to be installed by default, with the appropriate configuration rules. There is a problem though: 19d2:2000 identifies all ZTE modems, but the sequences required to mode-switch each model are different.

    2.b) in Karmic, ejecting the virtual CD device causes the proper driver to load for the modem, so adding to /etc/udev/rules.d/ a rule like:
    Code:
    SUBSYSTEM=="usb", SYSFS{idVendor}=="19d2", SYSFS{idProduct}=="2000", RUN+="(command to eject the new /dev/srx)"
    could do the trick. I'm afraid that this method is slower, as it has to wait for the CD-ROM device to settle before it can be ejected (however, I could be wrong).

    3) In Kubuntu, plasma-widget-network-manager uses invalid settings when creating the connection file.
    The appropriate file in „~/.kde/share/apps/networkmanagement/connections” should contain:
    Code:
    baud=0
    mru=1440
    mtu=1440
    baud=0
    bits=0
    parity=
    instead of its values for these parameters.

    4) I experience frequent kernel oops's, and the system sometimes completely freezes ~10-20 times per day. This happens only when the modem is plugged in, so I suspect the „option” driver to be responsible.
    Does anybody using ZTE modems get something like this:
    https://bugs.launchpad.net/ubuntu/+s...ux/+bug/386764

    To check, please do:
    Code:
    cat /var/log/syslog | grep BUG:

  5. #35
    Join Date
    Dec 2008
    Beans
    27

    Re: Howto: Connect ZTE MF627 3G modem with NM0.7

    I've spent a lot more time (too much!) poking and probing and come up with a much better idea of what's going on - and wrong - with these things, as well as some workrounds.

    There are a number of issues.

    1. Ports

    The device has 3 serial ports on interfaces 0, 1, & 3 (interface 2 is the mass storage device). These are always assigned to ttyUSB* numbers 0, 1, & 2 respectively. ttyUSB0 is the NMEA port, ttyUSB1 is the monitor, and ttyUSB2 is the modem. However, after these ports are created, the system is inconsistent in deciding which is a modem, in particular, sometimes ttyUSB1 is seen as a second modem, and sometimes ttyUSB2 is not seen as a modem. There seem to be two stages - firstly a modem port is hooked by the "option" driver, then NetworkManager probes the ports to see if they behave as modems (presumably by sending AT commands).

    This is why you sometimes get two connections listed in NetworkManager, when it thinks there are two modems, but if you try to use the one that's on ttyUSB1, chances are it won't connect.

    I don't know how the system decides to use the "option" driver for a given port. I think this is handled by HAL, but I don't really understand HAL or how its config files work. When I originally got this device working on Hardy I had to add a .fdi file to get NM to see the device. I'm now on Jaunty, with a 2.6.29 kernel, and it turns out the .fdi file is no longer needed, but I can't find where the device is defined in the standard files.

    I would have thought it should be possible to tell the system to only load the option driver for interface 3. This may help NM to see only ttyUSB2 as the modem.

    2. tty modes

    When the ports are first created, their tty modes are random. This is a major cause of erratic behaviour, and in some cases can crash the kernel. The device should have the settings that correspond to "stty raw". This can be tweaked by running the command "stty raw -F /dev/ttyUSB2" each time the modem is plugged in.

    I think this is an omission in the option driver - it should set the modes as part of its initialisation. I also suspect this is related to why NM is inconsistent about whether it thinks ports are modems or not.

    3. Unsolicited messages (UMs)

    Both the modem and monitor ports continually stream +ZUSIMR:2 at 2 second intervals, and UMs cause a problem with AT commands. The response to an AT command should be interleaved with the UMs, but it turns out that to guarantee to get the response, you must start reading the port at least 2 secs. before sending the AT command. But modem AT drivers (including in NM) work by sending the command, then reading the response. This results in missed responses, and is the primary reason for NM failing to get an initialisation response to the modem, and hence unable to dial.

    I haven't been able to find out what +ZUSIMR means, but it must be something to do with SMS, because if you issue any version of the AT+CPMS command, the stream of UMs stops permanently on both ports (until you plug the modem in again). As with setting the tty modes, this has a dramatic effect in making the modem reliable.

    There are other UMs from time to time, mainly those that report the current network and connection mode (+ZDONR & +ZPASR). If you happen to attempt to connect at the moment the modem is issuing one of these then dialling will likely fail, but as these UMs aren't continuous a retry will usually work.

    4. Timeouts

    NM only allows 15 secs for ppp to establish a connection. This is after the transition from state 6->7 as seen in the log. This isn't always long enough, especially on roaming connections. Using the "3" network in the UK, its 2G fallback is a roaming connection on Orange, and this can be quite hard to connect to. Sometimes it connects after nearly 15 secs just before the timeout, so I think that if given more time it would be more sucessful. There doesn't seem to be any way to configure this externally.


    5. An oddity

    A couple of times the device has got into the state of being detected as 4 serial ports, and no mass storage device. This results in ttyUSB2 being assigned to interface 2 (which should be mass storage), and ttyUSB3 as the modem. I say "got into the state" because this persisted even after re-plugging the device and even re-booting Linux. Some time later it then behaved normally. Weird!


    I've knocked up some scripts that help do the extra initialisation, and also support listing and selecting the network, and reading SMS messages.
    They are attached here (ZTE-scripts.tar), if you try them, please post your results.

    There seem to be several areas that need cleaning up. The option driver certainly looks like one, but I'm sure more could be done with HAL to improve the initialisation. I just don't know enough about HAL to work this out

    HTH

    Cheers
    Rick Jones

    (edit - small update to scripts to improve usability)
    Attached Files Attached Files
    Last edited by RickPJ; June 30th, 2009 at 09:09 PM.

  6. #36
    Join Date
    Dec 2007
    Location
    Chisinau, Moldova
    Beans
    20
    Distro
    Kubuntu Karmic Koala (testing)

    Re: Howto: Connect ZTE MF627 3G modem with NM0.7

    Hi Rick!

    Quote Originally Posted by RickPJ View Post
    1. Ports
    ...
    This is why you sometimes get two connections listed in NetworkManager, when it thinks there are two modems, but if you try to use the one that's on ttyUSB1, chances are it won't connect.
    This behaviour is reported by many users. On Kubuntu Karmic, I mostly get two modems listed, but sometimes it's only one (the right one, BTW).

    I don't know how the system decides to use the "option" driver for a given port. I think this is handled by HAL, but I don't really understand HAL or how it's config files work. When I originally got this device working on Hardy I had to add a .fdi file to get NM to see the device. I'm now on Jaunty, with a 2.6.29 kernel, and it turns out the .fdi file is no longer needed, but I can't find where the device is defined in the standard files.
    Apparently, creating UDEV rules is the recommended approach, so HAL .fdi files are not needed any more (at least in Karmic, probably in Jaunty too).

    I would have thought it should be possible to tell the system to only load the option driver for interface 3. This may help NM to see only ttyUSB2 as the modem.
    Looks like a bug that has to be reported.

    2. tty modes

    When the ports are first created, their tty modes are random. This is a major cause of erratic behaviour, and in some cases can crash the kernel. The device should have the settings that correspond to "stty raw". This can be tweaked by running the command "stty raw -F /dev/ttyUSB2" each time the modem is plugged in.
    Yay! I get tens of kernel crashes, and only when the option module is loaded.

    I think this is an omission in the option driver - it should set the modes as part of its initialisation. I also suspect this is related to why NM is inconsistent about whether it thinks ports are modems or not.
    Bug?

    3. Unsolicited messages (UMs)

    Both the modem and monitor ports continually stream +ZUSIMR:2 at 2 second intervals, and UMs cause a problem with AT commands. The response to an AT command should be interleaved with the UMs, but it turns out that to guarantee to get the response, you must start reading the port at least 2 secs. before sending the AT command. But modem AT drivers (including in NM) work by sending the command, then reading the response. This results in missed responses, and is the primary reason for NM failing to get an initialisation response to the modem, and hence unable to dial.

    I haven't been able to find out what +ZUSIMR means, but it must be something to do with SMS, because if you issue any version of the AT+CPMS command, the stream of UMs stops permanently on both ports (until you plug the modem in again). As with setting the tty modes, this has a dramatic effect in making the modem reliable.
    You are right, +ZUSIMR: 2 means that the modem does not know where to store the SMS messages. I found that issuing the commands
    Code:
    AT+CPBS="SM"\r\n
    AT+CPMS="SM","SM",""\r\n
    solve this problem until unplugging the modem. However, I cannot test them, since I do not get the +ZUSIMR messages. I believe this is because your operator locked the device. My ZTE MF637 modem is from Orange Moldova - they are very permissive in terms of network settings and the device does not appear to be locked.

    Users of locked MF626 modems report that installing a new firmware for the device solves the +ZUSIMR issue.

    There are other UMs from time to time, mainly those that report the current network and connection mode (+ZDONR & +ZPASR). If you happen to attempt to connect at the moment the modem is issuing one of these then dialling will likely fail, but as these UMs aren't continuous a retry will usually work.
    Good point. Sometimes it just requires a second attempt in order to connect successfully.

    There seem to be several areas that need cleaning up. The option driver certainly looks like one, but I'm sure more could be done with HAL to improve the initialisation. I just don't know enough about HAL to work this out
    We should gather as much useful info as possible and report bugs upstream. As users, this is the right thing to do.

    Thank you for the excellent information! I will try your scripts and report back.

  7. #37
    Join Date
    Dec 2008
    Beans
    27

    Re: Howto: Connect ZTE MF627 3G modem with NM0.7

    Hi, thanks for your comments.

    Apparently, creating UDEV rules is the recommended approach, so HAL .fdi files are not needed any more
    I now understand that HAL is being obsoleted in favour of UDEV, so clearly udev is what needs looking at. I'll see if I can understand udev a bit better!

    +ZUSIMR:2 means that the modem does not know where to store the SMS messages.
    Interesting. It's funny, but any +CPMS command will stop it, even just AT+CPMS, which is illegal and results in ERROR response - still stops +ZUSIMR !

    We should gather as much useful info as possible and report bugs upstream. As users, this is the right thing to do.
    That's what I intend to do, I just need to work out where to report the different bugs !

    Looking forward to hearing how you get on with the scripts.

    Cheers, Rick

  8. #38
    Join Date
    Aug 2008
    Location
    Athens Greece
    Beans
    971
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Howto: Connect ZTE MF627 3G modem with NM0.7

    STOP PRESS!
    Just installed 9.10 (testing, updated 30-Jun-09), 2.6.30-10-generic and tried my ZTE MF636:
    After plugged in, lsusb shows 19d2:2000
    ZeroCD icon appeared, pop up window anounces Software...
    I Eject it (from desktop environment)
    the lsusb changed to 19d2:0031
    two (2) providers found via network manager icon
    I got connected from the 2nd one and ... Everything seems OK!
    ----- ----- -----
    ... and a newer update to kernel 2.6.31-1-generic broke it! The system got frozen!
    We must be patient!
    ----- ----- -----

    Hi, I would like to add the following notes (most are the same as yours):

    My ZTE MF636 ( 19d2:0031 after AT+ZCDRUN=8 ) works with 9.04 after editing HAL info:

    sudo gedit /usr/share/hal/fdi/information/10freedesktop/10-modem.fdi
    search (ctrl-F) for 19d2, after line "<!-- ZTE MF628 HSDPA USB dongle -->" change "usb.product_id" from "0015" to "0031"

    Reboot with the modem attached! Wizard configures 2 modems resulting to 4 "providers" and I am connecting sucessfully using the last one (another one is usable).

    Trying with an RCx kernel I found that when udev fails the system tries the HAL info!

    My opinion is that debugging must be done to a 'cleaner' Operating System (as 8.04) with less or no support of these modems. After determining what 'should be done' somebody must compare 'working' actions with the recent 'buggy' support.

    If you would like to connect from one port and check/debug the other one (working on 8.04 with minicom) take a look at: http://ubuntuforums.org/showpost.php...6&postcount=24
    With above test you can see the 3G/HSPA mode switching and try some commands such as AT+CSQ (GSM signal strength).

    Finally: the modem will NEVER scramble its responds! The 'mess up' showing the 'echo' of your command and the periodic status report can be altered with the ATE0 (echo off). You may use lower case letters to control the modem and get UPPER case results (simple programming). Of course it is better to remove this 'auto reporting' with an AT command, but which one?

    I thing that the problem can be solved from persons knowing the USB protocol. Determining the modem port (query? scanning?) a usbserial device must be created. For minimal support (connection only) only one port is enough. If scanning results to the same product other ports can be ignored. For ZTE the default numbering starts from the end (ZTE comm port = last port)!
    (... if vendorID=0x19d2 port# is MaxPort# else port#=0 ...)

    Regards,
    George
    Last edited by GeorgeVita; July 2nd, 2009 at 07:58 AM. Reason: 'STOP PRESS!' added

  9. #39
    Join Date
    Jul 2005
    Beans
    152

    Re: Howto: Connect ZTE MF627 3G modem with NM0.7

    So - bring the modem to my other jaunty install, install udev-extras and I am up and running in < 30 seconds.

    I can see no difference between my laptop (not working jaunty) and desktop (working jaunty)

    I am going to push laptop to karmic...

  10. #40
    Join Date
    Aug 2008
    Location
    Athens Greece
    Beans
    971
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Howto: Connect ZTE MF627 3G modem with NM0.7

    Hi aa52828,
    to help we have to know more technical info:
    - exact ubuntu version
    - model of modem
    - from terminal try: lsusb (post here the output)
    - which actions and what respond you had
    Regards,
    George

    P.S. my MF636 stopped working with 9.10 (testing) after a kernel update!

Page 4 of 12 FirstFirst ... 23456 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •