Blueman GUI Bluetooth Network Access Point - fixing Bridging
#1
This post is as much notes for me to look back on as a request for better minds to review my attempts.
(edit) Skip to the bottom post where I have the PAN protocol pairing via Blueman GUI but there is still a problem with getting the network bridge working.

I added the bluetoothpan.sh as per link below and after reviewing I assume the iptables commands in the script will work without editing them.

The problem is the pinephone is not reporting in its bluetooth UUID list that it is available as a network access point.
here is the UUID from my old N900 used for years as a bluetooth network access point

Code:
<snip>
00000002-0000-1000-8000-0002ee000002 Proprietary
00001103-0000-1000-8000-00805f9b34fb Dialup Networking (DUN)
00001104-0000-1000-8000-00805f9b34fb IrMC Sync
00001105-0000-1000-8000-00805f9b34fb OBEX Object Push
00001106-0000-1000-8000-00805f9b34fb OBEX File Transfer
0000110a-0000-1000-8000-00805f9b34fb Audio Source
0000110c-0000-1000-8000-00805f9b34fb Remote Control Target
0000110e-0000-1000-8000-00805f9b34fb Remote Control
00001115-0000-1000-8000-00805f9b34fb PANU
00001116-0000-1000-8000-00805f9b34fb Network Access Point
00001117-0000-1000-8000-00805f9b34fb Group Network
0000112f-0000-1000-8000-00805f9b34fb Phonebook Access (PBAP) - PSE
00001132-0000-1000-8000-00805f9b34fb Message Access Server
00005005-0000-1000-8000-0002ee000001 Proprietary
00005601-0000-1000-8000-0002ee000001 Proprietary
/org/bluez/hci0
VS pinephone as is after script, unpair, reboot, and re-pair

Code:
<snip>
00001104-0000-1000-8000-00805f9b34fb IrMC Sync
00001105-0000-1000-8000-00805f9b34fb OBEX Object Push
00001106-0000-1000-8000-00805f9b34fb OBEX File Transfer
00001108-0000-1000-8000-00805f9b34fb Headset
0000110a-0000-1000-8000-00805f9b34fb Audio Source
0000110b-0000-1000-8000-00805f9b34fb Audio Sink
0000110c-0000-1000-8000-00805f9b34fb Remote Control Target
0000110d-0000-1000-8000-00805f9b34fb Advanced Audio
0000110e-0000-1000-8000-00805f9b34fb Remote Control
0000111f-0000-1000-8000-00805f9b34fb Handsfree Audio Gateway
0000112f-0000-1000-8000-00805f9b34fb Phonebook Access (PBAP) - PSE
00001132-0000-1000-8000-00805f9b34fb Message Access Server
00001133-0000-1000-8000-00805f9b34fb Message Notification Server
00001200-0000-1000-8000-00805f9b34fb PnP Information
00001800-0000-1000-8000-00805f9b34fb Generic Access
00001801-0000-1000-8000-00805f9b34fb Generic Attribute
0000180a-0000-1000-8000-00805f9b34fb Device Information
00005005-0000-1000-8000-0002ee000001 Proprietary
usb:v1D6Bp0246d053E
/org/bluez/hci0

I followed the old N900 PAN script exactly after reviewing it
https://wiki.maemo.org/Bluetooth_PAN
I realize that the package genwall is probably what is doing the work bridging mobile data and bnep0 http://maemo.org/packages/view/genwall/
but not sure where/how the PAN and BT network access point profiles are generated on the N900 but not the Pinephone

Code:
When connecting the PinePhone through the USB cable it creates a network the PC will join. The PinePhone has the IP address 10.66.0.1 fixed but the IP address of your PC will vary. Set up ip-forwarding on your PC and set up NAT on your outgoing internet interface:

sudo sysctl net.ipv4.ip_forward=1
sudo iptables -P FORWARD ACCEPT
DEV=$(ip route get 1 | grep -o 'dev .*' | cut -d ' ' -f 2)
sudo iptables -t nat -D POSTROUTING -o "$DEV" -j MASQUERADE 2> /dev/null || true
sudo iptables -t nat -A POSTROUTING -o "$DEV" -j MASQUERADE

Afterwards, on the PinePhone, e.g., through SSH to 10.66.0.1, you need to set the default route to be your PC's USB network interface, and you need to define a DNS server (here 1.1.1.1 from Cloudflare):

sudo ip route add default via "$(arp -n | grep 10.66.0. | grep ether | cut -d ' ' -f 1)"
sudo resolvectl dns usb0 1.1.1.1
sudo resolvectl default-route usb0 true

When you disconnect the cable without rebooting any device, on reconnecting you only need to repeat the commands on the PinePhone to set up the default route again.
the above from https://wiki.mobian-project.org/doku.php...pc-via-usb still requires SSHing into your phone VS using it as an automated BT net access point.

UFW https://wiki.mobian-project.org/doku.php...g#firewall might work to bridge mobile data to bnep0 but we still have the UUID problem.

and do I need to kludge about with scripting a bnep0?

https://www.linuxquestions.org/questions...157-print/

I dont think so because the

Code:
/etc/udev/rules.d/98-bnep0.rules:

ACTION=="add", SUBSYSTEM=="net",  KERNEL=="bnep0", RUN+="/etc/udev/bluenet.sh"
ACTION=="remove", SUBSYSTEM=="net",  KERNEL=="bnep0", RUN+="/etc/udev/bluenet.sh"

generates the bnep0 device

additionaly the /etc/udev/bluenet.sh script might be a bit wonky

just to note it here a friend suggested to me
>this is why often, folks write stuff like    if [ x$ACTION = x"add" ]; then
>you need to export ACTION = "add"
> if you want to run this script manually
> or
> Action=add /etc/udev/bluenet.sh
> for debugging you may insert a line#2 of    logger "this is /etc/udev/bluenet.sh action: $ACTION"  and see what you get in syslog
> logger "this is /etc/udev/bluenet.sh action: $ACTION"« is also a good way to check if the udev on your target platform maybe defines other actions than "add" for $ACTION
> which might well be the real root of your problem
>arbitrary example (I plugged in a USB memstick) https://termbin.com/m7h7
> mobian@mobian:/usr/sbin$ sudo /etc/udev/bluenet.sh
> will fail, like you seen
> you need
> mobian@mobian:/usr/sbin$ sudo ACTION=add /etc/udev/bluenet.sh

this document probably has everything needed as it creates a PAN for an OpenWRT router
https://elinux.org/images/1/15/ELC_NA_20...0814r1.pdf
including the below
Code:
root@OpenWrt:~# dbus-send --system
--dest=org.bluez /org/bluez/hci0
--type=method_call
org.bluez.NetworkServer1.Register
string:“00001116-0000-1000-8000-00805f9b34fb”
string:"br-lan"

which full circle seems to address the UUID issue, maybe better minds will see the answer in the steps I have taken and info gathered in this post.
  Reply


Messages In This Thread
Blueman GUI Bluetooth Network Access Point - fixing Bridging - by biketool - 03-20-2022, 02:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mobile internet via cellular network mostly not working Anna 18 10,617 01-19-2024, 02:59 AM
Last Post: anonymous
  Not connecting to cellular network car46999 18 7,741 01-30-2023, 12:06 AM
Last Post: car46999
  Bluetooth audio revisited 3x5co 1 1,118 01-10-2023, 05:51 PM
Last Post: Zebulon Walton
  need help with downgradin network-manager Ferriah 0 673 11-07-2022, 04:51 PM
Last Post: Ferriah
  Exclamation point in cellular icon after update Zebulon Walton 8 4,876 06-22-2022, 05:57 PM
Last Post: albafrati
  Any fix for bluetooth crash when entering pairing password? kk22 0 879 06-18-2022, 07:51 PM
Last Post: kk22
  Scripting Bluetooth Hotspot for Mobian biketool 1 1,565 03-20-2022, 03:03 PM
Last Post: biketool
  Bluetooth audio support? Zebulon Walton 5 3,791 02-28-2022, 08:59 AM
Last Post: Zebulon Walton
  Mobile network mode setting not saved Zebulon Walton 3 3,129 12-05-2021, 12:12 AM
Last Post: bcnaz
  no access to webdav files (for some apps) jsch 0 1,288 11-13-2021, 09:46 AM
Last Post: jsch

Forum Jump:


Users browsing this thread: 1 Guest(s)