OpenMarine
"SOLVED" BT gps antenna AMTEC - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: How do I...? (https://forum.openmarine.net/forumdisplay.php?fid=3)
+--- Thread: "SOLVED" BT gps antenna AMTEC (/showthread.php?tid=79)

Pages: 1 2


RE: BT gps antenna AMTEC - cepicscepics - 2016-05-02

(2016-05-02, 07:19 PM)Sailoog Wrote: If you have data in the terminal you are really close now.

Is OpenCPN listening to localhost 10110?

Do you have data in inspector window?

Is OpenCPN listening to localhost 10110?
I think so
   
Do you have data in inspector window?
no
   


RE: BT gps antenna AMTEC - holgerw - 2016-05-03

Lets start another Solution. I remember i also had these Probs with my Bluetooth GPS after upgrading the Pi to Jessie.

1) edit your MACs into /etc/bluetooth/rfcomm.conf like my Example with YOUR MACs: (get them with "hcitool scan")



Code:
rfcomm0 {
   bind yes;
   device 00:15:4B:11:1A:95;
   channel 1;
   comment "Connection to Bluetooth GPS BTGPS-201";
}
rfcomm1 {
   bind yes;
   device 20:13:07:31:19:51;
   channel 1;
   comment "Connection to Bluetooth L-Sensorik - This is my Arduino.";
}


check your BT with:
pi@openplotter:~$ sudo service bluetooth status

You will get something like this:


Quote:● bluetooth.service - Bluetooth service
  Loaded: loaded (/etc/systemd/system/bluetooth.service; enabled)
  Active: active (running) since Die 2016-05-03 12:10:19 CEST; 7min ago
    Docs: man:bluetoothd(8)
 Process: 7772 ExecStartPost=/usr/bin/sdptool add SP (code=exited, status=0/SUCCESS)
Main PID: 7769 (bluetoothd)
  Status: "Running"
  CGroup: /system.slice/bluetooth.service
          └─7769 /usr/lib/bluetooth/bluetoothd -C

Mai 03 12:10:19 openplotter bluetoothd[7769]: Bluetooth daemon 5.23
Mai 03 12:10:19 openplotter bluetoothd[7769]: Starting SDP server
Mai 03 12:10:19 openplotter bluetoothd[7769]: Bluetooth management interface 1.10 initialized
Mai 03 12:10:19 openplotter bluetoothd[7769]: Sap driver initialization failed.
Mai 03 12:10:19 openplotter bluetoothd[7769]: sap-server: Operation not permitted (1)
Mai 03 12:10:19 openplotter sdptool[7772]: Serial Port service registered
Mai 03 12:10:19 openplotter systemd[1]: Started Bluetooth service.

-------------
2) I changed this File /etc/systemd/system/bluetooth.service to have this new Option " -C", this is for compatibility with old BT serial Devices.
-------------

Code:
[Unit]
Description=Bluetooth service
Documentation=man:bluetoothd(8)

[Service]
Type=dbus
BusName=org.bluez
ExecStart=/usr/lib/bluetooth/bluetoothd -C
ExecStartPost=/usr/bin/sdptool add SP
NotifyAccess=main
#WatchdogSec=10
#Restart=on-failure
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
LimitNPROC=1

[Install]
WantedBy=bluetooth.target
Alias=dbus-org.bluez.service

-------------

3) Using these Commands you don't have to reboot inbetween:
sudo service bluetooth stop

After editing this File you have to reload:
sudo systemctl daemon-reload

Followed by Start and Status:
sudo service bluetooth start
sudo service bluetooth status

I ignore my Errors from Sap Driver Init, important is the running "sdptool" to do the Serial Data
-----------------
Good Luck - this is not Rocket Science only ons and offs.



-----------------
PS:
Conclusion: there must be an better Way to search for Serial Devices. An German Developer developed an Navigation Program which does this
Scanning for Bluetooth or USB Serial NMEA Devices, maybe someone has some Time to have an Look into this. http://www.wellenvogel.net/software/avnav/index.php
But both Apps try to do the same Things (WLAN-Share), so they will not work together by default on the same Machine.


RE: BT gps antenna AMTEC - Sailoog - 2016-05-03

(2016-05-02, 10:57 PM)cepicscepics Wrote:
(2016-05-02, 07:19 PM)Sailoog Wrote: If you have data in the terminal you are really close now.

Is OpenCPN listening to localhost 10110?

Do you have data in inspector window?

Is OpenCPN listening to localhost 10110?
I think so

Do you have data in inspector window?
no

Delete this connection on OpenCPN: 10.10.10.1:5900 This address:port is only for using on remote desktop software. Enable only: localhost:10110 input.
You should confirm first that you have data in the inspector window and then check OpenCPN.

Open a terminal and type:
Code:
python /home/pi/.config/openplotter/openplotter.py

Go to NMEA 0183, confirm the serial input is enabled and press "Restart" button. Do you get any error message in the terminal?


RE: BT gps antenna AMTEC - cepicscepics - 2016-05-03

(2016-05-03, 12:12 PM)Sailoog Wrote:
(2016-05-02, 10:57 PM)cepicscepics Wrote:
(2016-05-02, 07:19 PM)Sailoog Wrote: If you have data in the terminal you are really close now.

Is OpenCPN listening to localhost 10110?

Do you have data in inspector window?

Is OpenCPN listening to localhost 10110?
I think so

Do you have data in inspector window?
no

Delete this connection on OpenCPN: 10.10.10.1:5900 This address:port is only for using on remote desktop software. Enable only: localhost:10110 input.
You should confirm first that you have data in the inspector window and then check OpenCPN.

Open a terminal and type:
Code:
python /home/pi/.config/openplotter/openplotter.py

Go to NMEA 0183, confirm the serial input is enabled and press "Restart" button. Do you get any error message in the terminal?

I deleted the connection 10.10.10.1:5900 in open cpn settings and I confirmed
in a terminal I typed
Code:
sudo rfcomm connect 1 00:02:C7:15:94:34 &

and than
Code:
python /home/pi/.config/openplotter/openplotter.py

i restart the inspector and this is what appens:

   


RE: BT gps antenna AMTEC - holgerw - 2016-05-03

If you create the /dev/rfcommX with sudo then you have to make it readable for user pi

sudo chown pi /dev/rfcomm*
sudo chmod +r /dev/rfcomm*

better add this line to the end of /etc/rc.local (here you dont need sudo!)

chown pi /dev/rfcomm*; chmod +r /dev/rfcomm*


RE: BT gps antenna AMTEC - cepicscepics - 2016-05-03

(2016-05-03, 02:11 PM)holgerw Wrote: If you create the /dev/rfcommX with sudo then you have to make it readable for user pi

sudo chown pi /dev/rfcomm*
sudo chmod +r /dev/rfcomm*

better add this line to the end of /etc/rc.local (here you dont need sudo!)

chown pi /dev/rfcomm*; chmod +r /dev/rfcomm*

like that?
   
and now?


RE: BT gps antenna AMTEC - Renato - 2016-05-05

Hi
in rc.local file the line

exit 0

should be the last line
so GPS BT connects at startup and GPS data stream is visible in inspector
Ciao


RE: BT gps antenna AMTEC - cepicscepics - 2016-05-08

(2016-05-05, 08:20 PM)Renato Wrote: Hi
in rc.local file the line

exit 0

should be the last line
so GPS BT connects at startup and GPS data stream is visible in inspector
Ciao

Eureka !!!


BT gps antenna AMTEC - holgerw - 2016-05-08

Fine - keep on un*xing +++


RE: BT gps antenna AMTEC - cepicscepics - 2016-05-13

(2016-05-08, 06:35 PM)holgerw Wrote: Fine - keep on un*xing +++
I dont anderstend!!!