WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Bluetooth PAN on rpi0W and piCore 9.0.3  (Read 110 times)

Offline gjm

  • WikiUser
  • *
  • Posts: 6
Bluetooth PAN on rpi0W and piCore 9.0.3
« on: May 24, 2018, 11:54:53 AM »
Hi all,

I've been trying to setup Bluetooth on a rpi0W following various posts on here, but all seem to relate either to piCore 8.x.x and/or rpi3 so I'm really struggling to get it all working as I can't. 

Ultimately I'd like to be able to set up the rpi0W as a PAN (either GN or NAP) so that clients can access HTML files from an HTTPD running on the rpi0W but would be happy just to get the Bluetooth working in any capacity.

Device: rpi0W
OS: piCore 9.0.3

Other forum threads talk about tce firmware-rpi3-bt and bluez but I can't find anything in the TCZ's other than bluetooth-4.9.22-piCore.

Any help gratefully received.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9968
Re: Bluetooth PAN on rpi0W and piCore 9.0.3
« Reply #1 on: May 24, 2018, 11:00:00 PM »
there's a bluez extension in the piCore 9.x armv7 repo - this might also work for armv6?

Offline gjm

  • WikiUser
  • *
  • Posts: 6
Re: Bluetooth PAN on rpi0W and piCore 9.0.3
« Reply #2 on: May 25, 2018, 03:41:04 AM »
Hi and many thanks for your reply.

I've taken your advice and installed the ARM7 version of BlueZ.  tce-load -i bluez returns an OK so I assume that's all good.

In one of your threads (http://forum.tinycorelinux.net/index.php/topic,20854.msg133929.html#msg133929) I follow your instructions as far as the dmesg command which completes as per your example but when I move onto the next part running dbus start I get an error "not found".  The same for trying to run bluetoothd -nd... "not found"

I'm obviously missing something here but not sure what exactly?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9968
Re: Bluetooth PAN on rpi0W and piCore 9.0.3
« Reply #3 on: May 25, 2018, 04:55:58 AM »
Does the following show that dbus is loaded:
Code: [Select]
$ tce-status -i | grep dbus

Offline gjm

  • WikiUser
  • *
  • Posts: 6
Re: Bluetooth PAN on rpi0W and piCore 9.0.3
« Reply #4 on: May 25, 2018, 05:42:49 AM »
It responds with
Code: [Select]
tc@box:/mnt/mmcblk0p2/tce/optional$ tce-status -i | grep dbus
dbus
dbus-dev
dbus-glib

    [EDIT]: Replaced  tt  tags with  code  tags.  Rich
« Last Edit: May 25, 2018, 06:11:48 AM by Rich »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9968
Re: Bluetooth PAN on rpi0W and piCore 9.0.3
« Reply #5 on: May 25, 2018, 05:53:01 AM »
..and this doesn't work:
Code: [Select]
$ sudo /usr/local/etc/init.d/dbus start
$ ps aux | grep dbus

Offline gjm

  • WikiUser
  • *
  • Posts: 6
Re: Bluetooth PAN on rpi0W and piCore 9.0.3
« Reply #6 on: May 25, 2018, 05:58:59 AM »
.... and that gives

Code: [Select]
tc@box:/mnt/mmcblk0p2/tce/optional$ sudo /usr/local/etc/init.d/dbus start
tc@box:/mnt/mmcblk0p2/tce/optional$ ps aux | grep dbus
 1620 tc       /usr/local/bin/dbus-daemon --system
 1622 tc       grep dbus

 dbus  didn't work previously and the only thing I've done since it didn't work is install BlueZ!

    [EDIT]: Replaced  tt  tags with  code  tags.  Rich
« Last Edit: May 25, 2018, 06:13:25 AM by Rich »

Offline gjm

  • WikiUser
  • *
  • Posts: 6
Re: Bluetooth PAN on rpi0W and piCore 9.0.3
« Reply #7 on: May 25, 2018, 06:08:43 AM »
If i then continue with your instructions and issue  sudo /usr/local/lib/bluetooth/bluetoothd -nd  I get

Code: [Select]
tc@box:/mnt/mmcblk0p2/tce/optional$ sudo /usr/local/lib/bluetooth/bluetoothd -nd
bluetoothd[1623]: Bluetooth daemon 5.43
bluetoothd[1623]: src/main.c:parse_config() parsing main.conf
bluetoothd[1623]: src/main.c:parse_config() Key file does not have key “DiscoverableTimeout” in group “General”
bluetoothd[1623]: src/main.c:parse_config() Key file does not have key “PairableTimeout” in group “General”
bluetoothd[1623]: src/main.c:parse_config() Key file does not have key “AutoConnectTimeout” in group “General”
bluetoothd[1623]: src/main.c:parse_config() Key file does not have key “Privacy” in group “General”
bluetoothd[1623]: src/main.c:parse_config() name=Rpi
bluetoothd[1623]: src/main.c:parse_config() Key file does not have key “Class” in group “General”
bluetoothd[1623]: src/main.c:parse_config() Key file does not have key “DeviceID” in group “General”
bluetoothd[1623]: src/main.c:parse_config() Key file does not have key “ReverseServiceDiscovery” in group “General”
bluetoothd[1623]: src/adapter.c:adapter_init() sending read version command
bluetoothd[1623]: Starting SDP server
bluetoothd[1623]: src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0246:052b
bluetoothd[1623]: src/plugin.c:plugin_init() Loading builtin plugins
bluetoothd[1623]: src/plugin.c:add_plugin() Loading hostname plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading wiimote plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading autopair plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading policy plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading a2dp plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading avrcp plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading network plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading input plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading hog plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading gap plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading scanparam plugin
bluetoothd[1623]: src/plugin.c:add_plugin() Loading deviceinfo plugin
bluetoothd[1623]: src/plugin.c:plugin_init() Loading plugins /usr/local/lib/bluetooth/plugins
bluetoothd[1623]: profiles/input/suspend-none.c:suspend_init()
bluetoothd[1623]: profiles/network/manager.c:read_config() /usr/local/etc/bluetooth/network.conf: Key file does not have key “DisableSecurity” in group “General”
bluetoothd[1623]: profiles/network/manager.c:read_config() Config options: Security=true
bluetoothd[1623]: src/main.c:main() Entering main loop
bluetoothd[1623]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type 1 op 0 soft 0 hard 0
bluetoothd[1623]: Bluetooth management interface 1.14 initialized
bluetoothd[1623]: src/adapter.c:read_version_complete() sending read supported commands command
bluetoothd[1623]: src/adapter.c:read_version_complete() sending read index list command
bluetoothd[1623]: src/adapter.c:read_commands_complete() Number of commands: 65
bluetoothd[1623]: src/adapter.c:read_commands_complete() Number of events: 35
bluetoothd[1623]: src/adapter.c:read_commands_complete() enabling kernel-side connection control
bluetoothd[1623]: src/adapter.c:read_index_list_complete() Number of controllers: 0

If I open up a separate terminal window and issue
Code: [Select]
hciattach /dev/ttyAMA0 bcm43xx 921600 noflowI get:
Code: [Select]
bcm43xx_init
Failed to reset chip, invalid HCI event
Can't initialize device: Success

Back in the original terminal window nothing happens until several minutes have elapsed and then I get

Code: [Select]
bluetoothd[1623]: Terminating
bluetoothd[1623]: src/adapter.c:adapter_shutdown()
bluetoothd[1623]: src/plugin.c:plugin_cleanup() Cleanup plugins
bluetoothd[1623]: profiles/input/suspend-none.c:suspend_exit()
bluetoothd[1623]: Stopping SDP server
bluetoothd[1623]: Exit

    [EDIT]: Replaced  tt  tags with  code  tags.  Rich
« Last Edit: May 25, 2018, 06:31:20 AM by Rich »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9968
Re: Bluetooth PAN on rpi0W and piCore 9.0.3
« Reply #8 on: May 25, 2018, 06:35:17 AM »
My guideline was for an RPi3 - I guess an RPi0w must require slightly different commands, but I don't have one to play with..

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5710
Re: Bluetooth PAN on rpi0W and piCore 9.0.3
« Reply #9 on: May 25, 2018, 06:40:25 AM »
Hi gjm
....  dbus  didn't work previously and the only thing I've done since it didn't work is install BlueZ!

I'm guessing you probably didn't install  dbus  previously. Installing  bluez  resulted in  dbus  being installed since it's a
dependency of  bluez.

Instead of using  tt  tags please use  code  tags. This will still preserve spacing as it too uses a monotype font in addition to
adding scroll bars for longer printouts.

Offline gjm

  • WikiUser
  • *
  • Posts: 6
Re: Bluetooth PAN on rpi0W and piCore 9.0.3
« Reply #10 on: May 25, 2018, 06:46:57 AM »
Thanks for you help Juanito, I think I'm going to go back to my base image and start afresh to see if that yields different results probably due to the install order and dependencies etc.  I will post back my findings here regardless.  Thanks again.

Rich:  Yes, sorry about the incorrect tags, point noted and taken on board for future. ;-)  And yes I think you're right about the dependencies, hence going back and starting from scratch in what, hopefully, will be the correct order.  Watch this space.