I am trying to automatically bind/pair (not connect) an ePuck robot with Linux using a bash script. I researched a lot about bluetoothctl but found nothing really useful. The problem is that the ePuck uses a fixed pin, so I have to manually type the pin every time I want to bind/pair it (I remove/unpair the ePuck every time after I finished my work that's why I have to reenter the pin every time).
It shouldn't nessesserly be a bashscript. I've heard that I could make it with python too. But I'am new at Linux and coding so that's why I'm asking.
This is what I have so far (2228 is the pin of the ePuck):
#!/bin/bash
##first tried with EOF
bluetoothctl <<EOF
power on
agnet on
scan on
pair 10:00:E8:AD:77:31
2228
EOF
##then with echo -e
echo -e 'power on\nagent on\nscan on\npair 10:00:E8:AD:77:31\n2228\n' | bluetoothctl
I don't know exactly how to use EOF or echo -e but I have this solutions out of the internet. In both ways no pairing has been done. It seems like bluetoothctl is quit too quickly.