2

I need to run this command line at startup:

echo 1 > /sys/module/bluetooth/parameters/disable_ertm 

When I go to terminal type SU enter my password type that command it works perfectly, yet when I add that line to /etc/rc.local before the exit 0 it does nothing at all.

I am running Raspian on a Raspberry pi.

larsks
  • 32,449
  • 5
  • 54
  • 70
Steve
  • 23
  • 3

2 Answers2

3

That's a kernel module parameter, so the best way to set that is by creating a file in /etc/modprobe.d. E.g., create /etc/modprobe.d/bluetooth.conf with the contents:

options bluetooth disable_ertm=1

Reboot your system, and check that /sys/module/bluetooth/parameters/disable_ertm looks as you expect.

larsks
  • 32,449
  • 5
  • 54
  • 70
0

Can you create a systemd service to run a bash script containing the command:

[Unit]
Description=disable_ertm
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/path/to/bash/script

[Install]
WantedBy=multi-user.target

Actual Script:

#!/bin/bash
echo 1 > /sys/module/bluetooth/parameters/disable_ertm

Or add to rc.local like:

sudo update-rc.d /path/to/bash/script defaults

Make sure it is chmod +x.

Michael Prokopec
  • 2,202
  • 7
  • 21