Wish List (generally ignored ;-), Brainstorming
Post Reply
CpServiceSpb
Posts: 4
Joined: Tue Oct 22, 2019 9:21 pm

Usb_modeswitch, get imei/imsi, add it as symlinks to ttyUSB.

Post by CpServiceSpb » Tue Oct 22, 2019 9:58 pm

May you add functionality the following functionality:
- switch modem as by now;
- if it is a serial device, get imei/imsi (may be engaging AT command) ;
- according udev rules, create separate symlink for each ttyUSB device by got imei or imsi.

For example:
there is Huawei E367 (non switched) 12d1/1505;
it has some imei;
there is sim card inserted with some imsi.

mode is switched to 12d1/1506, 3 ttyUSB devices is created, imei and/or imsi is got, what is written in udev rule file (may be in /lib/udev/rules.d/40-usb_modeswitch.rules file) and symlink for each ttyUSB device for the device is created: for example E367modem, E367audio, E367diaginterface.

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: Usb_modeswitch, get imei/imsi, add it as symlinks to ttyUSB.

Post by LOM » Wed Oct 23, 2019 2:52 am

Identifying what each serial port is intended for is not a task for usb_modeswitch which is a utility to switch a device but nothing more. You can of course write your own userspace tool to do that for a specific modem.

CpServiceSpb
Posts: 4
Joined: Tue Oct 22, 2019 9:21 pm

Re: Usb_modeswitch, get imei/imsi, add it as symlinks to ttyUSB.

Post by CpServiceSpb » Wed Oct 23, 2019 1:20 pm

I wrote some I called getimei, but there is two difficult things, for me at least.
First, is to identify management ttyUSB interface of modem.
Because of modem may has 2 or 3 serial ttyUSB interfaces and for example Huawei' s management interface is with the lowest number, as for zte, it is with the highest number (at least MF170) , I don' t understand clearly how is to define one ?
Second one is after usb_modeswitch made its function, switched modem, my soft is not engaged until either second restart (with modem already switched) or until reset one (what -R make of) .
It would be better to combine all functional in all in one.

Josh
Site Admin
Posts: 6534
Joined: Sat Nov 03, 2007 12:30 am

Re: Usb_modeswitch, get imei/imsi, add it as symlinks to ttyUSB.

Post by Josh » Sun Nov 10, 2019 12:22 pm

The problem is that there is no common standard how the function of serial ports can be determined. We would end up treating each modem or manufacturer individually. That's really outside the scope of usb_modeswitch.

You might want to look at Redhat's "modem-manager" which is part of "Network Manager". I think they have such individual configurations.

Post Reply