usb QR reader

Daniel Braniss
Thu, 16 Jan 2020 10:23:30 -0000

> On 16 Jan 2020, at 12:12, Hans Petter Selasky <hps at selasky.org>
wrote:
>
> On 2020-01-16 11:07, Daniel Braniss wrote:
>>> On 16 Jan 2020, at 11:16, Hans Petter Selasky <hps at
selasky.org> wrote:
>>>
>>> ktracing
>> wrote a small c program, that just opens and tries to read, the open
fails with
>> 	??open: Device not configured?
>> and the console shows:
>> Jan 16 11:59:09 neo-black-1 kernel: umodem0: detached
>> Jan 16 11:59:14 neo-black-1 kernel: ugen5.2: <SM SM-2D PRODUCT USB
UART> at usbus5
>> Jan 16 11:59:14 neo-black-1 kernel: umodem_probe:
>> Jan 16 11:59:14 neo-black-1 syslogd: last message repeated 1 times
>> Jan 16 11:59:14 neo-black-1 kernel: umodem0 on uhub5
>> Jan 16 11:59:14 neo-black-1 kernel: umodem0: <SM SM-2D PRODUCT USB
UART, class 2/0, rev 1.10/1.00, addr 2> on usbus5
>> Jan 16 11:59:14 neo-black-1 kernel: umodem0:
>> Jan 16 11:59:14 neo-black-1 kernel: data interface 1, has no CM over
data, has no break
>> Jan 16 12:01:52 neo-black-1 kernel: umodem_cfg_set_dtr: onoff=1
>> Jan 16 12:01:52 neo-black-1 kernel: umodem_cfg_set_rts: onoff=1
>> Jan 16 12:01:53 neo-black-1 kernel: umodem0: at uhub5, port 1, addr 2
(disconnected)
>> Jan 16 12:01:53 neo-black-1 kernel: umodem_detach: sc=0xd494c400
>> Jan 16 12:01:54 neo-black-1 kernel: umodem_cfg_set_break: onoff=0
>> Jan 16 12:01:54 neo-black-1 kernel: umodem0: detached
>> Jan 16 12:02:01 neo-black-1 kernel: umodem_probe:
>> Jan 16 12:02:01 neo-black-1 syslogd: last message repeated 1 times
>> Jan 16 12:02:01 neo-black-1 kernel: umodem0 on uhub5
>> Jan 16 12:02:01 neo-black-1 kernel: umodem0: <SM SM-2D PRODUCT USB
UART, class 2/0, rev 1.10/1.00, addr 2> on usbus5
>> Jan 16 12:02:01 neo-black-1 kernel: umodem0: data interface 1, has no
CM over data, has no break
>
> Can you put a sleep call in your c-program, like 1 second?
>
> --HPS
63549 a.out    CALL  openat(AT_FDCWD,0x1045b,0x2<O_RDWR>)
63549 a.out    NAMI  "/dev/ttyU0"
63549 a.out    RET   openat -1 errno 6 Device not configured
63549 a.out    CALL  nanosleep(0xbfbfec20,0xbfbfec10)
63549 a.out    RET   nanosleep 0
63549 a.out    CALL  writev(0x2,0xbfbfe408,0x4)
63549 a.out    GIO   fd 2 wrote 28 bytes
      "open: Device not configured

and the console:
Jan 16 12:17:14 neo-black-1 kernel: umodem_cfg_set_dtr: onoff=1
Jan 16 12:17:14 neo-black-1 kernel: umodem_cfg_set_rts: onoff=1
Jan 16 12:17:15 neo-black-1 kernel: umodem0: at uhub5, port 1, addr 2
(disconnected)
Jan 16 12:17:15 neo-black-1 kernel: umodem_detach: sc=0xd494c400
Jan 16 12:17:16 neo-black-1 kernel: umodem_cfg_set_break: onoff=0
Jan 16 12:17:16 neo-black-1 kernel: umodem0: detached
Jan 16 12:17:23 neo-black-1 kernel: umodem_probe:
Jan 16 12:17:23 neo-black-1 syslogd: last message repeated 1 times
Jan 16 12:17:23 neo-black-1 kernel: umodem0 on uhub5
Jan 16 12:17:23 neo-black-1 kernel: umodem0: <SM SM-2D PRODUCT USB UART,
class 2/0, rev 1.10/1.00, addr 2> on usbus5
Jan 16 12:17:23 neo-black-1 kernel: umodem0: data interface 1, has no CM over
data, has no break