Trying Serial Port /dev/ttyS0 - Faile to find suitable Port

Having issues connecting to my flipper on my Gentoo system. It tries to connect to the serial port and then just can’t? The distribution is Gentoo, so it leads me to believe that I’m missing some important kernel config (what though is beyond me). I am a member of the dialout group, and I have installed the udev rules. Works fine via bluetooth and my windows machine. Even compiling qFlipper myself did not help.

CLI output is as follows

$sudo ./qFlipper-x86_64-1.2.2.AppImage cli -d 2
1 [CLI] Performing full firmware update...
1 [CLI] Waiting for devices...
99 [REG] Detected new device: VID_0x483:PID_0x5740
145 [DBG] Trying serial port  at /dev/ttyS0
191 [DBG] Trying serial port  at /dev/ttyS0
237 [DBG] Trying serial port  at /dev/ttyS0
282 [DBG] Trying serial port  at /dev/ttyS0
330 [DBG] Trying serial port  at /dev/ttyS0
375 [DBG] Trying serial port  at /dev/ttyS0
375 [UPD] Fetched update information from https://update.flipperzero.one/firmware/directory.json
425 [DBG] Trying serial port  at /dev/ttyS0
470 [DBG] Trying serial port  at /dev/ttyS0
520 [DBG] Trying serial port  at /dev/ttyS0
566 [DBG] Trying serial port  at /dev/ttyS0
615 [DBG] Trying serial port  at /dev/ttyS0
661 [DBG] Trying serial port  at /dev/ttyS0
710 [DBG] Trying serial port  at /dev/ttyS0
755 [DBG] Trying serial port  at /dev/ttyS0
805 [DBG] Trying serial port  at /dev/ttyS0
850 [DBG] Trying serial port  at /dev/ttyS0
900 [DBG] Trying serial port  at /dev/ttyS0
945 [DBG] Trying serial port  at /dev/ttyS0
997 [DBG] Trying serial port  at /dev/ttyS0
1042 [DBG] Trying serial port  at /dev/ttyS0
1096 [DBG] Trying serial port  at /dev/ttyS0
1141 [DBG] Trying serial port  at /dev/ttyS0
1197 [DBG] Trying serial port  at /dev/ttyS0
1247 [DBG] Trying serial port  at /dev/ttyS0
1297 [DBG] Trying serial port  at /dev/ttyS0
1342 [DBG] Trying serial port  at /dev/ttyS0
1398 [DBG] Trying serial port  at /dev/ttyS0
1443 [DBG] Trying serial port  at /dev/ttyS0
1498 [DBG] Trying serial port  at /dev/ttyS0
1544 [DBG] Trying serial port  at /dev/ttyS0
1597 [DBG] Trying serial port  at /dev/ttyS0
1642 [DBG] Trying serial port  at /dev/ttyS0
1697 [DBG] Trying serial port  at /dev/ttyS0
1742 [DBG] Trying serial port  at /dev/ttyS0
1797 [DBG] Trying serial port  at /dev/ttyS0
1842 [DBG] Trying serial port  at /dev/ttyS0
1897 [DBG] Trying serial port  at /dev/ttyS0
1942 [DBG] Trying serial port  at /dev/ttyS0
1998 [DBG] Trying serial port  at /dev/ttyS0
2043 [DBG] Trying serial port  at /dev/ttyS0
2097 [DBG] Trying serial port  at /dev/ttyS0
2142 [DBG] Trying serial port  at /dev/ttyS0
2197 [DBG] Trying serial port  at /dev/ttyS0
2243 [DBG] Trying serial port  at /dev/ttyS0
2300 [DBG] Trying serial port  at /dev/ttyS0
2345 [DBG] Trying serial port  at /dev/ttyS0
2397 [DBG] Trying serial port  at /dev/ttyS0
2442 [DBG] Trying serial port  at /dev/ttyS0
2498 [DBG] Trying serial port  at /dev/ttyS0
2544 [DBG] Trying serial port  at /dev/ttyS0
2597 [DBG] Trying serial port  at /dev/ttyS0
2642 [DBG] Trying serial port  at /dev/ttyS0
2697 [DBG] Trying serial port  at /dev/ttyS0
2742 [DBG] Trying serial port  at /dev/ttyS0
2797 [DBG] Trying serial port  at /dev/ttyS0
2843 [DBG] Trying serial port  at /dev/ttyS0
2898 [DBG] Trying serial port  at /dev/ttyS0
2943 [DBG] Trying serial port  at /dev/ttyS0
2998 [DBG] Trying serial port  at /dev/ttyS0
3043 [DBG] Trying serial port  at /dev/ttyS0
3097 [DBG] Trying serial port  at /dev/ttyS0
3143 [DBG] Trying serial port  at /dev/ttyS0
3197 [DBG] Trying serial port  at /dev/ttyS0
3243 [DBG] Trying serial port  at /dev/ttyS0
3297 [DBG] Trying serial port  at /dev/ttyS0
3342 [DBG] Trying serial port  at /dev/ttyS0
3397 [DBG] Trying serial port  at /dev/ttyS0
3442 [DBG] Trying serial port  at /dev/ttyS0
3499 [DBG] Trying serial port  at /dev/ttyS0
3546 [DBG] Trying serial port  at /dev/ttyS0
3597 [DBG] Trying serial port  at /dev/ttyS0
3643 [DBG] Trying serial port  at /dev/ttyS0
3698 [DBG] Trying serial port  at /dev/ttyS0
3743 [DBG] Trying serial port  at /dev/ttyS0
3798 [DBG] Trying serial port  at /dev/ttyS0
3843 [DBG] Trying serial port  at /dev/ttyS0
3897 [DBG] Trying serial port  at /dev/ttyS0
3942 [DBG] Trying serial port  at /dev/ttyS0
3997 [DBG] Trying serial port  at /dev/ttyS0
4042 [DBG] Trying serial port  at /dev/ttyS0
4096 [DBG] Trying serial port  at /dev/ttyS0
4141 [DBG] Trying serial port  at /dev/ttyS0
4197 [DBG] Trying serial port  at /dev/ttyS0
4248 [DBG] Trying serial port  at /dev/ttyS0
4297 [DBG] Trying serial port  at /dev/ttyS0
4342 [DBG] Trying serial port  at /dev/ttyS0
4397 [DBG] Trying serial port  at /dev/ttyS0
4443 [DBG] Trying serial port  at /dev/ttyS0
4499 [DBG] Trying serial port  at /dev/ttyS0
4544 [DBG] Trying serial port  at /dev/ttyS0
4597 [DBG] Trying serial port  at /dev/ttyS0
4643 [DBG] Trying serial port  at /dev/ttyS0
4697 [DBG] Trying serial port  at /dev/ttyS0
4742 [DBG] Trying serial port  at /dev/ttyS0
4798 [DBG] Trying serial port  at /dev/ttyS0
4843 [DBG] Trying serial port  at /dev/ttyS0
4897 [DBG] Trying serial port  at /dev/ttyS0
4942 [DBG] Trying serial port  at /dev/ttyS0
4997 [DBG] Trying serial port  at /dev/ttyS0
5012 [REG] Device initialization failed: Failed to find a suitable serial port
5012 [CLI] An error has occurred: BackendError::SerialAccessError. Exiting.

GUI output

1 Like

Step 2 in the right hand window of your Screenshot should help. Your system needs the udev rule, to find the flipper.

Also the user should be in the group dialout, but this is not often an issue.

Reading the first message more carefully reveals that OP did both.

Can you sudo cu /dev/ttyS0 or something along that line?
Sounds possible that qFlipper is trying the wrong port.

I’ll try to read. But read one block without any line break at the small mobile phone display is sometimes hard.
Sorry, that I am just a human and not ChatGTP like.

Does ./qflipper-x68_46-1.2.2.AppImage rules install works?
Do you see the rule on your system?
lupus@kira:~$ ls /etc/udev/rules.d/*flipper* /etc/udev/rules.d/42-flipperzero.rules

  1. You should not need (or use) sudo, except for installing the udev rule.
  2. Does it work without cli -d 2? I’m not familiar with the -d 2 switch, but it seems to overwrite some autodetection.

It seems it will autoupdate the flipper. Damn, I should have read the manual, before. … It works for me, with the options.

I don’t appear to have a cu command on my system nor could I find a way to install the command. Something similar I could find is setserial.

$ sudo setserial -g /dev/ttyS0
/dev/ttyS0, UART: 16550A, Port: 0x3060, IRQ: 19
# not having sudo gives this output
$ setserial -g /dev/ttyS0
/dev/ttyS0: Device or resource busy
# Other port for reference (sudo makes no change)
$ setserial -g /dev/ttyS1
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
$ sudo ./qFlipper-x86_64-1.2.2.AppImage rules install
The rules have already been installed. Bye!
$ cat /etc/udev/rules.d/42-flipperzero.rules
#Flipper Zero serial port
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", ATTRS{manufacturer}=="Flipper Devices Inc.", TAG+="uaccess", GROUP="dialout"
#Flipper Zero DFU
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", ATTRS{manufacturer}=="STMicroelectronics", TAG+="uaccess", GROUP="dialout"
#Flipper ESP32s2 BlackMagic
SUBSYSTEMS=="usb", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="40??", ATTRS{manufacturer}=="Flipper Devices Inc.", TAG+="uaccess", GROUP="dialout"
$ groups | rg dialout
... dialout ... khilseith

screen then, or cat as a last resort.

sudo screen /dev/ttyS0 clears my terminal screen and doesn’t do anything else. My terminal becomes completely unresponsive. And all that is shown is the cursor. I am unable to even input Ctrl+C or anything similar. sudo screen /dev/ttyS1 by contrast immediately terminates after clearing my screen. sudo cat /dev/ttyS0 similarly does nothing and simply hangs, never finishing. sudo cat /dev/ttyS1 is simply a blank file, so no output.

Interesting.
lsusb?
Looks like qFlipper autodetects the wrong port to connect.
At least, it is not permissions/groups, if even root can’t do it.
Other ideas, not directly related, are:

  • Firmware upgrade or downgrade
  • Checking if BadUSB or USB remote works
  • Another USB cable
  • Live CD with other OS, if possible

It took a couple hours of searching and going through my kernel config until I noticed not all the serial devices I expected were there. I’d forgotten to add USB Modem support (can be built as a module).

Device Drivers  --->
    [*] USB support ---> 
      <*> USB Modem (CDC ACM) support
1 Like

My hero :pray:

i have the same problem, but it worked before. the udev rule exists, and i am in the dialout group.

As @cpittman wrote, the USB Modem (CDC ACM) support needs to be enabled.

When the flipper is plugged in:

~$ lsmod | grep -i acm
cdc_acm                45056  0
usbcore               344064  11 ehci_pci,usbnet,cdc_acm,usb_storage,cdc_wdm,uvcvideo,ehci_hcd,btusb,cdc_ether,uas,uhci_hcd

see if the driver is supported in actual loaded kernel:

~$ grep -i acm /boot/config-$(uname -r)
# CONFIG_VIDEO_RDACM20 is not set
# CONFIG_VIDEO_RDACM21 is not set
CONFIG_USB_ACM=m
CONFIG_USB_F_ACM=m
CONFIG_USB_CONFIGFS_ACM=y
# CONFIG_USB_G_ACM_MS is not set

Behind ‘Config_USB_ACM’ you’ll see =m. That means it is a module. If it would be =y, it is compiled into the kernel and nit seen in lsmod.

1 Like

Hi,

$ lsmod | grep -i acm
cdc_acm                45056  0
usbcore               331776  5 xhci_hcd,cdc_acm,uvcvideo,btusb,xhci_pci

and

$ grep -i acm /boot/config-$(uname -r)|grep -v "^#"
CONFIG_USB_ACM=m
CONFIG_USB_F_ACM=m
CONFIG_USB_CONFIGFS_ACM=y
$ ./qFlipper-x86_64-1.3.0.AppImage rules install
The rules have already been installed. Bye!
$ ls /etc/udev/rules.d/*flipper* 
/etc/udev/rules.d/42-flipperzero.rules
$ groups|grep -o dialout
dialout

Any other ideas? @Astra maybe?