Configuring HP lt4120 in Linux

Configuring HP lt4120 in Linux

As I mentioned in previous post, updating firmware is not enough, modem needs configuration loaded and activated. Unfortunately there was no implementation of the calls in libqmi, so I've spend last few weeks writing code.

I've submitted patches for this calls (96465, 96854, 96855) and this functionality should be soon in upstream.

What you need to start using modem in Linux

For use configuration script you need to install:
  1. Fresh libqmi version with the patches mentioned before
  2. Fastboot from android-tools.  
Also you need to copy udev configuration file 99-hp-lt4120.rules to /etc/udev/rules.d.

Last piece you need is firmware images. You can obtain it from Windows driver directory. In my case I've found it at C:\Program Files (x86)\HP lt4120 Snapdragon X5 LTE\Image

How to use it

After system startup just run script from root. After few minutes you will have you modem configured.

Sometimes you need to make additional configuration. In this case you can change variables in head of the script:
  • DEVICE is modem qmi device. You need to change it only if you have more than one modem in the system.
  • DEVICE_VENDOR is vendor of modem. 0x3f0 is HP.
  • FIRMWARE_VARIANT selects firmware for device. In most cases you can use default firmware, but some mobile networks use specific firmware (e.g. Verison)
  • ACTIVE_CONFIG_ID is configuration for your mobile network. Some mobile networks use default firmware, but specific configurations (e.g. ATT), other use both specific configs and specific firmware. Script lists available configurations during the run. Also you can list them calling qmicli -p -d "$DEVICE" --pdc-list-configs=software from root.

Comments

  1. Hi Aliaksandr,

    thanks for your great guide. I'm finally able to communicate with the modem via qmicli, it's great! But in order to really make it work, I have a few problems/questions and I hope it is ok if I ask them-

    1) when installing kubuntu I completely deleted the windows partition and I do not have access to C:\Program Files (x86)\HP lt4120 Snapdragon X5 LTE\Image or anything like that anmyore. I also tried downloading the related drivers from HP website, but they come as a self-extracting (exe) file and wine refuses to run it (I do not have a windows machine at hand). So is there any chance to get these drivers from somewhere else?

    2) In https://abarouski.blogspot.co.at/2016/06/configuring-hp-lt4120-lte-modem-in.html you mention libqmi_tools. Whilst I have now installed the latest version of libqmi, I do not find anything for libqmi_tools - where can I download it?

    3) I installed libqmi today (Sept 14th 2006) - are your patches already included in this package?

    Sorry for so many questions, I'd be excited if it really would work.

    Thanks a lot for your patience and help.

    Cheers,
    Georg

    ReplyDelete
  2. Hi Greg,

    1. May be https://github.com/borovsky/x5-snapdragon-linux/issues/1 can help you with obtaining files.

    2. Correct name of package is libqmi-utils

    3. It not yet in Ubuntu. Currently I'm working with upstream on including patch to next release.

    Best,
    Alex

    ReplyDelete
    Replies
    1. Hi Alex,

      thanks a lot for your support. I finally came around to test this a bit further and still have one problem.

      I git-cloned https://github.com/borovsky/libqmi, i.e. your version of libqmi. But when executing qmicli it still does not support the calls like --dms-change-device-download-mode or any --pdc option.

      Is there a version available with your patches, which provides these calls?

      Thanks for your help!

      Cheers,
      Georg

      Delete
    2. Hi Alex,

      I compiled your libqmi, but I get

      error: Unknown parameter --dms-change-device-download-mode=5
      [2016-10-03T12:15:09+0300] FATAL: Device not found by fastboot. Something went wrong?

      What could be wrong? I do not have any other modem, there is cdc-wdm0 in /dev directory. Notwork Manager see modem as broadband device...

      Delete
  3. Hi
    I'm experiencing the same issue descrbed in my HP EliteBook 820 G3, with famous lt4120.
    I'm running Fedora 25, with latest updates and libqmi-utils-1.16.2-1.fc25.x86_64.

    Even if I had managed the suggestion from Aliaksandr, I'm still stuck at the beginning.
    I've in place the udev rule, the firmware from HPE (latest one, 1.0.1.66 from HPE site), and the script copy.firmware.sh.
    modprobe from udev rule load the required modules, but mmcli -L show me "No modems found".
    Trying to install he firmware, I've got the message:
    error: Unknown option --dms-change-device-download-mode=5
    and, seconds later:
    FATAL: Device not found by fastboot. Something went wrong?
    Maybe my libqmi-utils aren't updated, but something must be recognized from ModemManager ?
    My laptop is a dual boot stuff, with Win10 and in that OS modem works as expected.

    Any suggestion to try will be really appreciated and tested immediately !
    Thanks for attention
    Roberto

    ReplyDelete
    Replies
    1. Hi Roberto,

      This functionality not released yet in upstream. So you can build package from "master" branch of libqmi.

      Best,
      Alex

      Delete
    2. Hi Aliaksandr

      ok, I will try to learn rapidly how to manage this.
      But let m submit another question: after adding the udev rule and rebooting the laptop, which is the expected behavior ? Must ModemManager recognize the modem ?
      I can successfully send commands via qmicli command to the modem and I receive all functional parameters (for example PROVIDER ID, RSSI etc.) but ModemManager doesn't recognize it.
      Another strange behavior: systemd goes in timeout while shutting down ModemManager during shutdown phase like it cannot be able to communicate with the modem.

      Anyway, thanks for quick answer, seems that you're the only one able to manage this issue.
      Ciao,
      Roberto

      Delete
    3. Thanks for the work with getting the HP lt4120 working in Linux! I'm trying to get it working on Fedora, but so far I have still some issues.

      Note that the call used in the script copy-firmware.sh
      dms-change-device-download-mode
      has been renamed in the upstream libqmi to
      dms-hp-change-device-mode"
      "[qmi|ncm|mbim|fastboot|soft-reset|hard-reset]"
      https://cgit.freedesktop.org/libqmi/commit/?h=qmi-1-18&id=132bd1b0ef5c3b8b9f2544261a9e57e0fd589c14

      The needed libqmi patches became available in libqmi-1.18. On my HP EliteBook 840G3
      qmi-proxy uses 100 % CPU and drains my battery, so it seems that it has some bug. Maybe for this reason the copy-firmware.sh script often fails for me with errors like
      error: couldn't open the QmiDevice: Transaction timed out
      or
      error: couldn't create QmiDevice: Couldn't query file info: Error when getting information for file '/dev/cdc-wdm0': No such file or directory

      Even when the copy-firmwaresh script runs to the end I have not been able to create a network connection. Running the script several times in succession does not also seem to work.

      Delete
    4. I saw the same problems before with Ubuntu 16.10/17.04. Inv (now it works correctly). Investigation lead to some bug between glib and kernel. You can try:
      1. Try to use MBIM mode (to configure modem to this mode you need to change bConfigurationLine to "3" (line 13 of 99-hp-lt4120.rules).
      2. Try to use newer kernel

      Alex

      Delete
    5. Thanks for the MBIM tip! It improves things as I can see the modem with mmcli -L and qmi-proxy does not run with 100 % CPU. I was able to call for the first time with the lt4120 modem, but the connection is for some reason only IPv6 and I don't get any IPv4 address. The IPv6 connection seems to be unstable as it terminates quite soon. I'm using Fedora 25 and the currently available latest kernel version is 4.11.9-200.fc25.x86_64.

      Delete
    6. Have you uploaded firmware using the script? Before I've uploaded firmware I also had only IPv6 (with no real internet access)

      Delete
    7. Yes, I have run your script and it seems to run fine. I'm not sure yet though that the activation step finishes correctly. I found the needed activation code in the script so it should be OK.

      Delete
  4. Hi Alex,

    I'm trying to compile libqmi but something is going wrong. It compiles well but when I run qmicli I get "qmicli: error while loading shared libraries: libqmi-glib.so.5: cannot open shared object file: No such file or directory"

    For compile I run:
    ./autogen.sh
    ./configure --prefix=/usr --disable-static
    make
    make install

    What I am missing...?

    Additionally I modified the line "for SUB_DIR in AT CM DT GC OG OP SC TE TF VF VZ; do" to "for SUB_DIR in GCF; do" in copy-firmware script becouse all firmwares that I've download do not have the "standard" directories.

    I get the firmware from here: ftp://ftp.hp.com/pub/softpaq/sp76001-76500/sp76234.exe

    Cheers,

    ReplyDelete
    Replies
    1. I reply my self due I'm moving forward.
      Now it compiles (from: https://github.com/borovsky/libqmi) well but when I run the script I get:
      "error: Unknown option --dms-change-device-download-mode=5"
      and
      [2017-07-31T13:12:08+02:00] Checking if fastboot device available - attempt 30
      [2017-07-31T13:12:08+02:00] FATAL: Device not found by fastboot. Something went wrong?

      I does not find this option in qmicli --help-dms

      The version of qmicli is: qmicli -V

      qmicli 1.15.0
      Copyright (C) 2015 Aleksander Morgado

      My device is on cdc-wdm1 and I configured the script to this.

      Also y changed to MBIM mode and y get: mmcli -L

      Found 1 modems:
      /org/freedesktop/ModemManager1/Modem/0 [Generic] MBIM [03F0:9D1D]

      Now at system startup it asks for the PIN even before the password :$. If I write the PIN doesn't work aswell --> "policykit authorization failed challenge needed for 'org.freedesktop.ModemManager1.Device.Control'.

      I'am under ubuntu 16.04.

      Thanks for your time and work.

      Delete
  5. Hi Aleksandr,

    I'm one of the HP users with the same problem. That's the only thing that keeps me from getting rid of my Windows dual boot.

    I might just wait for it to make it into Ubuntu 18.04, hopefully, until then I'll just use my mobile as a hotspot.

    Thank you for showing us how to fix it. Maybe I'll try...

    ReplyDelete
  6. Did you ever get it working? I have tried all tips I can find on the net, and nothing works. With the built in firmware it is always disabled, and when I try to upload firmware as you describe, fastboot cannot find the device.
    How do you take the device from disabled to enabled? What does it even mean that MM report it as disabled?
    I even wiped out my linux, installed windows to see if it works (and get the drivers), and yes it does. But no instructions for linux work for me. Has anyone ever gotten it to work on linux?

    -- Karolina Lindqvist

    ReplyDelete

Post a Comment

Popular posts from this blog

Configuring HP lt4120 LTE modem in Ubuntu

Uploading new firmware to HP lt4120 modem