If the codec audio management is worked out, then all we need are hooks to make the kind of dbus api calls that are in the python examples at http://wiki.bluez.org/wiki/HOWTO/AudioDevices (need to ipkg install python-dbus and python-xml). The play method *does* need to be called; it's automatic only when using an alsa plugin which is not how it works on neo.

If the codec audio management is worked out, then all we need are hooks to make the kind of dbus api calls that are in the python examples at http://wiki.bluez.org/wiki/HOWTO/AudioDevices (need to ipkg install python-dbus and python-xml). The play method *does* need to be called; it's automatic only when using an alsa plugin which is not how it works on neo.

+

+

=== Bluetooth networking with a Linux system - More secure way ===

+

+

''Check this, probabily needs some corrections''

+

+

Bluetooth should behave just like our usbnet and provide full TCP/IP access to the phone. BNEP has to be used.

Revision as of 16:37, 28 August 2007

In progress: This article or section documents one or more features whose implementation are in progress.

Bluetooth is one of the core functions of the Neo1973, however it is basically unimplemented on the software side at the moment.
Hardware problems in the P1 phone mean that the CPU has to be active in order to wake on external bluetooth events, which will reduce the battery life to some 2 days at best in standby.

This page details how to use bluetooth from the command line.
We have quite a lot of plans about what exactly Bluetooth should be used for.

Bluetooth Functions

in file /etc/bluetooth/hcid.conf you should change the passkey from BlueZ to something numeric. For testing you may use "0000". Also, you can set the name to "Neo (%d)".

Scanning for bluetooth devices

hcitool scan

This will list the addresses of any discoverable bluetooth devices in the vicinity

passkey agent example

There should be a passkey agent built into openmoko, but for now you can start up the example passkey agent and set the pin code there. This will allow for new pairings to be made when you attempt a connection.

passkey-agent --default 0000 &

Note: the passkey-agent is not required in OpenMoko 2007.2 with kernel 2.6.21.6 as of at least since August 27 (maybe earlier).

HID (Human Input Device)

Being able to use HID devices

We want to be able to use a bluetooth keyboard to type into the various applications of our Neo1973.
To use a Bluetooth Keyboard type: (11:22:33:44:55:66 is the Address of your BT-Keyboard)

For some reason, I was not able to initiate PAN connections from the Neo, I got 'Permission denied (13)' even when I had explicitly allowed the Neo to connect (right click on Neo icon, set properties, on Authorization tab). But initiating 'PAN User' from Windows worked when executing on Neo:

pand -l -r PANU -d NAP -e bnep0 -A -E -S

(add '-n' to see the pand status messages until you get it right)

Configure your IP address. It should work like when connecting to Linux:

ip a add 10.0.0.2/24 dev bnep0
ip r add default via 10.0.0.1

If this does not work, the IP stacks may have auto-assigned network addresses to themselves. You can look this up with 'ifconfig' on the Neo and with 'ipconfig' on Windows.

You should now be able to ssh/putty from Windows to your Neo. Enjoy!

By setting up the Windows Bluetooth connection properly, it should also be possible to share the Internet Connection of the Windows box with the Neo.

PPP Networking

If you are unable to use the 'BNEP' method described above, you may be able to use a dialup-networking emulation mode. On the Neo:

Locate your Neo, then select the "LAN Access Point" service. If your device is not found, or if this service does not show up, then you will need to troubleshoot and fix that before continuing. Bluetooth is designed for short-range communication, so make sure that the devices are physically close to each other.

Open the Network Preferences page then "Show: Network Port Configurations". Enable the new device that you defined in the previous step and drag it to the bottom of the device list (so that it will not interfere with your other network connections)

Click "Connect". If everything worked, you will end up with a 'ppp0' device on your Mac with a local address of 192.168.2.200 and you will be able to access your Neo at 192.168.2.202.

A2DP

The A2DP codec, SBC, runs pretty well now in 32-bit fixed-point math. It's been successfully tested on a faster ARM but not yet on neo. There is test code in the bluetooth-alsa.sf.net plugz module for using alsa plugins to send A2DP audio out and it's starting to be reimplemented "properly" in the bluez core.

Headset Audio

Bluez has an audio daemon for headset audio that should work to set up the control connection to the headset. It will need hooks in the openmoko gui.

Neo1973_Audio_Subsystem has more detail about what magic needs to happen with the Wolfson codec so system audio can be switched to use the bluetooth audio channel and later back to the speaker/earpiece/wired headset. There seems to be a proposal for audio scenario management there but no detail about whether that is how things are done currently. How should audio management work when eg plugging in/unplugging the wired headset?

If the codec audio management is worked out, then all we need are hooks to make the kind of dbus api calls that are in the python examples at http://wiki.bluez.org/wiki/HOWTO/AudioDevices (need to ipkg install python-dbus and python-xml). The play method *does* need to be called; it's automatic only when using an alsa plugin which is not how it works on neo.

Bluetooth networking with a Linux system - More secure way

Check this, probabily needs some corrections

Bluetooth should behave just like our usbnet and provide full TCP/IP access to the phone. BNEP has to be used.

Views

Personal tools

In progress: This article or section documents one or more features whose implementation are in progress.

Bluetooth is one of the core functions of the Neo1973, however it is basically unimplemented on the software side at the moment.
Hardware problems in the P1 phone mean that the CPU has to be active in order to wake on external bluetooth events, which will reduce the battery life to some 2 days at best in standby.

This page details how to use bluetooth from the command line.
We have quite a lot of plans about what exactly Bluetooth should be used for.

Bluetooth Functions

in file /etc/bluetooth/hcid.conf you should change the passkey from BlueZ to something numeric. For testing you may use "0000". Also, you can set the name to "Neo (%d)".

Scanning for bluetooth devices

hcitool scan

This will list the addresses of any discoverable bluetooth devices in the vicinity

passkey agent example

There should be a passkey agent built into openmoko, but for now you can start up the example passkey agent and set the pin code there. This will allow for new pairings to be made when you attempt a connection.

passkey-agent --default 0000 &

Note: the passkey-agent is not required in OpenMoko 2007.2 with kernel 2.6.21.6 as of at least since August 27 (maybe earlier).

HID (Human Input Device)

Being able to use HID devices

We want to be able to use a bluetooth keyboard to type into the various applications of our Neo1973.
To use a Bluetooth Keyboard type: (11:22:33:44:55:66 is the Address of your BT-Keyboard)

For some reason, I was not able to initiate PAN connections from the Neo, I got 'Permission denied (13)' even when I had explicitly allowed the Neo to connect (right click on Neo icon, set properties, on Authorization tab). But initiating 'PAN User' from Windows worked when executing on Neo:

pand -l -r PANU -d NAP -e bnep0 -A -E -S

(add '-n' to see the pand status messages until you get it right)

Configure your IP address. It should work like when connecting to Linux:

ip a add 10.0.0.2/24 dev bnep0
ip r add default via 10.0.0.1

If this does not work, the IP stacks may have auto-assigned network addresses to themselves. You can look this up with 'ifconfig' on the Neo and with 'ipconfig' on Windows.

You should now be able to ssh/putty from Windows to your Neo. Enjoy!

By setting up the Windows Bluetooth connection properly, it should also be possible to share the Internet Connection of the Windows box with the Neo.

PPP Networking

If you are unable to use the 'BNEP' method described above, you may be able to use a dialup-networking emulation mode. On the Neo:

Locate your Neo, then select the "LAN Access Point" service. If your device is not found, or if this service does not show up, then you will need to troubleshoot and fix that before continuing. Bluetooth is designed for short-range communication, so make sure that the devices are physically close to each other.

Open the Network Preferences page then "Show: Network Port Configurations". Enable the new device that you defined in the previous step and drag it to the bottom of the device list (so that it will not interfere with your other network connections)

Click "Connect". If everything worked, you will end up with a 'ppp0' device on your Mac with a local address of 192.168.2.200 and you will be able to access your Neo at 192.168.2.202.

A2DP

The A2DP codec, SBC, runs pretty well now in 32-bit fixed-point math. It's been successfully tested on a faster ARM but not yet on neo. There is test code in the bluetooth-alsa.sf.net plugz module for using alsa plugins to send A2DP audio out and it's starting to be reimplemented "properly" in the bluez core.

Headset Audio

Bluez has an audio daemon for headset audio that should work to set up the control connection to the headset. It will need hooks in the openmoko gui.

Neo1973_Audio_Subsystem has more detail about what magic needs to happen with the Wolfson codec so system audio can be switched to use the bluetooth audio channel and later back to the speaker/earpiece/wired headset. There seems to be a proposal for audio scenario management there but no detail about whether that is how things are done currently. How should audio management work when eg plugging in/unplugging the wired headset?

If the codec audio management is worked out, then all we need are hooks to make the kind of dbus api calls that are in the python examples at http://wiki.bluez.org/wiki/HOWTO/AudioDevices (need to ipkg install python-dbus and python-xml). The play method *does* need to be called; it's automatic only when using an alsa plugin which is not how it works on neo.

Bluetooth networking with a Linux system - More secure way

Check this, probabily needs some corrections

Bluetooth should behave just like our usbnet and provide full TCP/IP access to the phone. BNEP has to be used.