Portál AbcLinuxu, 5. května 2025 21:21
Module Size Used by sg 19905 0 sr_mod 10770 0 cdrom 26487 1 sr_mod fuse 44052 1 loop 9729 0 snd_hda_codec_realtek 163306 1 arc4 974 2 ecb 1405 2 snd_hda_intel 16791 0 snd_hda_codec 46002 2 snd_hda_codec_realtek,snd_hda_intel snd_hwdep 4054 1 snd_hda_codec snd_pcm_oss 28671 0 snd_mixer_oss 10461 1 snd_pcm_oss snd_pcm 47226 3 snd_hda_intel,snd_hda_codec,snd_pcm_oss snd_seq_midi 3576 0 snd_rawmidi 12513 1 snd_seq_midi snd_seq_midi_event 3684 1 snd_seq_midi ath5k 103870 0 snd_seq 35327 2 snd_seq_midi,snd_seq_midi_event i915 222350 2 mac80211 122866 1 ath5k ath 5986 1 ath5k snd_timer 12258 2 snd_pcm,snd_seq option 12602 1 drm_kms_helper 18533 1 i915 snd_seq_device 3673 3 snd_seq_midi,snd_rawmidi,snd_seq usb_wwan 6428 1 option cfg80211 86977 3 ath5k,mac80211,ath usbserial 22032 4 option,usb_wwan drm 111844 3 i915,drm_kms_helper rfkill 10196 1 cfg80211 i2c_i801 6462 0 led_class 1757 1 ath5k i2c_algo_bit 3497 1 i915 usb_storage 30797 0 i2c_core 12751 5 i915,drm_kms_helper,drm,i2c_i801,i2c_algo_bit snd 34387 11 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device evdev 5609 6 button 3598 1 i915 processor 26259 0 soundcore 3450 1 snd snd_page_alloc 4977 2 snd_hda_intel,snd_pcm video 14605 1 i915 output 1204 1 video rng_core 2178 0 pcspkr 1207 0 serio_raw 2916 0 ext4 256232 1 mbcache 3762 1 ext4 jbd2 55931 1 ext4 crc16 1027 1 ext4 sd_mod 25937 3 crc_t10dif 1012 1 sd_mod ata_generic 2247 0 fan 2586 0 ata_piix 17704 2 uhci_hcd 15989 0 libata 115617 2 ata_generic,ata_piix thermal 9206 0 ehci_hcd 28453 0 r8169 25126 0 mii 2714 1 r8169 thermal_sys 9378 4 processor,video,fan,thermal scsi_mod 104593 5 sg,sr_mod,usb_storage,sd_mod,libata usbcore 98613 7 option,usb_wwan,usbserial,usb_storage,uhci_hcd,ehci_hcd nls_base 4541 1 usbcore
rmmod usb_storage sleep 1 rmmod uhci_hcd sleep 1 rmmod ehci_hcd sleep 1 rmmod usbhid sleep 1 rmmod option sleep 1 rmmod usb_wwan sleep 1 rmmod usbserial sleep 1 rmmod usbcore sleep 2 modprobe uhci_hcd sleep 1 modprobe ehci_hcd sleep 2 modprobe usbserial vendor=0x12d1 product=0x140c sleep 1 #switch to modem mode : /lib/udev/usb_modeswitch --vendor 0x12d1 --product 0x1446 --type option-zerocdA stejně nic.
wvdial --> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: AT+CSQ AT+CSQ +CSQ: 19,99 OK --> Sending: AT^U2DIAG=0 AT^U2DIAG=0 OK --> Sending: AT^U2DIAG=? AT^U2DIAG=? ^U2DIAG:The current value is: 0 OK --> Sending: ATX3 ATX3 OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Sending: AT+CFUN=1;+CGDCONT=1,"IP","internet" AT+CFUN=1;+CGDCONT=1,"IP","internet" OK --> Modem initialized. --> Sending: ATD*99# --> Waiting for carrier. ATD*99# NO CARRIER --> No Carrier! Trying again. --> Sending: ATD*99# --> Waiting for carrier. ATD*99# NO CARRIERKaždopdáně jsem si myslel, že pokud je ten usb shit správně přepnut do módu modemu, tak by se snad neměla v logách objevit informace o flash disku + mechanice, viz (nebo se mýlím?):
[ 9463.170641] usbcore: registered new interface driver usbserial [ 9463.170845] USB Serial support registered for generic [ 9463.171072] usbcore: registered new interface driver usbserial_generic [ 9463.171074] usbserial: USB Serial Driver core [ 9463.177852] USB Serial support registered for GSM modem (1-port) [ 9463.178094] option 4-1:1.0: GSM modem (1-port) converter detected [ 9463.178240] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0 [ 9463.178252] option 4-1:1.1: GSM modem (1-port) converter detected [ 9463.178355] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1 [ 9463.178365] option 4-1:1.2: GSM modem (1-port) converter detected [ 9463.178470] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB2 [ 9463.178500] usbcore: registered new interface driver option [ 9463.178502] option: v0.7.2:USB Driver for GSM modems [ 9468.061853] usb-storage: device scan complete [ 9468.064308] scsi 25:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2 [ 9468.065321] usb-storage: device scan complete [ 9468.068864] scsi 26:0:0:0: Direct-Access HUAWEI SD Storage 2.31 PQ: 0 ANSI: 2 [ 9468.081819] sr0: scsi-1 drive [ 9468.081992] sr 25:0:0:0: Attached scsi CD-ROM sr0 [ 9468.082102] sr 25:0:0:0: Attached scsi generic sg1 type 5 [ 9468.083749] sd 26:0:0:0: Attached scsi generic sg2 type 0 [ 9468.099846] sd 26:0:0:0: [sdb] Attached SCSI removable diskKonfigurace wvdial (přidal jsem volání "AT^U2DIAG" a "ATX3" ):
[Dialer Defaults] Modem = /dev/ttyUSB0 Dial Command = ATD Init1 = ATZ Init2 = AT+CSQ Init3 = AT^U2DIAG=0 Init4 = AT^U2DIAG=? Init5 = ATX3 Init6 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Init7 = AT+CFUN=1;+CGDCONT=1,"IP","internet" Phone = *99# Auto DNS = 1 Modem Type = USB Modem Stupid Mode = 1 Ask Password = 0 Baud = 912600 #Baud = 9600 FlowControl = NOFLOW Idle Seconds = 0 Auto Reconnect = 1 Compuserve = 0 ISDN = 0 Username = " " Password = " "Zkusím si více pohrát s modeswitch a resetováním usb odkazovaném níže.
Linux 2.6.32-5-686 #1 SMP
~# usb_modeswitch -R -v 12d1 -p 1001 -H Looking for default devices ... Found devices in default mode or class (1) Accessing device 002 on bus 004 ... Using endpoints 0x01 (out) and 0x82 (in) Using endpoints 0x01 (out) and 0x82 (in) Not a storage device, skipping SCSI inquiry USB description data (for identification) ------------------------- Manufacturer: HUAWEI Technology Product: HUAWEI Mobile Serial No.: not provided ------------------------- Sending Huawei control message ... OK, Huawei control message sent Resetting usb device . OK, device was reset -> Run lsusb to note any changes. Bye.
Zarizeni na USB se da "resetovat" znuvuspustenim enumerace na USB. Myslim, ze jsem kdysi zahledl nejaky command ve stylu "echo 1 > /proc/neco/neco" ktery vynutil enumeraci, ale ted ho nemuzu vygooglit. Jinak treba zkuste
http://linux.mjnet.eu/post/626/how-to-reset-an-usb-device-without-unplugging-linux-from-the-command-line/nano usbreset.c /* usbreset -- send a USB port reset to a USB device */ #include <unistd.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/ioctl.h> #include <linux/usbdevice_fs.h> int main(int argc, char **argv) { const char *filename; int fd; int rc; if (argc != 2) { fprintf(stderr, "Usage: usbreset device-filename\n"); return 1; } filename = argv[1]; fd = open(filename, O_WRONLY); if (fd < 0) { perror("Error opening output file"); return 1; } printf("Resetting USB device %s\n", filename); rc = ioctl(fd, USBDEVFS_RESET, 0); if (rc < 0) { perror("Error in ioctl"); return 1; } printf("Reset successful\n"); close(fd); return 0; }Kompilace + práva :
cc usbreset.c -o usbreset chmod 755 usbresetScript na reset :
cat usbreset-script.sh bus=`lsusb | grep 'Huawei' | awk '{print $2}'` dev=`lsusb | grep 'Huawei' | awk '{print $4}' | awk '{print substr($0,0,4)}'` echo "/dev/bus/usb/$bus/$dev" ./usbreset /dev/bus/usb/$bus/$devVýsledek :
./usbreset-script.sh /dev/bus/usb/004/002 Resetting USB device /dev/bus/usb/004/002 Reset successfuldmesg :
[31142.550187] option: option_instat_callback: error -108 [31142.551594] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2 [31142.551824] option 4-1:1.0: device disconnected [31142.553062] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1 [31142.553283] option 4-1:1.1: device disconnected [31142.554045] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0 [31142.554255] option 4-1:1.2: device disconnected [31142.664039] usb 4-1: reset full speed USB device using uhci_hcd and address 2 [31142.809307] option 4-1:1.2: GSM modem (1-port) converter detected [31142.810036] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0 [31142.811514] option 4-1:1.1: GSM modem (1-port) converter detected [31142.811588] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1 [31142.813878] option 4-1:1.0: GSM modem (1-port) converter detected [31142.813964] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB2Ale připojení stále nic :
--> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: AT+CSQ AT+CSQ +CSQ: 19,99 OK --> Sending: AT^U2DIAG=? AT^U2DIAG=? ^U2DIAG:The current value is: 0 OK --> Sending: ATX3 ATX3 OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Sending: AT+CFUN=1;+CGDCONT=1,"IP","internet" AT+CFUN=1;+CGDCONT=1,"IP","internet" OK --> Modem initialized. --> Sending: ATD*99# --> Waiting for carrier. ATD*99# NO CARRIER --> No Carrier! Trying again. --> Sending: ATD*99# --> Waiting for carrier. ^BOOT:49485530,0,0,0,26 ATD*99# NO CARRIER --> No Carrier! Trying again.Zdar Max
#suspend : echo -n 2 >/sys/bus/usb/devices/.../power/state #probuzeni : echo -n 0 >/sys/bus/usb/devices/.../power/stateTakže takto už asi ne.
cat /sys/bus/usb/devices/usb4/power/level auto cat /sys/bus/usb/devices/usb4/power/autosuspend 2Navrhoval bych vypnout a zkusit, zda to za těch pár dní zase vytuhne.
for i in /sys/bus/usb/devices/usb* ; do echo "0" > $i/power/autosuspend; done for i in /sys/bus/usb/devices/usb* ; do echo "on" > $i/power/level; doneViz význam :
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.