nerves-networking / vintage_net_mobile

Mobile networking for VintageNet
Apache License 2.0
27 stars 11 forks source link

Huawei E3372 with different PID, what to do about it? #119

Open dognotdog opened 2 years ago

dognotdog commented 2 years ago

Describe the bug A Huawei E3372 modem I have has a pid of 0x1F01 instead of 0x14FE as what the driver currently expects.

What should be done about this? Clearly, making the PID configurable would work to some extent, but that would still make it a guessing game, if one doesn't already know what PID the modem has.

What would be a good way to make this automatic?

fhunleth commented 2 years ago

I don't think this is going to be pretty. The only options I can think about right now are trying usb_modeswitch blindly with the possible pids or implementing a function to go through the VID:PIDs of all attached USB devices and running the right one. I haven't thought through the first option enough. See https://github.com/elixir-toolshed/toolshed/blob/main/lib/toolshed/hw.ex for some sample code for the second option.

dognotdog commented 2 years ago

Digging a little further, the 0x1F01 is the HiLink E3372h variant of the modem, which is newer firmware.

usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000a11062000000000000100000000000000'"

works with it, and it brings up eth0, but at that point the modem presents a captive portal, and I'm not sure how to proceed, yet.

gabrielmancini commented 2 years ago

same problem here with other modem but same family (Huawei E3272): the pid is 0x157c and 158e, i implemented it, the ports are at: ttyUSB0 ppp: ttyUSB1, i had a throuble with power_off command, and the modem not response anything... but it connects on 19:17:25.239

logs:

Interactive Elixir (1.13.1) - press Ctrl+C to exit (type h() ENTER for help)
████▄▄    ▐███
█▌  ▀▀██▄▄  ▐█
█▌  ▄▄  ▀▀  ▐█   N  E  R  V  E  S
█▌  ▀▀██▄▄  ▐█
███▌    ▀▀████
fw 0.1.0 (7d14c72f-cf62-5dd6-ed17-1e7b1c5e279b) arm rpi3
  Uptime       : 18 seconds
  Clock        : 2022-01-20 19:15:20 -03

  Firmware     : Valid (B)               Applications : 49 started
  Memory usage : 61 MB (7%)              Part usage   : 0 MB (0%)
  Hostname     : nerves-1bf6             Load average : 0.13 0.03 0.01

  wlan0        : 192.168.15.15/24, fe80::ba27:ebff:feac:4ea3/64

Nerves CLI help: https://hexdocs.pm/nerves/using-the-cli.html

Toolshed imported. Run h(Toolshed) for more info.
iex(1)> RingLogger.next

00:00:07.807 [info]  Booting Linux on physical CPU 0x0

00:00:07.807 [info]  Linux version 5.10.63 (buildroot@buildroot) (armv7-nerves-linux-gnueabihf-gcc (crosstool-NG 1.24.0.299_6729a76) 10.2.0, GNU ld (crosstool-NG 1.24.0.299_6729a76) 2.36.1) #1 SMP PREEMPT Sat Nov 27 12:18:01 -03 2021

00:00:07.808 [info]  CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d

00:00:07.808 [info]  CPU: div instructions available: patching division code

00:00:07.808 [info]  CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

00:00:07.808 [info]  OF: fdt: Machine model: Raspberry Pi 3 Model B Plus Rev 1.3

00:00:07.809 [info]  Memory policy: Data cache writealloc

00:00:07.809 [info]  Reserved memory: created CMA memory pool at 0x30000000, size 64 MiB

00:00:07.809 [info]  OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool

00:00:07.809 [info]  Zone ranges:

00:00:07.811 [info]    DMA      [mem 0x0000000000000000-0x0000000033ffffff]

00:00:07.811 [info]    Normal   empty

00:00:07.812 [info]  Movable zone start for each node

00:00:07.812 [info]  Early memory node ranges

00:00:07.812 [info]    node   0: [mem 0x0000000000000000-0x0000000033ffffff]

00:00:07.812 [info]  Initmem setup node 0 [mem 0x0000000000000000-0x0000000033ffffff]

00:00:07.813 [debug] On node 0 totalpages: 212992

00:00:07.813 [debug]   DMA zone: 1872 pages used for memmap

00:00:07.813 [debug]   DMA zone: 0 pages reserved

00:00:07.813 [debug]   DMA zone: 212992 pages, LIFO batch:63

00:00:07.813 [info]  percpu: Embedded 15 pages/cpu s30348 r8192 d22900 u61440

00:00:07.813 [debug] pcpu-alloc: s30348 r8192 d22900 u61440 alloc=15*4096

00:00:07.814 [debug] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 

00:00:07.814 [info]  Built 1 zonelists, mobility grouping on.  Total pages: 211120

00:00:07.814 [info]  Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=tty1 fbcon=scrollback:1024k root=/dev/mmcblk0p2 rootwait consoleblank=0 quiet

00:00:07.815 [warn]  Ignoring scrollback size option

00:00:07.815 [info]  Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)

00:00:07.815 [info]  Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)

00:00:07.815 [info]  mem auto-init: stack:off, heap alloc:off, heap free:off

00:00:07.815 [info]  Memory: 766440K/851968K available (6144K kernel code, 600K rwdata, 1128K rodata, 1024K init, 371K bss, 19992K reserved, 65536K cma-reserved)

00:00:07.816 [info]  random: get_random_u32 called from cache_random_seq_create+0x88/0x15c with crng_init=0

00:00:07.816 [info]  SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1

00:00:07.816 [info]  rcu: Preemptible hierarchical RCU implementation.

00:00:07.816 [info]  rcu: \x09RCU event tracing is enabled.

00:00:07.816 [info]  \x09Trampoline variant of Tasks RCU enabled.

00:00:07.816 [info]  rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.

00:00:07.817 [info]  NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16

00:00:07.817 [info]  arch_timer: cp15 timer(s) running at 19.20MHz (phys).

00:00:07.817 [info]  clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns

00:00:07.818 [info]  sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns

00:00:07.818 [info]  Switching to timer-based delay loop, resolution 52ns

00:00:07.818 [info]  Console: colour dummy device 80x30

00:00:07.818 [info]  printk: console [tty1] enabled

00:00:07.818 [info]  Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)

00:00:07.819 [info]  pid_max: default: 32768 minimum: 301

00:00:07.819 [info]  Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)

00:00:07.819 [info]  Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)

00:00:07.819 [info]  cgroup: Disabling memory control group subsystem

00:00:07.819 [info]  CPU: Testing write buffer coherency: ok

00:00:07.821 [info]  CPU0: thread -1, cpu 0, socket 0, mpidr 80000000

00:00:07.821 [info]  Setting up static identity map for 0x100000 - 0x10003c

00:00:07.822 [info]  rcu: Hierarchical SRCU implementation.

00:00:07.822 [info]  smp: Bringing up secondary CPUs ...

00:00:07.822 [info]  CPU1: thread -1, cpu 1, socket 0, mpidr 80000001

00:00:07.822 [info]  CPU2: thread -1, cpu 2, socket 0, mpidr 80000002

00:00:07.822 [info]  CPU3: thread -1, cpu 3, socket 0, mpidr 80000003

00:00:07.823 [info]  smp: Brought up 1 node, 4 CPUs

00:00:07.823 [info]  SMP: Total of 4 processors activated (153.60 BogoMIPS).

00:00:07.823 [info]  CPU: All CPU(s) started in HYP mode.

00:00:07.823 [info]  CPU: Virtualization extensions available.

00:00:07.823 [info]  devtmpfs: initialized

00:00:07.823 [info]  VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4

00:00:07.824 [info]  clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns

00:00:07.824 [info]  futex hash table entries: 1024 (order: 4, 65536 bytes, linear)

00:00:07.824 [info]  pinctrl core: initialized pinctrl subsystem

00:00:07.825 [info]  NET: Registered protocol family 16

00:00:07.825 [info]  DMA: preallocated 1024 KiB pool for atomic coherent allocations

00:00:07.825 [info]  thermal_sys: Registered thermal governor 'step_wise'

00:00:07.825 [info]  Serial: AMBA PL011 UART driver

00:00:07.825 [info]  printk: console [ramoops-1] enabled

00:00:07.826 [info]  pstore: Registered ramoops as persistent store backend

00:00:07.826 [info]  ramoops: using 0x100000@0xb000000, ecc: 16

00:00:07.826 [info]  bcm2835-mbox 3f00b880.mailbox: mailbox enabled

00:00:07.826 [info]  raspberrypi-firmware soc:firmware: Attached to firmware from 2021-09-30T19:23:18, variant start_x

00:00:07.827 [info]  raspberrypi-firmware soc:firmware: Firmware hash is 51215b4f6e3966401ecd99652a35cf1c25069113

00:00:07.827 [info]  bcm2835-dma 3f007000.dma: DMA legacy API manager, dmachans=0x1

00:00:07.827 [info]  SCSI subsystem initialized

00:00:07.828 [info]  usbcore: registered new interface driver usbfs

00:00:07.828 [info]  usbcore: registered new interface driver hub

00:00:07.828 [info]  usbcore: registered new device driver usb

00:00:07.828 [info]  clocksource: Switched to clocksource arch_sys_counter

00:00:07.828 [info]  NET: Registered protocol family 2

00:00:07.828 [info]  IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)

00:00:07.829 [info]  tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)

00:00:07.829 [info]  TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)

00:00:07.829 [info]  TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)

00:00:07.829 [info]  TCP: Hash tables configured (established 8192 bind 8192)

00:00:07.829 [info]  UDP hash table entries: 512 (order: 2, 16384 bytes, linear)

00:00:07.830 [info]  UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)

00:00:07.830 [info]  NET: Registered protocol family 1

00:00:07.831 [info]  Initialise system trusted keyrings

00:00:07.831 [info]  workingset: timestamp_bits=14 max_order=18 bucket_order=4

00:00:07.831 [info]  squashfs: version 4.0 (2009/01/31) Phillip Lougher

00:00:07.831 [info]  Key type asymmetric registered

00:00:07.832 [info]  Asymmetric key parser 'x509' registered

00:00:07.832 [info]  Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)

00:00:07.832 [info]  bcm2708_fb soc:fb: FB found 1 display(s)

00:00:07.832 [info]  Console: switching to colour frame buffer device 228x61

00:00:07.832 [info]  bcm2708_fb soc:fb: Registered framebuffer for display 0, size 1824x984

00:00:07.833 [info]  Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled

00:00:07.833 [info]  bcm2835-rng 3f104000.rng: hwrng registered

00:00:07.833 [info]  vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)

00:00:07.834 [info]  gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000

00:00:07.834 [info]  brd: module loaded

00:00:07.834 [info]  loop: module loaded

00:00:07.835 [info]  Loading iSCSI transport class v2.0-870.

00:00:07.835 [info]  dwc_otg: version 3.00a 10-AUG-2012 (platform bus)

00:00:07.835 [warn]  Core Release: 2.80a

00:00:07.835 [warn]  Setting default values for core params

00:00:07.835 [warn]  Finished setting default values for core params

00:00:07.835 [warn]  Using Buffer DMA mode

00:00:07.836 [warn]  Periodic Transfer Interrupt Enhancement - disabled

00:00:07.836 [warn]  Multiprocessor Interrupt Enhancement - disabled

00:00:07.836 [warn]  OTG VER PARAM: 0, OTG VER FLAG: 0

00:00:07.836 [warn]  Dedicated Tx FIFOs mode

00:00:07.837 [warn]  

00:00:07.837 [warn]  WARN::dwc_otg_hcd_init:1072: FIQ DMA bounce buffers: virt = b0114000 dma = 0xf0114000 len=9024

00:00:07.837 [warn]  FIQ FSM acceleration enabled for :\x0aNon-periodic Split Transactions\x0aPeriodic Split Transactions\x0aHigh-Speed Isochronous Endpoints\x0aInterrupt/Control Split Transaction hack enabled

00:00:07.838 [debug] dwc_otg: Microframe scheduler enabled

00:00:07.838 [warn]  

00:00:07.838 [warn]  WARN::hcd_init_fiq:457: FIQ on core 1

00:00:07.838 [warn]  

00:00:07.838 [warn]  WARN::hcd_init_fiq:458: FIQ ASM at 804e3b5c length 36

00:00:07.838 [warn]  

00:00:07.839 [warn]  WARN::hcd_init_fiq:496: MPHI regs_base at b4810000

00:00:07.839 [info]  dwc_otg 3f980000.usb: DWC OTG Controller

00:00:07.839 [info]  dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1

00:00:07.839 [info]  dwc_otg 3f980000.usb: irq 89, io mem 0x00000000

00:00:07.840 [warn]  Init: Port Power? op_state=1

00:00:07.840 [warn]  Init: Power Port (0)

00:00:07.840 [info]  usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10

00:00:07.840 [info]  usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

00:00:07.841 [info]  usb usb1: Product: DWC OTG Controller

00:00:07.841 [info]  usb usb1: Manufacturer: Linux 5.10.63 dwc_otg_hcd

00:00:07.841 [info]  usb usb1: SerialNumber: 3f980000.usb

00:00:07.841 [info]  hub 1-0:1.0: USB hub found

00:00:07.841 [info]  hub 1-0:1.0: 1 port detected

00:00:07.842 [debug] dwc_otg: FIQ enabled

00:00:07.842 [debug] dwc_otg: NAK holdoff enabled

00:00:07.842 [debug] dwc_otg: FIQ split-transaction FSM enabled

00:00:07.843 [debug] Module dwc_common_port init

00:00:07.843 [info]  usbcore: registered new interface driver cdc_acm

00:00:07.843 [info]  cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

00:00:07.843 [info]  usbcore: registered new interface driver usb-storage

00:00:07.843 [info]  usbcore: registered new interface driver usbserial_generic

00:00:07.844 [info]  usbserial: USB Serial support registered for generic

00:00:07.844 [info]  usbcore: registered new interface driver ch341

00:00:07.844 [info]  usbserial: USB Serial support registered for ch341-uart

00:00:07.844 [info]  usbcore: registered new interface driver cp210x

00:00:07.844 [info]  usbserial: USB Serial support registered for cp210x

00:00:07.845 [info]  usbcore: registered new interface driver ftdi_sio

00:00:07.845 [info]  usbserial: USB Serial support registered for FTDI USB Serial Device

00:00:07.845 [info]  i2c /dev entries driver

00:00:07.845 [info]  Driver for 1-wire Dallas network protocol.

00:00:07.845 [info]  bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer

00:00:07.846 [info]  sdhci: Secure Digital Host Controller Interface driver

00:00:07.846 [info]  sdhci: Copyright(c) Pierre Ossman

00:00:07.846 [info]  mmc-bcm2835 3f300000.mmcnr: could not get clk, deferring probe

00:00:07.846 [info]  sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe

00:00:07.846 [info]  sdhci-pltfm: SDHCI platform and OF driver helper

00:00:07.847 [info]  ledtrig-cpu: registered to indicate activity on CPUs

00:00:07.847 [info]  hid: raw HID events driver (C) Jiri Kosina

00:00:07.847 [info]  usbcore: registered new interface driver usbhid

00:00:07.847 [info]  usbhid: USB HID core driver

00:00:07.848 [info]  NET: Registered protocol family 10

00:00:07.848 [info]  Segment Routing with IPv6

00:00:07.849 [info]  NET: Registered protocol family 17

00:00:07.849 [info]  Registering SWP/SWPB emulation handler

00:00:07.849 [info]  Loading compiled-in X.509 certificates

00:00:07.849 [info]  pstore: Using crash dump compression: deflate

00:00:07.850 [info]  uart-pl011 3f201000.serial: there is not valid maps for state default

00:00:07.850 [info]  uart-pl011 3f201000.serial: cts_event_workaround enabled

00:00:07.850 [info]  3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 114, base_baud = 0) is a PL011 rev2

00:00:07.850 [info]  3f215040.serial: ttyS0 at MMIO 0x3f215040 (irq = 86, base_baud = 31250000) is a 16550

00:00:07.851 [info]  bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver

00:00:07.851 [info]  mmc-bcm2835 3f300000.mmcnr: mmc_debug:0 mmc_debug2:0

00:00:07.851 [info]  mmc-bcm2835 3f300000.mmcnr: DMA channel allocated

00:00:07.851 [info]  sdhost: log_buf @ (ptrval) (f0113000)

00:00:07.852 [warn]  mmc1: queuing unknown CIS tuple 0x80 (2 bytes)

00:00:07.852 [warn]  mmc1: queuing unknown CIS tuple 0x80 (3 bytes)

00:00:07.852 [warn]  mmc1: queuing unknown CIS tuple 0x80 (3 bytes)

00:00:07.852 [warn]  mmc1: queuing unknown CIS tuple 0x80 (7 bytes)

00:00:07.852 [info]  mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)

00:00:07.853 [info]  of_cfs_init

00:00:07.853 [info]  of_cfs_init: OK

00:00:07.853 [info]  Waiting for root device /dev/mmcblk0p2...

00:00:07.853 [warn]  Indeed it is in host mode hprt0 = 00021501

00:00:07.854 [info]  random: fast init done

00:00:07.855 [info]  mmc1: new high speed SDIO card at address 0001

00:00:07.856 [warn]  mmc0: host does not support reading read-only switch, assuming write-enable

00:00:07.856 [info]  mmc0: new high speed SDHC card at address aaaa

00:00:07.856 [info]  mmcblk0: mmc0:aaaa SD32G 29.7 GiB

00:00:07.856 [info]   mmcblk0: p1 p2 p3

00:00:07.856 [info]  VFS: Mounted root (squashfs filesystem) readonly on device 179:2.

00:00:07.857 [info]  devtmpfs: mounted

00:00:07.857 [info]  Freeing unused kernel memory: 1024K

00:00:07.857 [info]  Run /sbin/init as init process

00:00:07.857 [debug]   with arguments:

00:00:07.857 [debug]     /sbin/init

00:00:07.858 [debug]   with environment:

00:00:07.858 [debug]     HOME=/

00:00:07.859 [debug]     TERM=linux

00:00:07.859 [info]  usb 1-1: new high-speed USB device number 2 using dwc_otg

00:00:07.860 [warn]  Indeed it is in host mode hprt0 = 00001101

00:00:07.860 [info]  EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: 

00:00:07.860 [info]  usb 1-1: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3

00:00:07.860 [info]  usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0

00:00:07.861 [info]  hub 1-1:1.0: USB hub found

00:00:07.861 [info]  hub 1-1:1.0: 4 ports detected

00:00:07.861 [info]  random: crng init done

00:00:07.861 [info]  usb 1-1.1: new high-speed USB device number 3 using dwc_otg

00:00:07.861 [info]  usb 1-1.1: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3

00:00:07.862 [info]  usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0

00:00:07.862 [info]  hub 1-1.1:1.0: USB hub found

00:00:07.862 [info]  hub 1-1.1:1.0: 3 ports detected

00:00:07.863 [warn]  dwc_otg_handle_wakeup_detected_intr lxstate = 2

00:00:07.863 [info]  usb 1-1.1.1: new high-speed USB device number 4 using dwc_otg

00:00:07.863 [info]  usb 1-1.1.1: New USB device found, idVendor=0424, idProduct=7800, bcdDevice= 3.00

00:00:07.863 [info]  usb 1-1.1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0

00:00:07.863 [warn]  heart: nerves_heart v1.0.0 started.

00:00:08.100 [warn]  heart: kernel watchdog activated (interval 5s)

00:00:08.101 [info]  libphy: Fixed MDIO Bus: probed

21:00:08.262 [info]  lan78xx 1-1.1.1:1.0 (unnamed net_device) (uninitialized): No External EEPROM. Setting MAC Speed

21:00:08.262 [info]  libphy: lan78xx-mdiobus: probed

21:00:08.301 [info]  lan78xx 1-1.1.1:1.0 (unnamed net_device) (uninitialized): int urb period 64

21:00:08.346 [info]  RTC (NervesTime.FileTime) reports that the time is ~N[2022-01-20 22:15:08]

21:00:08.361 [debug] Starting /usr/sbin/ntpd with: ["-n", "-S", "/srv/erlang/lib/nerves_time-0.4.4/priv/ntpd_script", "-p", "0.pool.ntp.org", "-p", "1.pool.ntp.org", "-p", "2.pool.ntp.org", "-p", "3.pool.ntp.org"]

19:15:08.003 [info]  usbcore: registered new interface driver lan78xx

19:15:08.004 [info]  nerves_time set system clock to 2022-01-20 22:15:08 UTC

19:15:08.262 [debug] VintageNet(ppp0): :configured -> internal configure (VintageNetMobile)

19:15:08.265 [warn]  RouteManager: new set_connection_status ppp0} -> :disconnected (unknown)

19:15:08.315 [warn]  vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.

19:15:08.315 [info]  bcm2835_vc_sm_cma_probe: Videocore shared memory driver

19:15:08.316 [info]  [vc_sm_connected_init]: start

19:15:08.316 [info]  [vc_sm_connected_init]: installed successfully

19:15:08.364 [info]  mc: Linux media interface: v0.10

19:15:08.384 [info]  videodev: Linux video capture interface: v2.00

19:15:08.386 [info]  PMControl(ppp0): Powering on

19:15:08.419 [warn]  bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.

19:15:08.466 [warn]  bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.

19:15:08.466 [info]  bcm2835-codec bcm2835-codec: Device registered as /dev/video10

19:15:08.466 [info]  bcm2835-codec bcm2835-codec: Loaded V4L2 decode

19:15:08.467 [info]  bcm2835-codec bcm2835-codec: Device registered as /dev/video11

19:15:08.467 [info]  bcm2835-codec bcm2835-codec: Loaded V4L2 encode

19:15:08.467 [info]  bcm2835-codec bcm2835-codec: Device registered as /dev/video12

19:15:08.467 [info]  bcm2835-codec bcm2835-codec: Loaded V4L2 isp

19:15:08.467 [info]  bcm2835-codec bcm2835-codec: Device registered as /dev/video18

19:15:08.468 [info]  bcm2835-codec bcm2835-codec: Loaded V4L2 image_fx

19:15:08.531 [warn]  bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.

19:15:08.709 [debug] VintageNet(wlan0): :configured -> internal configure (VintageNetWiFi)

19:15:08.711 [warn]  RouteManager: new set_connection_status wlan0} -> :disconnected (unknown)

19:15:08.873 [warn]  mdns_lite: the :host app environment option is deprecated. Change to :hosts

19:15:09.214 [warn]  snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.

19:15:09.224 [info]  bcm2835_audio bcm2835_audio: card created with 4 channels

19:15:09.224 [info]  bcm2835_audio bcm2835_audio: card created with 4 channels

19:15:09.285 [warn]  bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.

19:15:09.294 [info]  bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13

19:15:09.295 [info]  bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14

19:15:09.296 [info]  bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15

19:15:09.297 [info]  bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16

19:15:09.297 [info]  bcm2835-isp bcm2835-isp: Register output node 0 with media controller

19:15:09.297 [info]  bcm2835-isp bcm2835-isp: Register capture node 1 with media controller

19:15:09.297 [info]  bcm2835-isp bcm2835-isp: Register capture node 2 with media controller

19:15:09.297 [info]  bcm2835-isp bcm2835-isp: Register capture node 3 with media controller

19:15:09.298 [info]  bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp

19:15:09.364 [info]  input: raspberrypi-ts as /devices/platform/soc/soc:firmware/soc:firmware:touchscreen/input/input0

19:15:09.529 [info]  ** INIT: [config: "/srv/erlang/lib/ecolab-0.1.0/priv/config/mosquitto.conf"].

19:15:09.531 [info]  ** INIT open: #Port<0.69>.

19:15:09.533 [debug] INIT: %{}

19:15:09.540 [info]  #Reference<0.744374578.537264144.239224> - 17 - 0 - 9915 - b8:27:eb:92:9c:5f

19:15:09.641 [debug] INIT: %{}

19:15:09.643 [info]  connect! :up

19:15:09.645 [info]  subscription: local/+/conn

19:15:09.645 [info]  subscription: local/+/vars/#

19:15:09.645 [warn]  {{Tortoise, "hive"}, #Reference<0.744374578.537133059.240398>, :ok}

19:15:09.824 [info]  cfg80211: Loading compiled-in X.509 certificates for regulatory database

19:15:09.944 [info]  cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'

19:15:09.994 [info]  brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6

19:15:10.214 [info]  brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6

19:15:10.214 [info]  brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6

19:15:10.224 [info]  brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Jan  4 2021 19:56:29 version 7.45.229 (617f1f5 CY) FWID 01-2dbd9d2e

19:15:10.258 [debug] VintageNet(wlan0): :retrying -> wlan0 up

19:15:10.259 [info]  RouteManager: clear_route wlan0

19:15:10.262 [warn]  RouteManager: new set_connection_status wlan0} -> :disconnected (unknown)

19:15:10.314 [info]  brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled

19:15:11.482 [debug] wpa_supplicant: Successfully initialized wpa_supplicant

19:15:11.683 [debug] wpa_supplicant: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=BR

19:15:12.834 [info]  usb 1-1.1.2: new high-speed USB device number 5 using dwc_otg

19:15:12.964 [info]  usb 1-1.1.2: New USB device found, idVendor=12d1, idProduct=157c, bcdDevice= 1.02

19:15:12.965 [info]  usb 1-1.1.2: New USB device strings: Mfr=5, Product=4, SerialNumber=7

19:15:12.965 [info]  usb 1-1.1.2: Product: HUAWEI Mobile

19:15:12.965 [info]  usb 1-1.1.2: Manufacturer: HUAWEI Technology

19:15:12.966 [info]  usb 1-1.1.2: SerialNumber: FFFFFFFFFFFFFFFF

19:15:12.966 [info]  usb-storage 1-1.1.2:1.0: USB Mass Storage device detected

19:15:12.974 [info]  scsi host0: usb-storage 1-1.1.2:1.0

19:15:14.024 [info]  scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2

19:15:14.024 [info]  scsi 0:0:0:1: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2

19:15:14.084 [info]  sd 0:0:0:1: [sda] Attached SCSI removable disk

19:15:14.505 [info]  WPASupplicant ignoring {:event, "WPS-AP-AVAILABLE"}

19:15:14.506 [debug] wpa_supplicant: wlan0: Trying to associate with SSID 'VIVOFIBRA-6071'

19:15:14.506 [info]  wpa_supplicant(wlan0): Trying to associate with SSID 'VIVOFIBRA-6071'

19:15:17.511 [info]  RouteManager: set_connection_status wlan0 -> :lan (ifup)

19:15:17.511 [debug] [vintage_net(wlan0)] starting udhcpc

19:15:17.525 [debug] udhcpc(wlan0): udhcpc: started, v1.33.1

19:15:17.538 [info]  wlan0 dhcp deconfig: %{"BINDIR" => "/usr/lib/erlang/erts-12.1.5/bin", "EMU" => "beam", "ERL_CRASH_DUMP" => "/root/crash.dump", "ERL_INETRC" => "/etc/erl_inetrc", "HEART_BEAT_TIMEOUT" => "30", "HOME" => "/root", "LANG" => "en_US.UTF-8", "LANGUAGE" => "en", "PATH" => "/usr/lib/erlang/erts-12.1.5/bin:/srv/erlang/bin:/usr/sbin:/usr/bin:/sbin:/bin", "PROGNAME" => "erlexec", "RELEASE_ROOT" => "/srv/erlang", "RELEASE_SYS_CONFIG" => "/srv/erlang/releases/0.1.0/sys", "RELEASE_TMP" => "/tmp", "ROOTDIR" => "/srv/erlang", "TERM" => "vt100", "interface" => "wlan0"}

19:15:17.539 [info]  RouteManager: clear_route wlan0

19:15:17.541 [debug] udhcpc(wlan0): udhcpc: sending discover

19:15:17.548 [debug] wpa_supplicant: wlan0: Associated with 86:7e:ca:3d:60:7e

19:15:17.549 [debug] wpa_supplicant: wlan0: CTRL-EVENT-CONNECTED - Connection to 86:7e:ca:3d:60:7e completed [id=0 id_str=]

19:15:17.549 [info]  wpa_supplicant(wlan0): Associated with 86:7e:ca:3d:60:7e

19:15:17.550 [info]  Connected to AP: 86:7e:ca:3d:60:7e

19:15:17.552 [debug] wpa_supplicant: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0

19:15:17.552 [debug] wpa_supplicant: wlan0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=BR

19:15:17.554 [info]  WPASupplicant ignoring {:event, "CTRL-EVENT-SUBNET-STATUS-UPDATE", %{"status" => "0"}}

19:15:17.554 [info]  IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

19:15:17.555 [info]  WPASupplicant ignoring {:event, "CTRL-EVENT-REGDOM-CHANGE", %{"alpha2" => "BR", "init" => "COUNTRY_IE", "type" => "COUNTRY"}}

19:15:17.702 [debug] udhcpc(wlan0): udhcpc: sending select for 192.168.15.15

19:15:18.019 [warn]  RouteManager: new set_connection_status wlan0} -> :lan (timeout)

19:15:18.974 [debug] udhcpc(wlan0): udhcpc: lease of 192.168.15.15 obtained, lease time 14400

