We're dealing with an issue related to Bluez supervision_timeout value of 42 on a BLE connection. After following Excessive Bluetooth LE timeouts on Linux? and increasing the supervision_timeout to 200, we've found a significant decrease in BLE connection timeouts.
Here's the issue: We are creating our own Archiso ISO on the computers but cannot write to /sys/kernel/debug/bluetooth/hci0/supervision_timeout during chroot as the /sys/kernel directory does not exist at the time.
If the file does get updated when the computer starts (manually writing to file using nvim as root), the file goes back to the value of 42 on computer restart.
So I've got a couple possibilities, but unsure how to perform them.
During Archiso installation, make the supervision_timeout file be 200 instead of 42 (though we can't just copy a file during the chroot process as again, /sys/kernel/.../ directory isn't there at that point). Is this file something that is created from Bluez stack itself? I've been looking for documentation but can't find anything other than Bluez source files that define this number for supervision_timeout.
Write to the file every time the computer starts. However, I cannot perform this operation in the .xinitrc file as only the root user has access to /sys/kernel/debug/ directory.
Posting this to hopefully help someone else (and, admittedly, myself in case I forget as I cannot find the below forum topic from a Google search anymore).
See https://bbs.archlinux.org/viewtopic.php?id=279872
So, following V1del's advice I can successfully update the BLE
connection parameter (supervision_timeout) on startup of the computer.
I needed to change the systemd file a little bit as follows:
[Unit]
Description=Switching supervision timeout
Requires=bluetooth.service
After=bluetooth.service sys-kernel-debug.mount
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c "sleep 5; echo 200 > /sys/kernel/debug/bluetooth/hci0/supervision_timeout"
[Install]
WantedBy=multi-user.target
I found that I needed to wait for the /sys/debug/ filesystem to be
mounted, so needed to add sys-kernel-debug.mount to the After
declaration.
Note that the sleep in ExecStart is necessary as Bluetooth is not started yet.
Related
The problem:
I have a tablet w. stylus. I'd like the tablet to undergo some configuration whenever I connect it via USB. I'm almost there, my config-script is registered with systemctl as a oneshot service and that service is triggered the first time I connect the tablet. However the service is not triggered on subsequent connects: in other words, if I disconnect the tablet and reconnect it, the trigger is not fired. I have to do a systemctl --user daemon-reload before the trigger becomes active again. What am I missing?
System:
OS: Ubuntu 20.04.1 LTS x86_64
Kernel: 5.4.0-52-lowlatency
Here is my trigger:
filename: /etc/udev/rules.d/10-wacom.rules
ACTION=="add", SUBSYSTEMS=="usb",
ATTR{idVendor}=="256c",
ATTR{idProduct}=="006d",
MODE="0666",
TAG+="systemd",
ENV{SYSTEMD_USER_WANTS}="tablet-conf.service"
(there are no linebreaks in the actual file, I just put them in for easier reading)
Here is my service-definition:
filename: ~/.config/systemd/user/tablet-conf.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/huion-inspiroy-950d-connect.sh
[Install]
WantedBy=xsession.target
Here's my configuration-script:
Filename: ~/bin/system/devices/huion-inspiroy-950d-connect.sh
Called via a symlink /usr/local/bin/huion-inspiroy-950d-connect.sh
#!/bin/bash
touch /home/esm/bin/system/devices/a-connected-waiting
sleep 2
touch /home/esm/bin/system/devices/a-connected-waited
xsetwacom set "HID 256c:006d stylus" MapToOutput HEAD-0 2>> /home/esm/bin/system/devices/a-configured
xsetwacom set "HID 256c:006d stylus" rotate HALF 2>> /home/esm/bin/system/devices/a-configured
(as you can see, I create some empty files and log som info during the configuration. All this is of course not necessary, but I needed it, when I was figuring out how to get the trigger working. I'll remove it, once I've figured out how to get the whole thing to behave)
So the question is ...
How can I achieve that the trigger is fired on every tablet-connection, and not just the first?
For some reason emacs started to display a warning at whenever my computer starts up. The warning looks like this: https://imgur.com/a/fWz1Nu1. The text-form of the error is:
Warning (initialization): An error occurred while loading '/home/username/.emacs':
error: No such directory found via CDPATH environment variable
To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the '--debug-init' option to view a complete error backtrace.
It seems, from the error, emacs is having trouble finding the ~/.emacs config file.
This warning is incorrect, however, since after this emacs normally works fine for me without any error, after this error message at start-up. It is however a mild inconvenience.
If I had to guess why it's happening I would say it might be somehow related to the way my fstab has been set up. It's slightly different from the norm but nothing too unusual. The setup is like this (in human language):
/ is mounted on a normal partition.
/home is mounted on a LUK encrypted partition. (One thing to note is that I have always had my /home encrypted but emacs only started to play up recently)
I also have two external drives that are auto-mounted to run my media server via my workstation (although I don't think this is related to the issue at hand)
Is there anyway that I can prevent emacs from displaying this in the future? I don't have emacs in my System 'Autostart' so I'm not sure why it keeps popping up at every boot.
UPDATE
I decided to look into the log from my last reboot:
$ journalctl -b | grep emacs
..and saw this:
Jul 21 14:30:46 my-PC-name systemd[3000]: Started apps-emacs-6284d6112ffa4ee29646bcb4b3b00b0f.scope.
Jul 21 14:30:54 my-PC-name systemd[3000]: apps-emacs-6284d6112ffa4ee29646bcb4b3b00b0f.scope: Succeeded.
Why would emacs starts itself when it's disabled as per below?
systemctl --user status emacs
● emacs.service - Emacs text editor
Loaded: loaded (/usr/lib/systemd/user/emacs.service; disabled; vendor preset>
Active: inactive (dead)
Docs: info:emacs
man:emacs(1)
https://gnu.org/software/emacs/
My emacs.service file doesn't look different from the default:
$ cat /usr/lib/systemd/user/emacs.service
[Unit]
Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
[Service]
Type=simple
ExecStart=/usr/bin/emacs --fg-daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=on-failure
[Install]
WantedBy=default.target
Trying to upload a code to arduino, but whether in the Arduino IDE or Arduino Create, both return this erro while uploading. Running on Linux Tara(mint 19 cinnamon).
./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -logger humantags -fqbn arduino:avr:mega:cpu=atmega2560 -build-cache /tmp -build-path /tmp/716441957/build -verbose -libraries /tmp/716441957/custom -libraries /tmp/716441957/pinned /tmp/716441957/sketch_oct8a
Sketch uses 8280 bytes (3%) of program storage space. Maximum is 253952 bytes.
Global variables use 443 bytes (5%) of dynamic memory, leaving 7749 bytes for local variables. Maximum is 8192 bytes.
Programming with: Serial
Flashing with command:/home/jesus/.arduino-create/arduino/avrdude/6.3.0-arduino9/bin/avrdude -C/home/jesus/.arduino-create/arduino/avrdude/6.3.0-arduino9/etc/avrdude.conf -q -q -patmega2560 -cwiring -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/arduino-create-agent734074237/sketch_oct8a.hex:i
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device
ioctl("TIOCMGET"): Inappropriate ioctl for device
1#
First, check the port in your IDE. In Arduino tools->port
If the port is hidden or you can not move the cursor over this then run this commands in your terminal.If everything ok then skips this and follow the second part.
sudo apt-get install librxtx-java -y
sudo usermod -aG dialout $USER
sudo apt-get install gnome-system-tools
2#
After this again check the first method. If it is not working then run this commands
ls -l /dev/ttyACM*
sudo usermod -a -G dialout <username>
You probably have another program running which is already using this port.
You should close most other programs like putty or another serial monitor app.
Otherwise, try to reconnect the Arduino to the PC.
I know that these ideas below come from using a Teensy, but they may help you.
Sometimes there are the ACM* ports listed in the Arduino IDE. Try looking at the ser ports. I know when I am running my Teensy, sometimes I have them switched and need to select the correct one.
Also, from my experience with the Teensy, you might need to add a udev rule to allow permissions to access the port from non-root user. Here is the link that shows the udev file.
There is no direct way to solve this issue. In addition to it, you are not using an IDE. I will list the things you need to check, I am sure this will solve your problem.
I am not good at Linux environment so I will refer to applications names as window, you go the corresponding application in Linux.
Go to linux device manager and see for your arduino board. It should have proper naming like "arduino uno at port 3", then use the correct port in your command. If this name does not come properly then it means Driver is not available in your machine. So, go to step2.
Find the driver online and install it in your system, I am not sure about the support of linux with arduino, once it is done please repeat step1.
So, I conclude in short that you do not have the proper driver (which is strongly believe) or pointing the wrong port. I am not an expert with the udev rules, but it is definitely an issue you can experience with these kinds of micro-controllers.
We have a FreeBSD 8 server that hasn't been restarted since it got booted. It has been restarted now and we're trying to reconnect the NFS mount to it.
$ sudo /etc/rc.d/nfsclient start
NFS access cache time=60
rpc.umntall: not found
The obvious reason for the error rpc.umntall: not found is because the program doesn't exist on the computer.
Is there any other way to mount to a NFS server that is connected to the network than using NFSClient. Or can I force the client to move past the part in the script that requires rpc.umntall?
I only ask because it was started before, and I'd be very surprised if we removed any programs from it.
rpc.umntall is installed as part of the base system, usually in /usr/sbin/.
If you take a look at the contents of /etc/rc.d/nfsclient, you'll find this:
unmount_all()
{
# If /var/db/mounttab exists, some nfs-server has not been
# successfully notified about a previous client shutdown.
# If there is no /var/db/mounttab, we do nothing.
if [ -f /var/db/mounttab ]; then
rpc.umntall -k
fi
}
A cheap work around would be to delete /var/db/mounttab.
However, if you want to fix the problem, you'll want to fix the missing rpc.umntall. Is it not in /usr/sbin/? If not, you could try to restore it from a published image, or you could attempt to build it from source.
If it's somewhere else on the computer, you could try to find it using find / | grep rcp.umntall.
If it exists in /usr/sbin, but isn't working, then that would likely mean that something is wrong with the PATH variable being used by your rc subsystem. You could double check that by hardcoding the path to rpc.umntall right in the /etc/rc.d/nfsclient script.
We're running lighttpd-1.4.26 on FreeBSD 7.2-RELEASE. Each time we rebooted the machine, and the lighttpd was started by rc script, the pid file won't automatically write into /var/run/lighttpd.pid.
Howerver, if we start the lighttpd manually by running /usr/local/etc/rc.d/lighttpd start, the pid file will be fine.
Does any know how to solve this problem?
When you say "the lighttpd was started by rc script", are you referring to the /usr/local/etc/rc.d/lighttpd, or some other script?
Because you really should be using the same script -- indeed, the /usr/local/etc/rc.d/lighttpd will start it for you at boot, if lighthttpd_enable is set in you rc.conf -- but your wording makes me think, you use a different script at boot. It may even be, you edited /etc/rc for the purpose (a big no-no).