Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
zteDev
Posts: 7
Joined: 02 Nov 2015, 09:46

Huawei 1f1c Need serial mode, not cdc-ether

Post by zteDev » 06 May 2017, 12:01

I need to read the sim ICCID of the sim card from the modem. I can do it with one of these commands:

AT+CCID or AT+ICCID

However, I cannot get the modem into serial mode (I never see any /dev/ttyUSBx devices, before or after switching). It seems the command I use to switch from CDROM mode:

usb_modeswitch -v 12d1 -p 1f1c -W -I -M 55534243123456780000000000000011062000000101000100000000000000

switches the modem directly into CDC mode and initialises the cdc-ether device on port eth1.
There is no need to run wvdial (which would have used AT commands ...)
This is a hi speed mode that emulates ethernet, but doesn't allow AT commands to be sent to the modem.

Is there any way I can switch the modem into PPP mode to use AT commands, or any other way known to read the ICCID from the sim card using this specific modem?

I have about 20 of these modems in the field, some is far away cities and I need to get the ICCID's...

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Huawei 1f1c Need serial mode, not cdc-ether

Post by LOM » 06 May 2017, 13:09

Take a look at:
http://www.mrt-prodz.com/blog/view/2015 ... an-monitor

/api/device/information contains the Iccid

zteDev
Posts: 7
Joined: 02 Nov 2015, 09:46

Huawei 1f1c hardware, firmware and sim information

Post by zteDev » 07 May 2017, 15:51

Wow that was helpful thanks! In the end I found My modem's local IP is 192.168.9.1 and I can wget this call without logging in to the modem:

192.168.9.1/api/device/information, which replies with:

<?xml version="1.0" encoding="UTF-8"?>
<response>
<DeviceName>K4203</DeviceName>
<SerialNumber>W8DDW1612000xxxx</SerialNumber>
<Imei>3585670xxxxxxxx</Imei>
<Imsi>6550127xxxxxxxx</Imsi>
<Iccid>89278000000006xxxxxx</Iccid>
<Msisdn></Msisdn>
<HardwareVersion>CH1E3531SM</HardwareVersion>
<SoftwareVersion>4.1</SoftwareVersion>
<WebUIVersion>2.032.8341</WebUIVersion>
<Uptime>3412</Uptime>
<ImeiSvn>03</ImeiSvn>
<MacAddress1>BA:AB:BE:34:00:00</MacAddress1>
<MacAddress2></MacAddress2>
<ProductFamily>GW</ProductFamily>
<Classify>DataCard</Classify>
<supportmode></supportmode>
<workmode>WCDMA</workmode>
</response>


So the final command was just:

wget -q --timeout=1 -O - "192.168.9.1/api/device/information" | grep Iccid

Explanation:
- wget does a normal http call to the url specified
- by default it saves the return html page in a file
- we override that with the -O - to send the return to stdout
- we pipe the returned XML to grep and search for the string iccid
final return looks like this:

<Iccid>89278000000006489484</Iccid>

Thanks again :)

Post Reply