19:15:18.980 [debug] udhcpc.renew(wlan0): %{"BINDIR" => "/usr/lib/erlang/erts-12.1.5/bin", "EMU" => "beam", "ERL_CRASH_DUMP" => "/root/crash.dump", "ERL_INETRC" => "/etc/erl_inetrc", "HEART_BEAT_TIMEOUT" => "30", "HOME" => "/root", "LANG" => "en_US.UTF-8", "LANGUAGE" => "en", "PATH" => "/usr/lib/erlang/erts-12.1.5/bin:/srv/erlang/bin:/usr/sbin:/usr/bin:/sbin:/bin", "PROGNAME" => "erlexec", "RELEASE_ROOT" => "/srv/erlang", "RELEASE_SYS_CONFIG" => "/srv/erlang/releases/0.1.0/sys", "RELEASE_TMP" => "/tmp", "ROOTDIR" => "/srv/erlang", "TERM" => "vt100", "broadcast" => "192.168.15.255", "dns" => ["192.168.15.1"], "interface" => "wlan0", "ip" => "192.168.15.15", "lease" => "14400", "mask" => "24", "ntpsrv" => "200.160.7.193", "opt125" => "00000de9210406303039303936050c3938374543413344363037310609525446383131355657", "opt53" => "05", "opt58" => "00001c20", "opt59" => "00003138", "router" => ["192.168.15.1"], "serverid" => "192.168.15.1", "subnet" => "255.255.255.0"}

19:15:18.991 [info]  RouteManager: set_route wlan0: IP: [{{192, 168, 15, 15}, 24}], GW: {192, 168, 15, 1}

19:15:19.072 [info]  RouteManager: set_connection_status wlan0 -> :internet (timeout)

322 out of 322 new messages shown.
:ok
iex(2)> RingLogger.attach
:ok

19:16:29.567 [info]  PMControl(ppp0): Start powering off

19:16:29.568 [info]  PMControl(ppp0): Complete power off

19:16:29.753 [info]  PMControl(ppp0): Powering on

19:16:29.969 [info]  usb 1-1.1.2: USB disconnect, device number 5

19:16:40.919 [info]  usb 1-1.1.2: new high-speed USB device number 6 using dwc_otg

19:16:41.049 [info]  usb 1-1.1.2: New USB device found, idVendor=12d1, idProduct=158e, bcdDevice= 1.02

19:16:41.050 [info]  usb 1-1.1.2: New USB device strings: Mfr=4, Product=3, SerialNumber=6

19:16:41.051 [info]  usb 1-1.1.2: Product: HUAWEI Mobile

19:16:41.051 [info]  usb 1-1.1.2: Manufacturer: HUAWEI Technology

19:16:41.051 [info]  usb 1-1.1.2: SerialNumber: FFFFFFFFFFFFFFFF

19:16:41.059 [info]  usb-storage 1-1.1.2:1.2: USB Mass Storage device detected

19:16:41.060 [info]  scsi host0: usb-storage 1-1.1.2:1.2

19:16:41.099 [info]  usbcore: registered new interface driver option

19:16:41.099 [info]  usbserial: USB Serial support registered for GSM modem (1-port)

19:16:41.099 [info]  option 1-1.1.2:1.0: GSM modem (1-port) converter detected

19:16:41.100 [info]  usb 1-1.1.2: GSM modem (1-port) converter now attached to ttyUSB0

19:16:41.100 [info]  option 1-1.1.2:1.1: GSM modem (1-port) converter detected

19:16:41.101 [info]  usb 1-1.1.2: GSM modem (1-port) converter now attached to ttyUSB1

19:16:41.199 [info]  usbcore: registered new interface driver cdc_ether

19:16:41.213 [debug] VintageNet(ppp0): :retrying -> wwan0 up

19:16:41.213 [info]  RouteManager: clear_route ppp0

19:16:41.220 [info]  cdc_ncm 1-1.1.2:1.3: MAC-Address: 0c:5b:8f:27:9a:64

19:16:41.220 [info]  cdc_ncm 1-1.1.2:1.3: setting rx_max = 16384

19:16:41.221 [info]  cdc_ncm 1-1.1.2:1.3: setting tx_max = 16384

19:16:41.221 [info]  cdc_ncm 1-1.1.2:1.3 wwan0: register 'cdc_ncm' at usb-3f980000.usb-1.1.2, Mobile Broadband Network Device, 0c:5b:8f:27:9a:64

19:16:41.221 [warn]  RouteManager: new set_connection_status ppp0} -> :disconnected (unknown)

19:16:41.221 [info]  usbcore: registered new interface driver cdc_ncm

19:16:41.379 [info]  PPP generic driver version 2.4.2

19:16:41.381 [info]  Jan 20 22:16:41 pppd[281]: pppd 2.4.8 started by root, uid 0

19:16:42.089 [info]  scsi 0:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2

19:16:42.139 [info]  sd 0:0:0:0: [sda] Attached SCSI removable disk

19:16:42.277 [warn]  Send "ATE0" failed: {:error, :timeout}. Ignoring...

19:16:42.403 [info]  Jan 20 22:16:42 chat[285]: abort on (BUSY)

19:16:42.403 [info]  Jan 20 22:16:42 chat[285]: abort on (NO CARRIER)

19:16:42.403 [info]  Jan 20 22:16:42 chat[285]: abort on (NO DIALTONE)

19:16:42.404 [info]  Jan 20 22:16:42 chat[285]: abort on (NO DIAL TONE)

19:16:42.404 [info]  Jan 20 22:16:42 chat[285]: abort on (NO ANSWER)

19:16:42.404 [info]  Jan 20 22:16:42 chat[285]: abort on (DELAYED)

19:16:42.404 [info]  Jan 20 22:16:42 chat[285]: timeout set to 10 seconds

19:16:42.404 [info]  Jan 20 22:16:42 chat[285]: report (CONNECT)

19:16:42.404 [info]  Jan 20 22:16:42 chat[285]: send (+++^M)

19:16:42.444 [info]  Jan 20 22:16:42 chat[285]: send (AT^M)

