Re: GTA02 act as gps mouse?

2013-03-17 Thread Denis 'GNUtoo' Carikli
Hi,

I'd also like to use my gta02 as bluetooth GPS with Android(Replicant)
devices.

There is an application for that in FDroid(a free software market/google
play replacement that contains only free software):
http://f-droid.org/repository/browse/?fdcategory=Navigationfdid=org.broeuschmeul.android.gps.bluetooth.provider
The application is called BlueGPS

I've tried to make an up to date python application for the freerunner
from scratch...

But my application is not reliable at all:
- it can only be closed by a kill (because of the while True: at the
end), I did the while true because rfcomm was not always reliable at
the beginning, maybe I should restest without it...
- bluez is somehow unreliable and it doesn't always find the adapter.

So to use it, install Fdroid, then BlueGPS within Fdroid.
then run my gps script.
Then do that on the freerunner:
wget
http://git.kernel.org/cgit/bluetooth/bluez.git/plain/test/simple-agent?id=910ffb4ca785da71b670bf105e234435c67fd7fe
-O simple-agent
chmod +x simple-agent
./simple-agent

That will permit you to pair it with android...
you'll have to enter a pin on android and in simple-agent...

Denis.#! /usr/bin/env python2

#Copyright (C) 2013  Denis 'GNUtoo' Carikli gnu...@no-log.org
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program.  If not, see http://www.gnu.org/licenses/.

import dbus
import os
import subprocess
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)

bus = dbus.SystemBus()

usage_obj = bus.get_object('org.freesmartphone.ousaged', '/org/freesmartphone/Usage')
usage_iface = dbus.Interface(usage_obj, 'org.freesmartphone.Usage')

usage_iface.RequestResource(Bluetooth)
usage_iface.RequestResource(CPU)
usage_iface.RequestResource(GPS)


try:
	pid = subprocess.check_output(pidof bluetoothd, shell=True).replace('\n','')
except:
	os.system(bluetoothd)
	pid = subprocess.check_output(pidof bluetoothd, shell=True).replace('\n','')

print the bluez pid is  + pid

bluez_obj = bus.get_object('org.bluez', /org/bluez/{0}/hci0.format(pid))
bluez_adapter_iface = dbus.Interface(bluez_obj, 'org.bluez.Adapter')

bluez_adapter_iface.SetProperty(Discoverable, True)

while True:
	try:
		os.system(rfcomm watch /dev/rfcomm0 1 sh -c \gpspipe -r  /dev/rfcomm0\)
	except KeyboardInterrupt:
		os.system(killall rfcomm)
		exit(0)
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GTA02 act as gps mouse?

2013-03-09 Thread Ed Kapitein

On 03/08/2013 08:45 PM, Fox Mulder wrote:

Am 06.03.2013 14:21, schrieb Ed Kapitein:
SNIP
The lack of pairing also means a lack of encryption, you have to judge
the impact of that yourself.
Thanks for these instructions.
But the problem is that i want to pair the freerunner with my tablet
where i have no access to a console. So i do need a script or program
which could pair with standard bluetooth devices. I could also install
debian or qtmoko on the freerunner if they are more suited for this
task. So is there any other way of pairing with other devices? :)

Ciao,
  Rainer


You might try the instructions from [1] , based on [2], but i haven't 
tried it myself.


Kind regards,
Ed

[1] http://wiki.openmoko.org/wiki/GPS_on_the_Neo_1973
[2] http://pavelmachek.livejournal.com/39659.html

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GTA02 act as gps mouse?

2013-03-08 Thread Fox Mulder
Am 06.03.2013 14:21, schrieb Ed Kapitein:
 On Wed, 2013-03-06 at 13:42 +0100, Fox Mulder wrote:
 Am 05.03.2013 18:43, schrieb Fox Mulder:
 Am 05.03.2013 15:08, schrieb Neil Jerram:
 Fox Mulder quakem...@gmx.net writes:

 Hi,

 is it possible to use my gta02 as a gps mouse for another computer?

 I got a cheap tablet without integrated gps and thought it would be
 great, if i could use my gta02 as an external gps receiver and pair it
 over bluetooth with my tablet. But therefor i need some special program
 or script which i have to run on my gta02 that it acts as a standard
 bluetooth gps mouse.

 So does anybody know a way to do this? :)

 Do you mean this?  http://www.handheldshell.com/software/bluetooth.php

 I was looking exactly for this kind of script. :)
 I will try it at the weekend and hopefully i get it working without too
 much trouble. Thanks for the link.

 I couldn't wait and so i tried it today. I installed latest SHR 2012.7
 and revived my GTA02 for this test. :)
 But the first problem came up with bluetooth pairing because the
 mentioned simple-agent Python script in the wiki relies on some
 modules SHR doesn't have. It uses from gi.repository import GObject
 which i could solve when renaming it to import gobject (doesn't know
 if that works). But than it also uses import bluezutils which i can't
 find anywhere in the SHR repositories.
 So before i can test the BtGPS script i have to solve the problem of
 pairing my devices. The wiki states there are some other scripts for
 pairing but i can't find any. So does anybody know a way how to pair my
 GTA02 with another device with some script or program for SHR?

 Ciao,
  Rainer

 Hi Rainer,
 
 I use bluetooth without pairing.
 
 I have a laptop and a FR.
 On the laptop i do:
 rfcomm listen 1 2
 
 And on the FR i do
 
 BLUEMAC=00:02:72:14:0F:ED
 rfcomm connect 1 ${BLUEMAC}
 And wait a while for /dev/rfcomm1 to come up.
 
 Then i run on the laptop:
 /usr/sbin/pppd nodetach /dev/rfcomm1 call bluerunner
 
 where /etc/ppp/peers/bluerunner contains the ip address etc ( man pppd )
 
 You can then start gpsd on the freerunner and use it as a networked gpsd
 from the laptop.
 
 I hope this setup will work for you too.
 ( i wrote a script around the commands, but this is basically how it
 works)
 
 The lack of pairing also means a lack of encryption, you have to judge
 the impact of that yourself.

Thanks for these instructions.
But the problem is that i want to pair the freerunner with my tablet
where i have no access to a console. So i do need a script or program
which could pair with standard bluetooth devices. I could also install
debian or qtmoko on the freerunner if they are more suited for this
task. So is there any other way of pairing with other devices? :)

Ciao,
 Rainer

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GTA02 act as gps mouse?

2013-03-06 Thread Fox Mulder
Am 05.03.2013 18:43, schrieb Fox Mulder:
 Am 05.03.2013 15:08, schrieb Neil Jerram:
 Fox Mulder quakem...@gmx.net writes:

 Hi,

 is it possible to use my gta02 as a gps mouse for another computer?

 I got a cheap tablet without integrated gps and thought it would be
 great, if i could use my gta02 as an external gps receiver and pair it
 over bluetooth with my tablet. But therefor i need some special program
 or script which i have to run on my gta02 that it acts as a standard
 bluetooth gps mouse.

 So does anybody know a way to do this? :)

 Do you mean this?  http://www.handheldshell.com/software/bluetooth.php
 
 I was looking exactly for this kind of script. :)
 I will try it at the weekend and hopefully i get it working without too
 much trouble. Thanks for the link.

I couldn't wait and so i tried it today. I installed latest SHR 2012.7
and revived my GTA02 for this test. :)
But the first problem came up with bluetooth pairing because the
mentioned simple-agent Python script in the wiki relies on some
modules SHR doesn't have. It uses from gi.repository import GObject
which i could solve when renaming it to import gobject (doesn't know
if that works). But than it also uses import bluezutils which i can't
find anywhere in the SHR repositories.
So before i can test the BtGPS script i have to solve the problem of
pairing my devices. The wiki states there are some other scripts for
pairing but i can't find any. So does anybody know a way how to pair my
GTA02 with another device with some script or program for SHR?

Ciao,
 Rainer


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GTA02 act as gps mouse?

