Last active
December 12, 2023 13:14
-
-
Save rcarmo/6ad6c09e904c35857bad2dd2769edf76 to your computer and use it in GitHub Desktop.
Set up PAN networking on Raspbian Stretch (use sudo to create these files and run all commands)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in /etc/systemd/system | |
[Unit] | |
Description=Bluetooth Agent | |
[Service] | |
ExecStart=/usr/bin/bt-agent -c NoInputNoOutput | |
Type=simple | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in /etc/systemd/system | |
[Unit] | |
Description=Bluetoot PAN | |
After=pan0.network | |
[Service] | |
ExecStart=/usr/bin/bt-network -s nap pan0 | |
ExecStartPost=bt-adapter --set Discoverable 1 | |
Type=simple | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in /etc/systemd/network | |
[NetDev] | |
Name=pan0 | |
Kind=bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in /etc/systemd/network | |
[Match] | |
Name=pan0 | |
[Network] | |
Address=172.20.1.1/24 | |
DHCPServer=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install bluez-tools | |
# place other files | |
systemctl enable systemd-networkd | |
systemctl start systemd-networkd | |
systemctl enable bt-agent | |
systemctl start bt-agent | |
systemctl enable bt-network | |
systemctl start bt-network | |
bt-adapter --set Discoverable 1 |
Oh, right. I already had it in place.
For those of you coming over out of the blue:
pi.local
gets automatically announced over Rendezvous, so that’s the hostname I usually SSH to.
Those of you using Windows are a bit out of luck here (PAN seems to work, but usually requires setting IP addresses on both ends to work reliably, and Rendezvous is obviously not supported).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the gist!
Had to run
apt install bluez
to get bluetoothd, which seemed to be missing.