19:16:42.474 [info]  Jan 20 22:16:42 chat[285]: expect (OK)

19:16:42.779 [warn]  Unexpected AT+CIMI response: {:error, :timeout}

19:16:43.281 [warn]  Send "AT+QCCID" failed: {:error, :timeout}. Ignoring...

19:16:52.474 [info]  Jan 20 22:16:52 chat[285]: alarm

19:16:52.474 [info]  Jan 20 22:16:52 chat[285]: Failed

19:16:52.475 [debug] Jan 20 22:16:52 pppd[281]: Script chat -v -f /tmp/vintage_net/chatscript.ppp0 finished (pid 285), status = 0x3

19:16:52.475 [error] Jan 20 22:16:52 pppd[281]: Connect script failed

19:17:24.516 [info]  Jan 20 22:17:24 chat[287]: abort on (BUSY)

19:17:24.516 [info]  Jan 20 22:17:24 chat[287]: abort on (NO CARRIER)

19:17:24.516 [info]  Jan 20 22:17:24 chat[287]: abort on (NO DIALTONE)

19:17:24.516 [info]  Jan 20 22:17:24 chat[287]: abort on (NO DIAL TONE)

19:17:24.516 [info]  Jan 20 22:17:24 chat[287]: abort on (NO ANSWER)

19:17:24.516 [info]  Jan 20 22:17:24 chat[287]: abort on (DELAYED)

19:17:24.517 [info]  Jan 20 22:17:24 chat[287]: timeout set to 10 seconds

19:17:24.517 [info]  Jan 20 22:17:24 chat[287]: report (CONNECT)

19:17:24.517 [info]  Jan 20 22:17:24 chat[287]: send (+++^M)

19:17:24.556 [info]  Jan 20 22:17:24 chat[287]: send (AT^M)

19:17:24.587 [info]  Jan 20 22:17:24 chat[287]: expect (OK)

19:17:24.588 [info]  Jan 20 22:17:24 chat[287]: +++^MAT^M^M

19:17:24.588 [info]  Jan 20 22:17:24 chat[287]: OK

19:17:24.589 [info]  Jan 20 22:17:24 chat[287]:  -- got it

19:17:24.589 [info]  Jan 20 22:17:24 chat[287]: send (ATH^M)

19:17:24.628 [info]  Jan 20 22:17:24 chat[287]: expect (OK)

19:17:24.629 [info]  Jan 20 22:17:24 chat[287]: ^M

19:17:24.634 [info]  Jan 20 22:17:24 chat[287]: ATH^M^M

19:17:24.634 [info]  Jan 20 22:17:24 chat[287]: OK

19:17:24.634 [info]  Jan 20 22:17:24 chat[287]:  -- got it

19:17:24.634 [info]  Jan 20 22:17:24 chat[287]: send (ATZ^M)

19:17:24.671 [info]  Jan 20 22:17:24 chat[287]: expect (OK)

19:17:24.671 [info]  Jan 20 22:17:24 chat[287]: ^M

19:17:24.676 [info]  Jan 20 22:17:24 chat[287]: ATZ^M^M

19:17:24.676 [info]  Jan 20 22:17:24 chat[287]: OK

19:17:24.676 [info]  Jan 20 22:17:24 chat[287]:  -- got it

19:17:24.677 [info]  Jan 20 22:17:24 chat[287]: send (ATQ0^M)

19:17:24.723 [info]  Jan 20 22:17:24 chat[287]: expect (OK)

19:17:24.723 [info]  Jan 20 22:17:24 chat[287]: ^M

19:17:24.728 [info]  Jan 20 22:17:24 chat[287]: ATQ0^M^M

19:17:24.728 [info]  Jan 20 22:17:24 chat[287]: OK

19:17:24.728 [info]  Jan 20 22:17:24 chat[287]:  -- got it

19:17:24.728 [info]  Jan 20 22:17:24 chat[287]: send (AT+CGDCONT=1,"IP","claro.com.br"^M)

19:17:25.057 [info]  Jan 20 22:17:25 chat[287]: expect (OK)

19:17:25.057 [info]  Jan 20 22:17:25 chat[287]: ^M

19:17:25.062 [info]  Jan 20 22:17:25 chat[287]: AT+CGDCONT=1,"IP","claro.com.br"^M^M

19:17:25.062 [info]  Jan 20 22:17:25 chat[287]: OK

19:17:25.062 [info]  Jan 20 22:17:25 chat[287]:  -- got it

19:17:25.063 [info]  Jan 20 22:17:25 chat[287]: send (ATDT*99***1#^M)

19:17:25.194 [info]  Jan 20 22:17:25 chat[287]: expect (CONNECT)

19:17:25.194 [info]  Jan 20 22:17:25 chat[287]: ^M

19:17:25.199 [info]  Jan 20 22:17:25 chat[287]: ATDT*99***1#^M^M

19:17:25.199 [info]  Jan 20 22:17:25 chat[287]: CONNECT

19:17:25.200 [info]  Jan 20 22:17:25 chat[287]:  -- got it

19:17:25.200 [info]  Jan 20 22:17:25 chat[287]: send (^M)

19:17:25.207 [debug] Jan 20 22:17:25 pppd[281]: Script chat -v -f /tmp/vintage_net/chatscript.ppp0 finished (pid 287), status = 0x0

19:17:25.208 [info]  Jan 20 22:17:25 pppd[281]: Serial connection established.

19:17:25.238 [debug] Jan 20 22:17:25 pppd[281]: using channel 1

19:17:25.238 [info]  Jan 20 22:17:25 pppd[281]: Using interface ppp0

19:17:25.239 [info]  Jan 20 22:17:25 pppd[281]: Connect: ppp0 <--> /dev/ttyUSB1

19:17:26.240 [debug] Jan 20 22:17:26 pppd[281]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd1b5f228> <pcomp> <accomp>]

19:17:29.243 [debug] Jan 20 22:17:29 pppd[281]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd1b5f228> <pcomp> <accomp>]

19:17:32.247 [debug] Jan 20 22:17:32 pppd[281]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd1b5f228> <pcomp> <accomp>]

19:17:34.766 [info]  PMControl(ppp0): Start powering off

19:17:34.770 [info]  PMControl(ppp0): Complete power off

19:17:34.782 [info]  PMControl(ppp0): Powering on

19:17:34.794 [error] Huawei E3372 modeswitch failed with 'Look for default devices ...
 Found devices in default mode (1)
Access device 006 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 255
'

19:17:35.250 [debug] Jan 20 22:17:35 pppd[281]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd1b5f228> <pcomp> <accomp>]

19:17:38.253 [debug] Jan 20 22:17:38 pppd[281]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd1b5f228> <pcomp> <accomp>]

19:17:41.257 [debug] Jan 20 22:17:41 pppd[281]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd1b5f228> <pcomp> <accomp>]

19:17:44.259 [debug] Jan 20 22:17:44 pppd[281]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd1b5f228> <pcomp> <accomp>]

19:17:47.263 [debug] Jan 20 22:17:47 pppd[281]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd1b5f228> <pcomp> <accomp>]

19:17:50.266 [debug] Jan 20 22:17:50 pppd[281]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd1b5f228> <pcomp> <accomp>]

19:17:53.269 [debug] Jan 20 22:17:53 pppd[281]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd1b5f228> <pcomp> <accomp>]

19:17:56.273 [warn]  Jan 20 22:17:56 pppd[281]: LCP: timeout sending Config-Requests

19:17:56.273 [info]  Jan 20 22:17:56 pppd[281]: Connection terminated.

19:17:57.330 [info]  Jan 20 22:17:57 pppd[281]: Modem hangup

19:18:28.369 [info]  Jan 20 22:18:28 chat[293]: abort on (BUSY)

19:18:28.370 [info]  Jan 20 22:18:28 chat[293]: abort on (NO CARRIER)

19:18:28.370 [info]  Jan 20 22:18:28 chat[293]: abort on (NO DIALTONE)

19:18:28.370 [info]  Jan 20 22:18:28 chat[293]: abort on (NO DIAL TONE)

19:18:28.370 [info]  Jan 20 22:18:28 chat[293]: abort on (NO ANSWER)

19:18:28.370 [info]  Jan 20 22:18:28 chat[293]: abort on (DELAYED)

19:18:28.370 [info]  Jan 20 22:18:28 chat[293]: timeout set to 10 seconds

19:18:28.371 [info]  Jan 20 22:18:28 chat[293]: report (CONNECT)

19:18:28.371 [info]  Jan 20 22:18:28 chat[293]: send (+++^M)

19:18:28.410 [info]  Jan 20 22:18:28 chat[293]: send (AT^M)

19:18:28.441 [info]  Jan 20 22:18:28 chat[293]: expect (OK)

19:18:38.441 [info]  Jan 20 22:18:38 chat[293]: alarm

19:18:38.441 [info]  Jan 20 22:18:38 chat[293]: Failed

19:18:38.445 [debug] Jan 20 22:18:38 pppd[281]: Script chat -v -f /tmp/vintage_net/chatscript.ppp0 finished (pid 293), status = 0x3

19:18:38.445 [error] Jan 20 22:18:38 pppd[281]: Connect script failed

19:18:39.796 [info]  PMControl(ppp0): Start powering off

19:18:39.797 [info]  PMControl(ppp0): Complete power off

19:18:39.808 [info]  PMControl(ppp0): Powering on

19:18:39.819 [error] Huawei E3372 modeswitch failed with 'Look for default devices ...
 Found devices in default mode (1)
Access device 006 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 255
'

19:19:10.482 [info]  Jan 20 22:19:10 chat[299]: abort on (BUSY)

19:19:10.483 [info]  Jan 20 22:19:10 chat[299]: abort on (NO CARRIER)

19:19:10.483 [info]  Jan 20 22:19:10 chat[299]: abort on (NO DIALTONE)

19:19:10.483 [info]  Jan 20 22:19:10 chat[299]: abort on (NO DIAL TONE)

19:19:10.483 [info]  Jan 20 22:19:10 chat[299]: abort on (NO ANSWER)

19:19:10.483 [info]  Jan 20 22:19:10 chat[299]: abort on (DELAYED)

19:19:10.483 [info]  Jan 20 22:19:10 chat[299]: timeout set to 10 seconds

19:19:10.484 [info]  Jan 20 22:19:10 chat[299]: report (CONNECT)

19:19:10.484 [info]  Jan 20 22:19:10 chat[299]: send (+++^M)

19:19:10.523 [info]  Jan 20 22:19:10 chat[299]: send (AT^M)

19:19:10.554 [info]  Jan 20 22:19:10 chat[299]: expect (OK)

19:19:20.554 [info]  Jan 20 22:19:20 chat[299]: alarm

19:19:20.554 [info]  Jan 20 22:19:20 chat[299]: Failed

19:19:20.555 [debug] Jan 20 22:19:20 pppd[281]: Script chat -v -f /tmp/vintage_net/chatscript.ppp0 finished (pid 299), status = 0x3

19:19:20.555 [error] Jan 20 22:19:20 pppd[281]: Connect script failed

19:19:44.821 [info]  PMControl(ppp0): Start powering off

19:19:44.822 [info]  PMControl(ppp0): Complete power off

19:19:44.833 [info]  PMControl(ppp0): Powering on

19:19:44.844 [error] Huawei E3372 modeswitch failed with 'Look for default devices ...
 Found devices in default mode (1)
Access device 006 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 255
yangm97 commented 1 year ago

I don't think this is going to be pretty. The only options I can think about right now are trying usb_modeswitch blindly with the possible pids or implementing a function to go through the VID:PIDs of all attached USB devices and running the right one. I haven't thought through the first option enough. See https://github.com/elixir-toolshed/toolshed/blob/main/lib/toolshed/hw.ex for some sample code for the second option.

What about using udev rules?