2013-03-06 Thread Ed Kapitein
On Wed, 2013-03-06 at 13:42 +0100, Fox Mulder wrote:
 Am 05.03.2013 18:43, schrieb Fox Mulder:
  Am 05.03.2013 15:08, schrieb Neil Jerram:
  Fox Mulder quakem...@gmx.net writes:
 
  Hi,
 
  is it possible to use my gta02 as a gps mouse for another computer?
 
  I got a cheap tablet without integrated gps and thought it would be
  great, if i could use my gta02 as an external gps receiver and pair it
  over bluetooth with my tablet. But therefor i need some special program
  or script which i have to run on my gta02 that it acts as a standard
  bluetooth gps mouse.
 
  So does anybody know a way to do this? :)
 
  Do you mean this?  http://www.handheldshell.com/software/bluetooth.php
  
  I was looking exactly for this kind of script. :)
  I will try it at the weekend and hopefully i get it working without too
  much trouble. Thanks for the link.
 
 I couldn't wait and so i tried it today. I installed latest SHR 2012.7
 and revived my GTA02 for this test. :)
 But the first problem came up with bluetooth pairing because the
 mentioned simple-agent Python script in the wiki relies on some
 modules SHR doesn't have. It uses from gi.repository import GObject
 which i could solve when renaming it to import gobject (doesn't know
 if that works). But than it also uses import bluezutils which i can't
 find anywhere in the SHR repositories.
 So before i can test the BtGPS script i have to solve the problem of
 pairing my devices. The wiki states there are some other scripts for
 pairing but i can't find any. So does anybody know a way how to pair my
 GTA02 with another device with some script or program for SHR?
 
 Ciao,
  Rainer
 
Hi Rainer,

I use bluetooth without pairing.

I have a laptop and a FR.
On the laptop i do:
rfcomm listen 1 2

And on the FR i do

BLUEMAC=00:02:72:14:0F:ED
rfcomm connect 1 ${BLUEMAC}
And wait a while for /dev/rfcomm1 to come up.

Then i run on the laptop:
/usr/sbin/pppd nodetach /dev/rfcomm1 call bluerunner

where /etc/ppp/peers/bluerunner contains the ip address etc ( man pppd )

You can then start gpsd on the freerunner and use it as a networked gpsd
from the laptop.

I hope this setup will work for you too.
( i wrote a script around the commands, but this is basically how it
works)

The lack of pairing also means a lack of encryption, you have to judge
the impact of that yourself.

Kind regards,
Ed





___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GTA02 act as gps mouse?

2013-03-05 Thread Neil Jerram
Fox Mulder quakem...@gmx.net writes:

 Hi,

 is it possible to use my gta02 as a gps mouse for another computer?

 I got a cheap tablet without integrated gps and thought it would be
 great, if i could use my gta02 as an external gps receiver and pair it
 over bluetooth with my tablet. But therefor i need some special program
 or script which i have to run on my gta02 that it acts as a standard
 bluetooth gps mouse.

 So does anybody know a way to do this? :)

Do you mean this?  http://www.handheldshell.com/software/bluetooth.php

 Neil

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: GTA02 act as gps mouse?

2013-03-05 Thread Fox Mulder
Am 05.03.2013 15:08, schrieb Neil Jerram:
 Fox Mulder quakem...@gmx.net writes:
 
 Hi,

 is it possible to use my gta02 as a gps mouse for another computer?

 I got a cheap tablet without integrated gps and thought it would be
 great, if i could use my gta02 as an external gps receiver and pair it
 over bluetooth with my tablet. But therefor i need some special program
 or script which i have to run on my gta02 that it acts as a standard
 bluetooth gps mouse.

 So does anybody know a way to do this? :)
 
 Do you mean this?  http://www.handheldshell.com/software/bluetooth.php

I was looking exactly for this kind of script. :)
I will try it at the weekend and hopefully i get it working without too
much trouble. Thanks for the link.

Ciao,
 Rainer

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community