Здравствуйте, есть два проблемных устройства с проблемой 4g. До этого эти два устройства работали стабильно, но через какой-то промежуток времени usb0 перестал подниматься.
Характеристика устройств и их настройка связи:
Первое устройство :
Спойлер
Debian GNU/Linux 9
Wiren Board 6.9.1 (s/n AVJYU2EN), release wb-2207 (as stable)
Linux *** 5.10.35-wb120+wb101 #2 Tue Nov 22 12:48:20 UTC 2022 armv7l GNU/Linux
wb-utils Version: 3.7.0-wb108
Второе устройство было сброшено для проверки того устранилась ли данная проблема в обновлениях, но проблема не решилась.
Второе устройство :
Спойлер
Debian GNU/Linux 11
Wiren Board 6.9.1 (s/n ARGTA4VK), release wb-2307 (as stable)
Linux wirenboard-ARGTA4VK 5.10.35-wb142 #1 Thu Jul 20 07:59:09 UTC 2023 armv7l GNU/Linux
wb-utils Version: 4.12.0-wb107
Как изначально были настроены устройства:
Спойлер
echo “source-directory /etc/network/interfaces.d” >> /etc/network/interfaces
cat <<‘EOF’ > /etc/network/interfaces.d/usb0
4G/LTE MODEM:
auto usb0
allow-hotplug usb0
iface usb0 inet dhcp
for beeline:
#apn internet.beeline.ru
for megafon:
#apn internet
for mts:
#apn internet.mts.ru
for tele2:
apn ****.tele2.ru
pre-up wb-gsm restart_if_broken
pre-up /usr/sbin/chat -s TIMEOUT 20 ABORT “ERROR” ECHO ON “” “AAAAAAAAAAAAAT” OK “AT+CPIN?” OK “AT+USBNETIP=1” OK “AT+CMGF=1” OK “AT+DIALMODE=0” OK “AT+CGDCONT=1,"IP","${IF_APN:-internet}"” OK “AT+CGCONTRDP” “OK” > /dev/ttyGSM < /dev/ttyGSM
pre-up sleep 10
EOF
Спойлер
cat <<‘EOF’ > /root/gsm_autoconnect.sh
#!/bin/sh
echo --------------- --------------- --------------- –
echo $(date)
echo --------------- --------------- --------------- –
echo GSM CONTROLL RESTART
echo --------------- --------------- --------------- –
PINGRESORCE2=“...”
PINGRESORCE1=“...”
if (! ping -q -c3 ${PINGRESORCE1} > /dev/null 2>&1)
then
if (! ping -q -c3 ${PINGRESORCE2} > /dev/null 2>&1)
then
echo ---------------ping ... --------------- --------------- –
! ping -q -c3 ${PINGRESORCE1} >> /var/log/gsm.log 2>&1;
echo ---------------ping ... --------------- --------------- –
! ping -q -c3 ${PINGRESORCE2} >> /var/log/gsm.log 2>&1;
echo --------------- --------------- --------------- –
echo “$(date) wb-gsm off”;
DEBUG=TRUE wb-gsm off >> /var/log/gsm.log 2>&1;
echo --------------- --------------- --------------- –
echo “$(date) restart”;
DEBUG=TRUE wb-gsm restart_if_broken >> /var/log/gsm.log 2>&1;
echo --------------- --------------- --------------- –
echo “$(date) ifup usb0”;
ifup usb0 >> /var/log/gsm.log 2>&1;
echo ---------------ping ... --------------- --------------- –
! ping -q -c3 ${PINGRESORCE1} >> /var/log/gsm.log 2>&1;
echo ---------------ping ... --------------- --------------- –
! ping -q -c3 ${PINGRESORCE2} >> /var/log/gsm.log 2>&1;
echo --------------- --------------- --------------- –
echo “$(date) end script”
echo --------------- --------------- --------------- –
else
echo ---------------ping ... --------------- --------------- –
! ping -q -c3 ${PINGRESORCE1} >> /var/log/gsm.log 2>&1;
echo ---------------ping ... --------------- --------------- –
! ping -q -c3 ${PINGRESORCE2} >> /var/log/gsm.log 2>&1;
echo --------------- --------------- --------------- –
echo “internet ok”;
echo “$(date) end script”;
fi
else
echo ---------------ping ... --------------- --------------- –
! ping -q -c3 ${PINGRESORCE1} >> /var/log/gsm.log 2>&1;
echo ---------------ping ... --------------- --------------- –
! ping -q -c3 ${PINGRESORCE2} >> /var/log/gsm.log 2>&1;
echo --------------- --------------- --------------- –
echo “internet ok”;
echo “$(date) end script”
fi
EOF
chmod +x /root/gsm_autoconnect.sh
В крон табе */5 * * * * root /root/gsm_autoconnect.sh >> /var/log/gsm.log 2>&1
Ошибка:
Спойлер
DEBUG: wb_of_parse: Parsing hardware-specific environment from OF
DEBUG: of_get_prop_gpio: /wirenboard/gpios/A1_OUT io-gpios
DEBUG: of_get_prop_gpio: gpio 34 15 0
DEBUG: of_gpio_to_num: Unpacked gpio 64:15:0 → 64+15
DEBUG: of_get_prop_gpio: /wirenboard/gpios/A4_IN io-gpios
DEBUG: of_get_prop_gpio: gpio 34 27 1
DEBUG: of_gpio_to_num: Unpacked gpio 64:27:1 → 64+27
DEBUG: of_get_prop_gpio: /wirenboard/gpios/A1_IN io-gpios
DEBUG: of_get_prop_gpio: gpio 34 14 1
DEBUG: of_gpio_to_num: Unpacked gpio 64:14:1 → 64+14
DEBUG: of_get_prop_gpio: /wirenboard/gpios/5V_OUT io-gpios
DEBUG: of_get_prop_gpio: gpio 42 27 0
DEBUG: of_gpio_to_num: Unpacked gpio 0:27:0 → 0+27
DEBUG: of_get_prop_gpio: /wirenboard/gpios/A2_OUT io-gpios
DEBUG: of_get_prop_gpio: gpio 34 16 0
DEBUG: of_gpio_to_num: Unpacked gpio 64:16:0 → 64+16
DEBUG: of_get_prop_gpio: /wirenboard/gpios/A3_IN io-gpios
DEBUG: of_get_prop_gpio: gpio 34 28 1
DEBUG: of_gpio_to_num: Unpacked gpio 64:28:1 → 64+28
DEBUG: of_get_prop_gpio: /wirenboard/gpios/A3_OUT io-gpios
DEBUG: of_get_prop_gpio: gpio 34 17 0
DEBUG: of_gpio_to_num: Unpacked gpio 64:17:0 → 64+17
DEBUG: of_get_prop_gpio: /wirenboard/gpios/V_OUT io-gpios
DEBUG: of_get_prop_gpio: gpio 34 9 0
DEBUG: of_gpio_to_num: Unpacked gpio 64:9:0 → 64+9
DEBUG: of_get_prop_gpio: /wirenboard/gpios/V_OUT_OK io-gpios
DEBUG: of_get_prop_gpio: gpio 34 8 0
DEBUG: of_gpio_to_num: Unpacked gpio 64:8:0 → 64+8
DEBUG: of_get_prop_gpio: /wirenboard/gpios/A2_IN io-gpios
DEBUG: of_get_prop_gpio: gpio 34 13 1
DEBUG: of_gpio_to_num: Unpacked gpio 64:13:1 → 64+13
DEBUG: of_get_prop_gpio: /wirenboard/gpios/A4_OUT io-gpios
DEBUG: of_get_prop_gpio: gpio 34 18 0
DEBUG: of_gpio_to_num: Unpacked gpio 64:18:0 → 64+18
DEBUG: of_get_prop_gpio: //soc/bus@2100000/usb@2184200/usb-hub@1/wbc-modem@2 power-gpios
DEBUG: of_get_prop_gpio: gpio 33 4 0
DEBUG: of_gpio_to_num: Unpacked gpio 128:4:0 → 128+4
DEBUG: of_get_prop_gpio: //soc/bus@2100000/usb@2184200/usb-hub@1/wbc-modem@2 pwrkey-gpios
DEBUG: of_get_prop_gpio: gpio 34 20 0
DEBUG: of_gpio_to_num: Unpacked gpio 64:20:0 → 64+20
DEBUG: of_get_prop_gpio: //soc/bus@2100000/usb@2184200/usb-hub@1/wbc-modem@2 status-gpios
DEBUG: of_get_prop_gpio: gpio 34 19 1
DEBUG: of_gpio_to_num: Unpacked gpio 64:19:1 → 64+19
DEBUG: of_get_prop_gpio: //soc/bus@2100000/usb@2184200/usb-hub@1/wbc-modem@2 simselect-gpios
DEBUG: of_get_prop_gpio: gpio 34 24 0
DEBUG: of_gpio_to_num: Unpacked gpio 64:24:0 → 64+24
DEBUG: main: Called from pid 29142 (gsm_autoconnect)
DEBUG: guess_of_node: Got of_gsm_node: /soc/bus@2100000/usb@2184200/usb-hub@1/wbc-modem@2
DEBUG: restart_if_broken: Modem switched off, switch it on instead of testing the connection
DEBUG: ensure_on: switching on GSM modem using POWER FET
DEBUG: toggle: toggle GSM modem state using PWRKEY
DEBUG: ensure_on: Waiting for modem to start
DEBUG: init_usb_connection: Will wait up to 30s untill usb port becomes available
Turning OFF modem’s POWER FET
DEBUG: of_get_prop_gpio: /soc/bus@2100000/usb@2184200/usb-hub@1/wbc-modem@2 power-gpios
DEBUG: of_get_prop_gpio: gpio 33 4 0
DEBUG: of_gpio_to_num: Unpacked gpio 128:4:0 → 128+4
Force exit: no usb device after 30s
1: /usr/lib/wb-utils/wb-gsm-common.sh:518 init_usb_connection(…)
2: /usr/lib/wb-utils/wb-gsm-common.sh:554 ensure_on(…)
3: /usr/bin/wb-gsm:29 restart_if_broken(…)
Error in /usr/lib/wb-utils/wb-gsm-common.sh:71. ‘[[ -n $unlinked_ports ]]’ exited with status 0
Call tree:
1: /usr/lib/wb-utils/wb-gsm-common.sh:1 force_exit_handler(…)
2: /usr/lib/wb-utils/wb-gsm-common.sh:165 force_exit(…)
3: /usr/lib/wb-utils/wb-gsm-common.sh:518 init_usb_connection(…)
4: /usr/lib/wb-utils/wb-gsm-common.sh:554 ensure_on(…)
5: /usr/bin/wb-gsm:29 restart_if_broken(…)
Exiting with status 1
Сейчас gsm не поднимается совсем:
Спойлер
Sep 5 12:18:54 kernel: [ 1023.395667] usb 2-1.3: new high-speed USB device number 62 using ci_hdrc
Sep 5 12:18:54 kernel: [ 1023.551059] usb 2-1.3: New USB device found, idVendor=1286, idProduct=812a, bcdDevice= 0.00
Sep 5 12:18:54 kernel: [ 1023.559601] usb 2-1.3: New USB device strings: Mfr=3, Product=2, SerialNumber=0
Sep 5 12:18:54 kernel: [ 1023.567134] usb 2-1.3: Product: WUKONG
Sep 5 12:18:54 kernel: [ 1023.570967] usb 2-1.3: Manufacturer: MARVELL
Sep 5 12:18:55 kernel: [ 1023.871922] usb 2-1.3: USB disconnect, device number 62
Sep 5 12:18:56 wb-rules[1974]: Error: Write start address failed, return code -1
Sep 5 12:18:59 wb-rules[1974]: Error: Write start address failed, return code -1
Sep 5 12:19:01 kernel: [ 1030.056165] usb 2-1.3: new high-speed USB device number 63 using ci_hdrc
Sep 5 12:19:01 kernel: [ 1030.216374] usb 2-1.3: config 1 has an invalid interface number: 5 but max is 4
Sep 5 12:19:01 kernel: [ 1030.223744] usb 2-1.3: config 1 has no interface number 3
Sep 5 12:19:01 kernel: [ 1030.245492] usb 2-1.3: New USB device found, idVendor=1e0e, idProduct=9011, bcdDevice= 1.00
Sep 5 12:19:01 kernel: [ 1030.253937] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep 5 12:19:01 kernel: [ 1030.261312] usb 2-1.3: Product: Mobile Composite Device Bus
Sep 5 12:19:01 kernel: [ 1030.266914] usb 2-1.3: Manufacturer: Marvell
Sep 5 12:19:01 kernel: [ 1030.271191] usb 2-1.3: SerialNumber: 200806006809080000
Sep 5 12:19:01 kernel: [ 1030.328972] rndis_host 2-1.3:1.0 usb0: register ‘rndis_host’ at usb-ci_hdrc.1-1.3, RNDIS device, 36:33:a9:21:61:d3
Sep 5 12:19:01 kernel: [ 1030.374288] option 2-1.3:1.2: GSM modem (1-port) converter detected
Sep 5 12:19:01 kernel: [ 1030.393957] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB0
Sep 5 12:19:01 kernel: [ 1030.416820] option 2-1.3:1.4: GSM modem (1-port) converter detected
Sep 5 12:19:01 kernel: [ 1030.437840] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB1
Sep 5 12:19:01 kernel: [ 1030.466153] option 2-1.3:1.5: GSM modem (1-port) converter detected
Sep 5 12:19:01 kernel: [ 1030.485742] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB2
Sep 5 12:19:02 kernel: [ 1030.783749] usb 2-1.3: USB disconnect, device number 63
Sep 5 12:19:02 kernel: [ 1030.799618] rndis_host 2-1.3:1.0 usb0: unregister ‘rndis_host’ usb-ci_hdrc.1-1.3, RNDIS device
Sep 5 12:19:02 kernel: [ 1030.825208] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
Sep 5 12:19:02 kernel: [ 1030.864533] option 2-1.3:1.2: device disconnected
Sep 5 12:19:02 kernel: [ 1030.870139] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
Sep 5 12:19:02 kernel: [ 1030.883722] option 2-1.3:1.4: device disconnected
Sep 5 12:19:02 kernel: [ 1030.895472] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
Sep 5 12:19:02 kernel: [ 1030.917485] option 2-1.3:1.5: device disconnected
Если необходима дополнительная информация по устройствам или необходимо скинуть что-то дополнительно дайте знать.