I have a node-red project where I test the throughput of a bluetooth device, and this part is working fine. However when the test is concluded, I want to remove the device under test from blutoothctl, and have been running into problems getting this to work through node-red. Currently I have a function node that passes the payload "remove [device MAC]" to an exec node running bluetoothctl in spawn mode. This does not remove the device. This makes sense, because if I manually run the command "bluetoothctl remove [device MAC]" it doesn't get removed either.
I am able to successfully remove the device manually from the command line by running the following commands in succession:
2.) remove [device MAC]
I can't imagine I'm the first person trying to do this...is there a way to pipe commands into bluetoothctl through node-red?
Here is what my exec node currently looks like: