Author Message

<  Setup Discussion  ~  Huawei 1f1c Need serial mode, not cdc-ether

PostPosted: Sat May 06, 2017 12:01 pm Reply with quote
Posts: 7 Joined: Mon Nov 02, 2015 9:46 am
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...


Offline
PostPosted: Sat May 06, 2017 1:09 pm Reply with quote
Posts: 1166 Joined: Wed Jul 11, 2012 3:14 pm Location: Koh Samui, TH
Take a look at:
http://www.mrt-prodz.com/blog/view/2015 ... an-monitor

/api/device/information contains the Iccid


Offline
PostPosted: Sun May 07, 2017 3:51 pm Reply with quote
Posts: 7 Joined: Mon Nov 02, 2015 9:46 am
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 :)


Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
3 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum