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.
-
- Posts: 4
- Joined: 22 Oct 2019, 21:21
Re: Usb_modeswitch, get imei/imsi, add it as symlinks to ttyUSB.
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.
-
- Posts: 4
- Joined: 22 Oct 2019, 21:21
Re: Usb_modeswitch, get imei/imsi, add it as symlinks to ttyUSB.
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.
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.
Re: Usb_modeswitch, get imei/imsi, add it as symlinks to ttyUSB.
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.
You might want to look at Redhat's "modem-manager" which is part of "Network Manager". I think they have such individual configurations.
Re: Usb_modeswitch, get imei/imsi, add it as symlinks to ttyUSB.
The integration of USB_modeswitch with the capability to spacebar clicker retrieve IMEI/IMSI and subsequently adding them as symlinks to ttyUSB is a crucial enhancement for modem management on Linux systems. This functionality greatly enhances the usability and monitoring of USB-connected modems.