NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.48k stars 12.97k forks source link

qFlipper can't connect to the device #221144

Closed kurnevsky closed 1 year ago

kurnevsky commented 1 year ago

Describe the bug

qFlipper timeouts when connection to the device on nixos-unstable. GUI logs:

[APP] qFlipper version 1.2.2 commit nix-1.2.2 5138-11-16T12:46:39
[APP] OS info: NixOS 23.05 (Stoat) 23.05 6.2.5 Qt 5.15.8
[RPC] Starting RPC session...
[RPC] RPC session started successfully.
[RPC] (1) System Protobuf Version START
[RPC] (1) System Protobuf Version ERROR: Operation timeout (generic)

Terminal logs:

15128 [REG] Detected new device: ...
15145 [DBG] Trying serial port flip_Ryol at /dev/ttyACM0
15145 [DBG] Using  serial port flip_Ryol at /dev/ttyACM0
15145 [RPC] Starting RPC session...
15263 [RPC] RPC session started successfully.
15264 [RPC] (1) System Protobuf Version START
44827 [REG] Device initialization failed: Failed to get protobuf version: Operation timeout (generic)
44834 [RPC] (1) System Protobuf Version ERROR: Operation timeout (generic)

Steps To Reproduce

Steps to reproduce the behavior: Try to connect to the flipper device via usb.

Expected behavior

It connects.

Additional context

Add any other context about the problem here.

Notify maintainers

@cab404

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.2.5, NixOS, 23.05 (Stoat)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - channels(root): `"nixos-21.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
cab404 commented 1 year ago

Have you added it to udev rules?

kurnevsky commented 1 year ago

Ugh, I haven't. But I just did and still have this error.

cab404 commented 1 year ago

Ugh, I haven't. But I just did and still have this error.

Did you restart udev and re-plug the device after adding rules?

kurnevsky commented 1 year ago

Yes, and even rebooted the pc :)

cab404 commented 1 year ago

Are you in dialout group?

kurnevsky commented 1 year ago

Here what I did exactly: https://github.com/kurnevsky/nixfiles/commit/d1d5dd69e3e031424a08811ba15cc6a0153734c8 I also noticed that firmware version on my flipper is quite old - 0.43.1. Could it be a problem?

kurnevsky commented 1 year ago

Are you in dialout group?

I tried to run qflipper from root.

cab404 commented 1 year ago

Can you please add yourself to dialout, and try without root?

Also would be glad to get lsusb output if that doesn't help)

cab404 commented 1 year ago

firmware version on my flipper is quite old - 0.43.1. Could it be a problem?

Usually it is not — and when it is, the error is different

cab404 commented 1 year ago

Oh, or maybe it is a problem. Try using chromium and their online firmware thing to update and see if that helps — https://lab.flipper.net/

kurnevsky commented 1 year ago

Still the same. lsusb:

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 06cb:00bd Synaptics, Inc. Prometheus MIS Touch Fingerprint Reader
Bus 002 Device 003: ID 04f2:b724 Chicony Electronics Co., Ltd Integrated Camera
Bus 002 Device 006: ID 0483:5740 STMicroelectronics Virtual COM Port
Bus 002 Device 005: ID 8087:0026 Intel Corp. AX201 Bluetooth
Bus 002 Device 002: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
cab404 commented 1 year ago

Hm, unfun. Can you try nix-shell -p picocom and picocom /dev/ttyACM0?

kurnevsky commented 1 year ago

Try using chromium and their online firmware thing to update and see if that helps

It just writes No compatible devices found.

kurnevsky commented 1 year ago

picocom:

picocom v3.2a

port is        : /dev/ttyACM0
flowcontrol    : none
baudrate is    : 9600
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
hangup is      : no
nolock is      : no
send_cmd is    : /nix/store/jw3mzwqfbd3h9dacsx7cy165f2fl453r-lrzsz-0.12.20/bin/sz -vv
receive_cmd is : rz -vv -E
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,
logfile is     : none
initstring     : none
exit_after is  : not set
exit is        : no

Type [C-a] [C-h] to see available commands
Terminal ready

              _.-------.._                    -,
          .-"```"--..,,_/ /`-,               -,  \ 
       .:"          /:/  /'\  \     ,_...,  `. |  |
      /       ,----/:/  /`\ _\~`_-"`     _;
     '      / /`"""'\ \ \.~`_-'      ,-"'/ 
    |      | |  0    | | .-'      ,/`  /
   |    ,..\ \     ,.-"`       ,/`    /
  ;    :    `/`""\`           ,/--==,/-----,
  |    `-...|        -.___-Z:_______J...---;
  :         `                           _-'
 _L_  _     ___  ___  ___  ___  ____--"`___  _     ___
| __|| |   |_ _|| _ \| _ \| __|| _ \   / __|| |   |_ _|
| _| | |__  | | |  _/|  _/| _| |   /  | (__ | |__  | |
|_|  |____||___||_|  |_|  |___||_|_\   \___||____||___|

Welcome to Flipper Zero Command Line Interface!
Read Manual https://docs.flipperzero.one

Firmware version: 0.43.1 0.43.1 (a4267626 built on 20-12-2021)
cab404 commented 1 year ago

Well, then probably you are experiencing old firmware problems — can be that you are on pre-protobuf version. There is a guide for updating using SD card

cab404 commented 1 year ago

Orrr, try switching to DFU! https://docs.flipperzero.one/basics/firmware-update/firmware-recovery

kurnevsky commented 1 year ago

DFU worked, thanks for the help!