Log 4G signal strength on TPLINK MR6400

Hello,
I would like to log my router's (TPLINK MR6400) 4G module signal strength during a few days

  1. to compare 2 SIM cards (different 4G providers) and
  2. to compare various positions of the router in the room

First step is to read the signal strength once, and I am blocked at this step.
I successfully installed OpenWrt and Luci. The router is functionnal and my 4G modem is working under the interface name USB0.

Things I tried :

  • I tried to send AT commands to /dev/ttyUSB0. "AT\r" works (I can read "OK" back), but
    echo -e "at^HCSQ?" >/dev/ttyUSB0
    cat /dev/ttyUSB0
    does not work (no return, I have to use ctrl C).
    adding \r as in echo -e "at^HCSQ?\r" >/dev/ttyUSB0 also does not work.

  • I installed uqmi and followed the guide under https://wiki.openwrt.org/doc/recipes/ltedongle and could not find a device named /dev/cdc-wdm0, so I tried uqmi -d /dev/ttyUSB0 --get-signal-info, but it does not return. Stopping with ctrl C gives : "Failed to connect to service"

  • I tried to check "android debug bridge" commands through launching adb shell, but got lost very quickly, I don't know where to find signal strength there.
    Capture

  • I can login to my LTE module's web interface (following the guide at https://openwrt.org/toh/tp-link/tp-link_tl-mr6400_v1.0#lte_module), and see there a small picture with signal strength. see : Capture2
    Checking the source code gives me some javascript files that I don't know how to read/understand.

I am a bit new to Linux / OpenWRT forum. It took me around 6 hours to install OpenWRT and a few more to check the above. Please be gentle :slight_smile:

I have same hardware and looking for same solution. If somebody want to debug this over me, feel free to contact me.

i have some research and discovered, that this webui is using a json request to fill in Signal Strengh etc.

Here a sample:
URI: http://10.0.0.1:8080/cgi-bin/qcmap_web_cgi (done Portforward to 192.168.0.1:80 internal usb0 modem)

{ "factoryDefault": false, "deviceInfo": { "productID": "64000001", "model": "LTE_MODULE(UN) 1.0", "hardwareVer": "LTE_MODULE(UN) 1.0 v1.0", "firmwareVer": "1.0.7 Build 160317 Rel.2005n", "mac": "00:11:22:33:44:55", "imei": "1234124321345427" }, "battery": { }, "wan": { "dualIPVersionSupport": true, "connectMode": 1, "registerStatus": 1, "connectStatus": 4, "ipv4": "10.181.215.174", "dns1v4": "11.111.111.17", "dns2v4": "11.111.111.18", "ipv6": "0.0.0.0", "dns1v6": "0.0.0.0", "dns2v6": "0.0.0.0", "networkType": 3, "roaming": 0, "signalStrength": 4, "roamingEnabled": false, "totalStatistics": "1234558.000000", "dailyStatistics": "123412.000000", "enablePaymentDay": true, "txSpeed": "28", "rxSpeed": "28", "totalConnTime": "123456", "limitType": 0, "dataLimit": 0, "simStatus": 3, "operator": 10, "operatorName": "E-Plus" }, "wlan": { }, "connectedDevices": { }, "message": { "unreadMessages": 0 }, "sdcard": { "status": 0, "mode": 0, "volume": "", "used": "", "left": "" }, "result": 0 }

Now that struggle: That Json works only as you send a valid token. token is generated while login.
root@root:~# curl -v -H "Content-Type: application/json" -X POST -d '{"token":"63Dw8ubqujFYFf1J","module":"status","action":0}' http://10.10.0.1:8080/cgi-bin/qcmap_web_cgi

Note: Unnecessary use of -X or --request, POST is already inferred.
* Expire in 0 ms for 6 (transfer 0x55da73b03f50)
*   Trying 10.10.0.1...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x55da73b03f50)
* Connected to 10.10.0.1 (10.10.0.1) port 8080 (#0)
> POST /cgi-bin/qcmap_web_cgi HTTP/1.1
> Host: 10.10.0.1:8080
> User-Agent: curl/7.64.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 57
>
* upload completely sent off: 57 out of 57 bytes
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Content-Type: text/html
< Content-Length: 1081
<
{
        "factoryDefault":       false,
        "deviceInfo":   {
                "productID":    "64000001",
                "model":        "LTE_MODULE(UN) 1.0",
                "hardwareVer":  "LTE_MODULE(UN) 1.0 v1.0",
                "firmwareVer":  "1.0.7 Build 160317 Rel.2005n",
                "mac":  "00:11:22:33:44:55",
                "imei": "81231231231231237"
        },
        "battery":      {
},
        "wan":  {
                "dualIPVersionSupport": true,
                "connectMode":  1,
                "registerStatus":       1,
                "connectStatus":        4,
                "ipv4": "0.0.0.0",
                "dns1v4":       "0.0.0.0",
                "dns2v4":       "0.0.0.0",
                "ipv6": "0.0.0.0",
                "dns1v6":       "0.0.0.0",
                "dns2v6":       "0.0.0.0",
                "networkType":  3,
                "roaming":      0,
                "signalStrength":       4,
                "roamingEnabled":       false,
                "totalStatistics":      "37232979.000000",
                "dailyStatistics":      "172573.000000",
                "enablePaymentDay":     true,
                "txSpeed":      "28",
                "rxSpeed":      "28",
                "totalConnTime":        "596635",
                "limitType":    0,
                "dataLimit":    0,
                "simStatus":    3,
                "operator":     10,
                "operatorName": "E-Plus"
        },
        "wlan": {
},
        "connectedDevices":     {
},
        "message":      {
                "unreadMessages":       0
        },
        "sdcard":       {
                "status":       0,
                "mode": 0,
                "volume":       "",
                "used": "",
                "left": ""
        },
        "result":       0
* Closing connection 0

Some more infos:

simpleStatus={moduleName:"status",connStatus:{disable:0,disconnected:1,connecting:2,disconnecting:3,connected:4},
networkType:{noSevrice:0,gsm:1,wcdma:2,lte:3,tdscdma:4,cdma1x:5,cdmaevdo:6},simStatus:{invalid:0,noSim:1,error:2,ready:3,pinReq:4,pinVerified:5,pukReq:6,permanentLock:7},

if anyone can help me to understand how token is generated, feel free to contact me.

BR Daniel

Edit1: Here full Webserver files: https://gofile.io/?c=d7f5Ds

1 Like