Hi!
A few questions all related: I fly FPV drones which require to use betaflight to configure them over the serial port. This has been working ok in the past and is getting more and more confusing. The timeline is far from accurate but in short:
1. Everything used to work fine a few Fedora releases ago (not so many)
2. dmesg now requires sudo
3. Serial port also requires sudo ( /dev/ttyACM0 ) for betaflight to be able to access it
4. dmesg doesn't show the serial port connection happening anymore since about after Monday 12th and therefore I can't do anything anymore.
I´ve read that the serial port access problem could be due to group permissions so some guidance would help but in general I'd be happy to run both dmesg and the serial port from my user, and eventually understand why suddenly connecting the flight controller to the serial port (USB that is) doesn't seem to work anymore.
Thank you.
Fred
On 16 Aug 2024, at 08:54, Frederic Muller fred@cm17.com wrote:
Serial port also requires sudo ( /dev/ttyACM0 ) for betaflight to be able to access it
Look into adding a udev rule to set the permissions you need on the serial device. Then you can avoid using sudo.
sudo became required for dmesg as unpriv’ed access to the dmesg logs is a security risk that can being exploited by malware.
Barry
On Fri, Aug 16, 2024 at 12:12 PM Barry barry@barrys-emacs.org wrote:
On 16 Aug 2024, at 08:54, Frederic Muller fred@cm17.com wrote:
Serial port also requires sudo ( /dev/ttyACM0 ) for betaflight to be able to access it
Look into adding a udev rule to set the permissions you need on the serial device. Then you can avoid using sudo.
Or add the user that needs this access to the "dialout" group (and log out and back in so the group gets added to the user). By default that group is put on serial ports and that group has full rw.
sudo became required for dmesg as unpriv’ed access to the dmesg logs is a security risk that can being exploited by malware.
Barry
sysctl -w kernel.dmesg_restrict=0 and setting that parameter in a /etc/sysctl.d so it gets done at boot returns the original behavior.
Though as noted it is possible to gain useful information that malware may be able to use to break out of being an unpriv'ed user to become prived.
On Fri, Aug 16, 2024 at 3:54 AM Frederic Muller fred@cm17.com wrote:
A few questions all related: I fly FPV drones which require to use betaflight to configure them over the serial port. This has been working ok in the past and is getting more and more confusing. The timeline is far from accurate but in short:
Everything used to work fine a few Fedora releases ago (not so many)
dmesg now requires sudo
Yes, that change happened recently. Do something like https://unix.stackexchange.com/a/401626.
- Serial port also requires sudo ( /dev/ttyACM0 ) for betaflight to be
able to access it
Add your user to dialout group. Something like:
sudo usermod -a -G dialout fmuller
- dmesg doesn't show the serial port connection happening anymore since
about after Monday 12th and therefore I can't do anything anymore.
Sounds unusual.
I´ve read that the serial port access problem could be due to group permissions so some guidance would help but in general I'd be happy to run both dmesg and the serial port from my user, and eventually understand why suddenly connecting the flight controller to the serial port (USB that is) doesn't seem to work anymore.
Jeff
On 17/08/2024 02:48, Jeffrey Walton wrote:
On Fri, Aug 16, 2024 at 3:54 AM Frederic Muller fred@cm17.com wrote:
A few questions all related: I fly FPV drones which require to use betaflight to configure them over the serial port. This has been working ok in the past and is getting more and more confusing. The timeline is far from accurate but in short:
Everything used to work fine a few Fedora releases ago (not so many)
dmesg now requires sudo
Yes, that change happened recently. Do something like https://unix.stackexchange.com/a/401626.
Thank you all for clarifying. I guess I'll keep sudo for dmesg for security reasons.
- Serial port also requires sudo ( /dev/ttyACM0 ) for betaflight to be
able to access it
Add your user to dialout group. Something like:
sudo usermod -a -G dialout fmuller
Likewise thank you for that one too!
- dmesg doesn't show the serial port connection happening anymore since
about after Monday 12th and therefore I can't do anything anymore.
Sounds unusual.
Yeah.. I figure it out, put on my "close-view" glasses, realized it was not a USB C cable connecting, tried another one and... it worked! Obviously I was using one of those non-data capable cable and no data was going through that port. My bad.
At least I've fixed the com port access and understood why dmesg requires sudo now.
Thank you everybody.
Fred
On Sat, 2024-08-17 at 16:08 +0700, Frederic Muller wrote:
Obviously I was using one of those non-data capable cable and no data was going through that port.
I've never come across a charge-only cable. I understand why someone would use one (e.g. public charging), but I thought some use of the data pins was necessary to switch from lower power mode.
If you keep unusual cables, label them. It'll save you from some headaches in the future.
On 17/08/2024 17:48, Tim via users wrote:
On Sat, 2024-08-17 at 16:08 +0700, Frederic Muller wrote:
Obviously I was using one of those non-data capable cable and no data was going through that port.
I've never come across a charge-only cable. I understand why someone would use one (e.g. public charging), but I thought some use of the data pins was necessary to switch from lower power mode.
If you keep unusual cables, label them. It'll save you from some headaches in the future.
Yeah... funny you wrote this as I was wondering they make those kind of cables as the extra cost for full data cable is really not much and secondly why they are not labelled as such! ... guess I could indeed label them myself.
I usually get those when buying cheap battery-powered stuff requiring a cable to charge its battery. So I will label them when I identify some.
Thank you.
Fred
Tim:
I've never come across a charge-only cable. I understand why someone would use one (e.g. public charging), but I thought some use of the data pins was necessary to switch from lower power mode.
If you keep unusual cables, label them. It'll save you from some headaches in the future.
Frederic Muller:
Yeah... funny you wrote this as I was wondering they make those kind of cables as the extra cost for full data cable is really not much and secondly why they are not labelled as such! ... guess I could indeed label them myself.
I usually get those when buying cheap battery-powered stuff requiring a cable to charge its battery. So I will label them when I identify some.
After many years of accumulating equipment with external power supplies, I've come to labelling what they belonged with. Quite often the specs written on the device are too vague, and find one plugpack could power several devices, but only one plugpack will power a specific device.
USB cabling is a bit like that. If you get a gadget that uses a USB connection simply as a 5 volt supply, they may just wire up the two supply pins to the cable, and hope that any USB port will supply as much current as the device needs (according to spec, dumb wiring should only supply a very minimum of current, which won't be enough for most things, and higher amounts need negotiating). They may put some extra bits in the supply end of the plug that tells a slightly smart power supply to supply more current, or it could be in the device (necessitating a fully wired USB lead). But for the really smart (I hate that description) devices and supplies that have more voltage and current options, there's supposed to be more to it than just jumpering some pins together in one plug in the cable.
As an example, a friend had to faff about finding the right cable to recharge his tablet. Some cables don't work. It could be that the wiring is so thin that there's significant loss across the cable. Or, it's more likely that it needs more than a plain two-wire cable to work, and perhaps a specific charger, too.
People tend to think of USB as being universal (it is named that way), but it's far from it. There's a bunch of variations, and the lowest common denominator is very low.