To OP ... have you tried removing that bit of code to see what happens?
Code: -------------------- def run_hci_cmd(cmd, hci="hci0", wait=1): cmd_ = ["hcitool", "-i", hci, "cmd"] cmd_ += cmd print(cmd_) subprocess.run(cmd_) if wait > 0: time.sleep(wait) def start_advertising(key, interval_ms=2000): addr = bytearray(key[:6]) addr[0] |= 0b11000000 adv = advertisement_template() adv[7:29] = key[6:28] adv[29] = key[0] >> 6 print(f"key ({len(key):2}) {key.hex()}") print(f"address ({len(addr):2}) {addr.hex()}") print(f"payload ({len(adv):2}) {adv.hex()}") # Set BLE address run_hci_cmd(["0x3f", "0x001"] + bytes_to_strarray(addr, with_prefix=True)[::-1]) subprocess.run(["systemctl", "restart", "bluetooth"]) time.sleep(1) # Set BLE advertisement payload run_hci_cmd(["0x08", "0x0008"] + [format(len(adv), "x")] + bytes_to_strarray(adv)) # Set BLE advertising mode interval_enc = struct.pack("<h", interval_ms) hci_set_adv_params = ["0x08", "0x0006"] hci_set_adv_params += bytes_to_strarray(interval_enc) hci_set_adv_params += bytes_to_strarray(interval_enc) hci_set_adv_params += ["03", "00", "00", "00", "00", "00", "00", "00", "00"] hci_set_adv_params += ["07", "00"] run_hci_cmd(hci_set_adv_params) # Start BLE advertising run_hci_cmd(["0x08", "0x000a"] + ["01"], wait=0) -------------------- Simply put a # in front of subprocess.run(["systemctl", "restart", "bluetooth"]) Paul Webster http://dabdig.blogspot.com author of \"now playing\" plugins covering radio france (fip etc), planetradio (bauer - kiss, absolute, scala, jazzfm etc), kcrw, supla finland, abc australia, cbc/radio-canada and rte ireland ------------------------------------------------------------------------ Paul Webster's Profile: http://forums.slimdevices.com/member.php?userid=105 View this thread: http://forums.slimdevices.com/showthread.php?t=115114 _______________________________________________ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix