Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 17-04-2012, 10:54   #76
Registered User

Join Date: Oct 2010
Location: Southern Sweden
Posts: 21
Re: OpenCPN Fails to Receive Bluetooth Data Feed

mrm

Must admit that I'm not good at coding. I have copied my present /etc/init.d/bluetooth without really knowing what I'm doing.

How shall I modify it with your suggestions?


#!/bin/sh
#
# chkconfig: 345 50 83
# description: Turn HID adapters into Bluetooth ones
#
### BEGIN INIT INFO
# Short-Description: Trigger bluetoothd start-up
# Description: Trigger bluetoothd start-up
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

[ -e /etc/sysconfig/bluetooth ] && . /etc/sysconfig/bluetooth

start()
{
echo -n $"Enabling Bluetooth devices:"
udevadm trigger --subsystem-match=bluetooth
echo ""
return 0
}

stop()
{
# FIXME If somebody figures out how to disable the K* script
echo -n "Stopping Bluetooth services:"
echo ""
return 0
}

case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: $0 {start|stop}"
exit 3
;;
esac

exit $RETVAL
__________________

__________________
mariette99 is offline   Reply With Quote
Old 17-04-2012, 13:32   #77
mrm
Registered User

Join Date: Feb 2011
Location: Poland, EU
Boat: crew on Bavaria 38 Cruiser
Posts: 651
Re: OpenCPN Fails to Receive Bluetooth Data Feed

Mariette,

your file is essentially the same as mine, with the difference that actions had been moved inside defined functions. Mostly a matter of programming style.. Anyway, you can either add the modifications to function bodies or just add them next to function calls. To keep with the style present I will show how to do the former, with the alternative marked inside comments:


Marius

Quote:
Originally Posted by mariette99 View Post
mrm

Must admit that I'm not good at coding. I have copied my present /etc/init.d/bluetooth without really knowing what I'm doing.

How shall I modify it with your suggestions?


#!/bin/sh
#
# chkconfig: 345 50 83
# description: Turn HID adapters into Bluetooth ones
#
### BEGIN INIT INFO
# Short-Description: Trigger bluetoothd start-up
# Description: Trigger bluetoothd start-up
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

[ -e /etc/sysconfig/bluetooth ] && . /etc/sysconfig/bluetooth

start()
{
echo -n $"Enabling Bluetooth devices:"
udevadm trigger --subsystem-match=bluetooth
echo ""
rfcomm bind all
return 0
}

stop()
{
rfcomm release all
# FIXME If somebody figures out how to disable the K* script
echo -n "Stopping Bluetooth services:"
echo ""
return 0
}

case "$1" in
start)
start
# alternatively - place bind sentence here
;;
stop)
# alternatively - place release sentence here
stop
;;
*)
echo "Usage: $0 {start|stop}"
exit 3
;;
esac

exit $RETVAL
__________________

__________________
mrm is offline   Reply With Quote
Old 19-04-2012, 10:00   #78
Registered User

Join Date: Oct 2010
Location: Southern Sweden
Posts: 21
Re: OpenCPN Fails to Receive Bluetooth Data Feed

mrm
Sorry to say it doesn't work. Have tried permissions but I can't get rfcomm0 open without going in as root with "rfcomm bind /dev/rfcomm0 00:1B:C1:05:F3:F8". Any more suggestions?
Sarah
__________________
mariette99 is offline   Reply With Quote
Old 19-04-2012, 10:17   #79
mrm
Registered User

Join Date: Feb 2011
Location: Poland, EU
Boat: crew on Bavaria 38 Cruiser
Posts: 651
Re: OpenCPN Fails to Receive Bluetooth Data Feed

Quote:
Originally Posted by mariette99 View Post
mrm
Sorry to say it doesn't work. Have tried permissions but I can't get rfcomm0 open without going in as root with "rfcomm bind /dev/rfcomm0 00:1B:C1:05:F3:F8". Any more suggestions?
Sarah
That script is being run on startup with root permissions, so, if your bluetooth device is already switched on while your computer is booting it should work. Works for me. You might try one more test:

make sure bluetooth device is switched ON,

then, as a root user, type these two commands:
Code:
/etc/init.d/bluetooth  stop
/etc/init.d/bluetooth  start
and see if your bluetooth device is accessible in OpenCPN. If it is, make sure the device is on while the computer is booting and it should work (assuming the rfcomm bind/release lines were entered into this file).

One more thing, you did define an entry in /etc/bluetooth/rfcomm.conf for your device, didn't you? The 'rfcomm bind all' command depends on information entered in this file.


Marius
__________________
mrm is offline   Reply With Quote
Old 19-04-2012, 15:28   #80
Registered User

Join Date: Oct 2010
Location: Southern Sweden
Posts: 21
Re: OpenCPN Fails to Receive Bluetooth Data Feed

mrm

Done as you say and end up with following:

[root@putte sarah]# /etc/init.d/bluetooth stop
Stopping Bluetooth services:
[root@putte sarah]# /etc/init.d/bluetooth start
Enabling Bluetooth devices:
Can't open RFCOMM config file: No such file or directory
[root@putte sarah]#


My /etc/bluetooth/rfcomm.conf

# RFCOMM configuration file.
#
# $Id: rfcomm.conf,v 1.1 2002/10/07 05:58:18 maxk Exp $
#

rfcomm0 {
# Automatically bind the device at startup
bind yes;

# Bluetooth address of the device
device 00:1B:C1:05:F3:F8;

# RFCOMM channel for the connection
channel 1;

# Description of the connection
comment "Your GPS Device Here";
}

I have the GPS running at boot.
Sarah
__________________
mariette99 is offline   Reply With Quote
Old 19-04-2012, 16:05   #81
mrm
Registered User

Join Date: Feb 2011
Location: Poland, EU
Boat: crew on Bavaria 38 Cruiser
Posts: 651
Re: OpenCPN Fails to Receive Bluetooth Data Feed

Sarah,

looks like in your distribution rfcomm defaults to look somewhere else for its config file. Please replace
Code:
rfcomm bind all
with
Code:
rfcomm -f /etc/bluetooth/rfcomm.conf bind all
in /etc/init.d/bluetooth and retry the test (or just type it at a root command prompt).

Also, check permissions on /etc/bluetooth/rfcomm.conf (shouldn't matter, as script runs as root, but...)
Code:
mrm@stardust:~$ ls -l /etc/bluetooth/rfcomm.conf 
-rw-r--r-- 1 root root 438 2011-06-17 00:12 /etc/bluetooth/rfcomm.conf
If this doesn't work I am running out of ideas.

Marius

Quote:
Originally Posted by mariette99 View Post
mrm

Done as you say and end up with following:

[root@putte sarah]# /etc/init.d/bluetooth stop
Stopping Bluetooth services:
[root@putte sarah]# /etc/init.d/bluetooth start
Enabling Bluetooth devices:
Can't open RFCOMM config file: No such file or directory
[root@putte sarah]#


My /etc/bluetooth/rfcomm.conf

# RFCOMM configuration file.
#
# $Id: rfcomm.conf,v 1.1 2002/10/07 05:58:18 maxk Exp $
#

rfcomm0 {
# Automatically bind the device at startup
bind yes;

# Bluetooth address of the device
device 00:1B:C1:05:F3:F8;

# RFCOMM channel for the connection
channel 1;

# Description of the connection
comment "Your GPS Device Here";
}

I have the GPS running at boot.
Sarah
__________________
mrm is offline   Reply With Quote
Old 20-04-2012, 15:52   #82
Registered User

Join Date: Oct 2010
Location: Southern Sweden
Posts: 21
Re: OpenCPN Fails to Receive Bluetooth Data Feed

Thank you Marius.

I finally found it with your help.
/etc/bluetooth/rfcomm.conf and /etc/bluetooth/rfcomm.config are two different things.

I changed the suffix from .config to .conf and all fell into place.

Now I can just reboot if anything happens and I will have all my gear up again. That is very important for me in fog and bad weather. We have a lot of traffic in the Sound between Sweden and Denmark and you can bet that your systems are going down when crossing the fairway north of Copenhagen under bad conditions. In heavy rain or fog you simply havn't time to fiddle with scripts and trouble shooting.
Now I can just reboot and I have my position and I know where the big vessels are with help of AIS.

I feel much safer now and will run a sea trial tommorrow.

Thanks
Sarah
__________________
mariette99 is offline   Reply With Quote
Old 21-04-2012, 03:30   #83
mrm
Registered User

Join Date: Feb 2011
Location: Poland, EU
Boat: crew on Bavaria 38 Cruiser
Posts: 651
Re: OpenCPN Fails to Receive Bluetooth Data Feed

Quote:
Originally Posted by mariette99 View Post
I changed the suffix from .config to .conf and all fell into place.
I feel much safer now and will run a sea trial tommorrow.
Perfect!
Enjoy your sailing
__________________
mrm is offline   Reply With Quote
Old 20-05-2012, 05:19   #84
Registered User

Join Date: Feb 2011
Posts: 12
Re: OpenCPN Fails to Receive Bluetooth Data Feed

I had similar problems getting Bluetooth GPS connection. Setup: Samsung Netbook, Windows 7, external GPS with Bluetooth connector.

I found Opencpn would not connect but if I first ran Sea Clear, which always connected first time, then shut down Sea Clear and opened Opencpn it would connect automatically.

Any suggestions?

Will also post in Opencpn bug tracker.
__________________

__________________
hejapofa is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCPN - NMEA Data from TCP Input framen OpenCPN 11 12-10-2012 13:19
OpenCPN Fails to Start Samarang OpenCPN 22 30-04-2011 01:51
Data Upload from OpenCPN to Garmin GPS152 syyabyum Navigation 1 06-11-2010 14:03
OpenCPN Won't Listen to My GPS Data Ima Winner OpenCPN 5 09-09-2010 16:23
OpenCPN Data Very Small and Difficult to View - Help, Please Algarve OpenCPN 30 14-03-2010 13:20



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 13:45.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.