maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [M5] [Announce] Maebble - Pebble support for Maemo (https://talk.maemo.org/showthread.php?t=97591)

proprog 2016-09-18 20:17

[Announce] Maebble - Pebble support for Maemo
 
I've put together basic Pebble classic support for the N900. You should be able to:

- display calls with name or number
- display messages
- media control omp and oscp
- reconnect after lost connection

It doesn't sound much but it's actually quite useful for my needs. The main thing I'm missing at the moment is support for displaying emails and all tips on how to list new emails on the n900 are welcome.

Download maebble at https://dl.dropboxusercontent.com/u/...bble-v0.90.zip

Update maebble.cfg with you bluetooth mac (change "xx:xx:xx:xx:xx:xx") and run "python maebbled.py". The logging is all over the place at the moment but run "python maebbled.py --print_maemo" for console logging.

Pebble API is based on Libpebble available at http://www.pebbledev.org/wiki/Libpebble/

Maemo SMS parsing is from HeySms available at https://github.com/titilambert/HeySms/

Use at own risk, I've used it the last couple of weeks without too much problems. I cannot tell how the battery life is affected cause my battery is in desperate need of recalibration.

UPDATE 2017-05-22:

I've finally updated maebble to support other firmware versions. Maebble v0.91 is tested with v1 (on pebble classic), v3 (on pebble classic) and v4 (on pebble time).

Download maebble v0.91 at:
https://www.dropbox.com/s/m5p92uj8ru...v0.91.zip?dl=0

New in config-file is that you can specify how often time on watch should be updated (setting is in hour, set to 0 to not update).

New in this update:
- v3 notifications
- email notifications (very basic, just account and number of new emails)
- ping method
- set time method
- get watch version method
- music volume up/down
- new parameter --config_file to use multiple watches (mainly for testing purpose)
- the delay in music control should be much less of a problem now with minor bug fix and changed sleep values

biketool 2016-09-19 05:44

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Latest Install Instructions and link to v0.92.
(edit Dec 2018)I have assembled a how to that I would like tested here:
https://talk.maemo.org/showpost.php?...2&postcount=91
please use these instructions.
If I get good feedback and hopefully improvements I will work towards getting this into the repos as an easy to install .deb instead of hand editing and installing.

(archived my pre-pebble days second post to thread so I could insert my link above)
This kicks ***, there is no alternative for me in newer Android and iOS devices so I continue with my trusty N900. I had high hopes when the Pebble was approaching release, now years later we are seeing support. Do you have advice for us who might now consider a Pebble at this late date?
My concerns are where to find one for a good price.
Where to get a replacement battery and how to do the swap.

proprog 2016-09-19 19:34

Re: [Announce] Maebble - Pebble classic support for Maemo
 
The Pebble classic is still available at pebble.com. I got two for a reasonable price from a local store.

I might try to upgrade one of them and see if it's possible to upgrade maebble. But first I want to fix email support and make it run on n900 startup (should be easy). All tips about how to get a notification or check for new emails are welcome.

rcolistete 2016-09-20 03:05

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Pebble Classic for USD69.99 with free shipping from official Pebble store :
https://www.pebble.com/buy-pebble-smartwatch

glo-worm 2016-12-09 10:38

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Hi there,

This is great work, Love my N900 and my pebble. Though it seems both have become victims of their success.

Trying to get this working. I change the .cfg file to the BT mac address of my pebble.

I have paired the pebble with my N900.

Pebble is original kickstarter running v3.12.3 fw

Copied the files to my n900,
xterminal and gain root
navigate to the directory //MyDocs/Maebbled-v0.90

type "python maebbled.py"

its runs

but drops out with import error: no module named bluetooth.

Any ideas whats wrong?

thanks once again for support.

Halftux 2016-12-09 11:16

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Quote:

Originally Posted by glo-worm (Post 1520292)
but drops out with import error: no module named bluetooth.

I don't know if it helps but you could try to install python-bluez.

glo-worm 2016-12-09 12:18

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Quote:

Originally Posted by Halftux (Post 1520294)
I don't know if it helps but you could try to install python-bluez.

that got me past the bluetooth module problem, thanks. now generating some other errors, let me take a look and see where it leads me.

thanks.

glo-worm 2016-12-09 15:35

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Is there some other dependencies? Now when i run it, i get further but stops at at a dbus exception.

Really would like to get this working :-)

Halftux 2016-12-09 17:37

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Quote:

Originally Posted by glo-worm (Post 1520311)
Now when i run it, i get further but stops at at a dbus exception.

Dbus exception related to which service?
Could you give us more details about the error message and maybe the last print out before the error occure?
There are more than one dbus call in the code....

glo-worm 2016-12-11 13:24

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Quote:

Originally Posted by Halftux (Post 1520317)
Dbus exception related to which service?
Could you give us more details about the error message and maybe the last print out before the error occure?
There are more than one dbus call in the code....

/home/user/MyDocs/maebble-v0.90 # python maebbled.py
Traceback (most recent call last):
File "maebbled.py", line 654, in <module>
dbus_listen()
File "maebbled.py", line 448, in dbus_listen
bus = dbus.SessionBus()
File "/usr/lib/pymodules/python2.5/dbus/_dbus.py", line 219, in __new__
mainloop=mainloop)
File "/usr/lib/pymodules/python2.5/dbus/_dbus.py", line 108, in __new__
bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
File "/usr/lib/pymodules/python2.5/dbus/bus.py", line 125, in __new__
bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException

Halftux 2016-12-12 19:49

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Quote:

Originally Posted by glo-worm (Post 1520367)
/home/user/MyDocs/maebble-v0.90 # python maebbled.py
Traceback (most recent call last):
File "maebbled.py", line 654, in <module>
dbus_listen()
File "maebbled.py", line 448, in dbus_listen
bus = dbus.SessionBus()
File "/usr/lib/pymodules/python2.5/dbus/_dbus.py", line 219, in __new__
mainloop=mainloop)
File "/usr/lib/pymodules/python2.5/dbus/_dbus.py", line 108, in __new__
bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
File "/usr/lib/pymodules/python2.5/dbus/bus.py", line 125, in __new__
bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException

So what I can say, as somebody who never did something with python, try to comment out line 448 and 449 in the maebbled.py.
Maybe then the rest is working.
On the first sight i guess there is a problem to talk to the session bus or to it's signal "media_changed" from media player.
But at least it tries to talk so the dbus python modul seems to be present.
Maybe the thread creator could give better solutions or explanations to his script.

proprog 2016-12-13 15:39

Re: [Announce] Maebble - Pebble classic support for Maemo
 
I'm afraid I can't add much to the previous answer. It looks like you cannot get the session bus but the message doesn't say much about why. I'll see what I can find.

If you comment out the two lines as suggested the "now playing" will not be updated but everything else should hopefully work.

glo-worm 2016-12-16 08:40

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Hi there,

Thanks for the advice. I tried editing out the two lines and when I execute I do no get any errors at all. It appears to just execute.

I tried sending test SMS but got no notification on the pebble.

As I am a noob with python I guess I have reached the limit of my capabilities. So sadly my pebble and N900 will not have the relationship I hoped :-(

Thanks again.

proprog 2016-12-16 16:57

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Can you run maebble with parameter --print_maemo for extra logging and post or pm me the output?

If you see a sms notification on your n900 you should get a message on the pebble as well.

glo-worm 2016-12-19 08:48

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Quote:

Originally Posted by proprog (Post 1520626)
Can you run maebble with parameter --print_maemo for extra logging and post or pm me the output?

If you see a sms notification on your n900 you should get a message on the pebble as well.

Here is what it generated

/home/user/MyDocs/Maebble-v0.90 # python maebbled.py --print
_maemo
setup
00:18:33:7D:D3:74
5
30
True
[]
connect
<bluetooth.bluez.BluetoothSocket instance at 0x296d50>
process
response
1
17
_phone_version_response
_send_message
17
_send_message
response
30
49
response
1
32
_send_message
32
_send_message
response
30
49
response
30
49
timeout: update media status
response
514
6778
response
594
6778
sms from Miles Revell
New sms received
Incoming SMS uses GSM-7 alphabet
Sms from: +420xxxxxx627
Sms content: Testing@
sms message is Testing@
notification_sms
Miles Revell
Testing@
_send_message
3000
_send_message
response
383
6778
response
622
6778
response
30
49
response
30
49
response
2
18
response
2
18
response
30
49
response
30
49
response
30
49
response
30
49
response
3
0
timeout: update media status
response
2
6778

Phone showed SMS notification but nothing on pebble. BT on pebble says connected to N900. BT indicator on N900 is blue. Pebble running V3.12.3 firmware.

proprog 2016-12-19 10:10

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Unfortunately maebble is only compatible with older versions of the firmware. My pebble is v1.14.4 and that's the one I've tested. Apologies for the confusion.

When I've added support for email and made it run on startup (both very soon) I'm going to have a look at the changes needed in the protocol. Not even sure it's possible but your test looks promising.

glo-worm 2016-12-19 10:45

Re: [Announce] Maebble - Pebble classic support for Maemo
 
Ok, thanks for the clarification. I will follow your work here with interest.

badcloud 2017-02-09 10:40

Re: [Announce] Maebble - Pebble classic support for Maemo
 
What's the status with this project as far as pebble firmware > v1.14.4?

I found a cheap pebble classic and am considering buying it :)

xman 2017-02-11 06:19

Re: [Announce] Maebble - Pebble classic support for Maemo
 
What would it take to get the function that n9 has? Mainly being able to load and control apps from the the n900?

Thanks for sharing and working on this project, what you have already is great. I can see call, not msg yet and slow but working omp stop/play/next/previous. Trying to figure out how to get the song to update. But the worst is having to use an iPhone to update the watch. Or forget to sync the apps then have no app till next iPhone connection ..:(

proprog 2017-05-22 06:51

Re: [Announce] Maebble - Pebble classic support for Maemo
 
I've finally updated maebble to support other firmware versions. Tested with v1 (on pebble classic), v3 (on pebble classic) and v4 (on pebble time).

Download the new version at:
https://www.dropbox.com/s/m5p92uj8ru...v0.91.zip?dl=0

Instructions from first post still apply. New in config-file is that you can specify how often time on watch should be updated (setting is in hour, set to 0 to not update).

New in this update:
- v3 notifications
- email notifications (very basic, just account and number of new emails)
- ping method
- set time method
- get watch version method
- music volume up/down
- new parameter --config_file to use multiple watches (mainly for testing purpose)
- the delay in music control should be much less of a problem now with minor bug fix and changed sleep values

I'll try to add app methods next but don't hold your breath.

proprog 2017-07-14 13:58

Re: [Announce] Maebble - Pebble support for Maemo
 
As a side effect of adding support for newer firmwares I now have one pebble classic that I'm not using. Send me a pm if you want it, no strings attached.

xman 2017-07-17 23:11

Re: [Announce] Maebble - Pebble support for Maemo
 
Thank for the update! Does this bring any new functions to the n900 version?

sicelo 2017-07-18 06:11

Re: [Announce] Maebble - Pebble support for Maemo
 
Quote:

Originally Posted by proprog (Post 1530660)
As a side effect of adding support for newer firmwares I now have one pebble classic that I'm not using. Send me a pm if you want it, no strings attached.

can't you upload here for the benefit of the community?

xman 2017-07-20 22:14

Re: [Announce] Maebble - Pebble support for Maemo
 
Just thought of it but if you getting rid of your pebble classic does this mean no more support for the classic in your software? You won;t have a testing device. Thanks.

x

proprog 2017-08-05 10:11

Re: [Announce] Maebble - Pebble support for Maemo
 
The pebble classic is gone and my main watch is a pebble time. But I've got a spare classic upgraded to v3 that I can use for testing.

To avoid confusion regarding support of newer firmwares I've updated the first post.

azkay 2017-08-29 11:55

Re: [Announce] Maebble - Pebble support for Maemo
 
Code:

!! Traceback (most recent call last):
!!  File "maebbled.py", line 913, in configure
    cfg.readfp(open(config_file, 'r'))
!! TypeError: coercing to Unicode: need string or buffer, bool found

could not read config file
!! Traceback (most recent call last):
!!  File "maebbled.py", line 925, in configure
    bt_address = cfg.get('btservice', 'address')
!!  File "/usr/lib/python2.5/ConfigParser.py", line 511, in get
    raise NoSectionError(section)
!! NoSectionError: No section: 'btservice'

find nearby devices
no device found
None

Any ideas?

EDIT::
Unicode thing was stopping it from opening the config file.


Code:

_send_message
C2:3A:79:20:0A:76
0.25
30.0
4
True
[]
connect
(112, 'Host is down')
connect
(77, 'File descriptor in bad state')
connect
(77, 'File descriptor in bad state')
connect
(77, 'File descriptor in bad state')
None


biketool 2017-08-31 08:39

Re: [Announce] Maebble - Pebble support for Maemo
 
I think my main problem is in pairing, did anyone else have to do anything unusual to get and stay paired.
I tried wiping all of my pairs and rebooting, it made no dfference, when the "Pairing Complete" yellow notification on my N900 goes back up the 'Connected" under N900 on the watch goes away.

sicelo 2017-08-31 09:10

Re: [Announce] Maebble - Pebble support for Maemo
 
1 Attachment(s)
I've had an almost similar problem with Pairing my ThinkOutside Stowaway keyboard a few months back. Could be something buggy in N900's Bluetooth manager. I ended up using the python simple-agent script (I think it was the one mentioned at http://wiki.openmoko.org/wiki/Manual...ooth#Pairing_2)

I don't think I made any changes, and you can, of course, find the file in lots of other places, e.g. towards the end of http://developer.toradex.com/knowled...-use-bluetooth

Worth a try.

azkay 2017-08-31 09:45

Re: [Announce] Maebble - Pebble support for Maemo
 
Just reflashed- my N900 doesn't even see the Pebble in the bluetooth list

azkay 2017-08-31 11:32

Re: [Announce] Maebble - Pebble support for Maemo
 
Quote:

Originally Posted by sicelo (Post 1533697)
I've had an almost similar problem with Pairing my ThinkOutside Stowaway keyboard a few months back. Could be something buggy in N900's Bluetooth manager. I ended up using the python simple-agent script (I think it was the one mentioned at http://wiki.openmoko.org/wiki/Manual...ooth#Pairing_2)

I don't think I made any changes, and you can, of course, find the file in lots of other places, e.g. towards the end of http://developer.toradex.com/knowled...-use-bluetooth

Worth a try.

Doesn't work on my side ):

Code:

Nokia-N900:~# ./simple-agent hci0 C2:3A:79:20:0A:76
Creating device failed: org.bluez.Error.ConnectionAttemptFailed: Page Timeout

N900 sees other bluetooth devices (other android phone, computer, etc) just not the pebble

sicelo 2017-08-31 11:57

Re: [Announce] Maebble - Pebble support for Maemo
 
Quote:

Originally Posted by azkay (Post 1533701)
Just reflashed- my N900 doesn't even see the Pebble in the bluetooth list

you probably have a bigger problem though ... is your pebble usable with other devices besides N900?

azkay 2017-08-31 12:10

Re: [Announce] Maebble - Pebble support for Maemo
 
Quote:

Originally Posted by sicelo (Post 1533705)
you probably have a bigger problem though ... is your pebble usable with other devices besides N900?

Yep, works fine with my android phone. Just no the N900.
If I run maebble with no config file I get:

Code:

find nearby devices
no device found
None

EDIT::
Just tried my girlfriends android phone which I've never used before with the pebble and it also finds it fine

proprog 2017-09-01 11:44

Re: [Announce] Maebble - Pebble support for Maemo
 
I've had a very bad device summer. My second n900 died during a phone call (sim card not seen even after reflashing) and my pebble time wont start after sleeping in a drawer during my vacation (it starts but the screen is black, factory reset doesn't help).

I'm now on my third n900 and back to my spare pebble classic. Hence I've had reason to try the setup of maebble again and to me it was very straight forward:

- pair n900 with pebble (confirm on both devices, n900 with standard settings, n900 displays message "pairing complete")
- install python-bluez
- update maebble config file with bluetooth mac
- run maebbled.py

I realize that it doesn't help much for those with problem but I cannot recreate the problems with my current setup.

Unfortunately I haven't got any news on app support but it isn't dead.

biketool 2017-09-01 12:11

Re: [Announce] Maebble - Pebble support for Maemo
 
Hey Proprog, thanks for all the help., like you can see here at TMO I am one of the first N900/Pebble fans I very much don't want to be a tech support PITA.
I used gadgetbridge to reset and upgrade to v3.8 firmware with my LineageOS tablet.
https://github.com/Freeyourgadget/Ga...rmware-updates
Which means I can now install pebble watch apps onto the Pebble, where before I couldn't. So seems 100% functional with Nexus7-Gadgetbridge
(snip me chasing wrong problem, I just reinstalled and verified proper MAC and maebbled worked!)

(edit)Does Maebbled pass on GPS and network connection to watch apps?(I will also look in the thread)

proprog 2017-09-01 13:23

Re: [Announce] Maebble - Pebble support for Maemo
 
Use parameter --print_maemo (note the underscore) to get some output from maebble.

biketool 2017-09-01 14:17

Re: [Announce] Maebble - Pebble support for Maemo
 
Quote:

Originally Posted by azkay (Post 1533704)
Doesn't work on my side ):

Code:

Nokia-N900:~# ./simple-agent hci0 C2:3A:79:20:0A:76
Creating device failed: org.bluez.Error.ConnectionAttemptFailed: Page Timeout

N900 sees other bluetooth devices (other android phone, computer, etc) just not the pebble

I found this hoping it would help me,
https://talk.maemo.org/showpost.php?...08&postcount=5
but I think bluemaemo is just for keyboards, my concern is is bluemaemo is messing with my other pairings?

FWIW tried to connect with bluemaemo and I have cleared out the pebble, it helps me pair, get the buzz on the pebble
then offers me the chance to connect to the pebble, click yes

Trying to connect to
Pebble 2BB5
(cancel)

then
(n900 notification)Bluetooth On <> (discoverable)
Unable to connect to
Pebble 2BB5
Damn


What Bluetooth profile does Pebble use?

proprog 2017-09-01 14:54

Re: [Announce] Maebble - Pebble support for Maemo
 
Looks like maebble cannot find the config file at all. Probably something about the location of the file that isn't working, or that I have forgotten.

It should pick it up if in same directory but will first look in /home/user/.config/maebble/ so you might want to copy it there.

I get the "!! TypeError: coercing to Unicode: need string or buffer, bool found" error as well and am looking at it. But the connection should work anyway.

EDIT: Just noticed that you get the message that the file cannot be read. Didn't someone have a problem with unicode in a previous post?

biketool 2017-09-01 15:07

Re: [Announce] Maebble - Pebble support for Maemo
 
Quote:

Originally Posted by proprog (Post 1533788)
Looks like maebble cannot find the config file at all. Probably something about the location of the file that isn't working, or that I have forgotten.
(snip for brevity)

EDIT: Just noticed that you get the message that the file cannot be read. Didn't someone have a problem with unicode in a previous post?

Maebble unicode error also mentioned here
https://talk.maemo.org/showpost.php?...8&postcount=26

this is with those changes

Code:

~/MyDocs/maebble $ mkdir /home/user/.config/maebble/
~/MyDocs/maebble $ cp maebble.cfg /home/user/.config/mae
bble/
~/MyDocs/maebble $ python maebbled.py --print_maemo
setup
!! Traceback (most recent call last):
!! File "maebbled.py", line 913, in configure
cfg.readfp(open(config_file, 'r'))
!! TypeError: coercing to Unicode: need string or buffer, bool found

could not read config file
!! Traceback (most recent call last):
!! File "maebbled.py", line 925, in configure
bt_address = cfg.get('btservice', 'address')
!! File "/usr/lib/python2.5/ConfigParser.py", line 511, in get
raise NoSectionError(section)
!! NoSectionError: No section: 'btservice'

find nearby devices
no device found
None
^CTraceback (most recent call last):
File "maebbled.py", line 1064, in <module>
loop.run()
KeyboardInterrupt


azkay 2017-09-01 22:15

Re: [Announce] Maebble - Pebble support for Maemo
 
I "fixed" the unicode problem by just hard coding the variable in the script
Code:

config_file = "maebble.cfg"
Or maybe it was
Code:

config_file = r"maebble.cfg"

proprog 2017-09-02 09:59

Re: [Announce] Maebble - Pebble support for Maemo
 
The instructions regarding the config file are too sparse, and it doesn't help that I guess rather than look at the code.

By default maebble looks for a parameter "--config_file" followed by the full path to the config file. If no config parameter is provided the first unicode error will be logged.

Then maebble looks for the config file "/home/user/.config/maebble/maebble.cfg". The problem is that if that file isn't found, or something goes bad when reading it, there is no log.

To get something in the log you need to use parameters "--config_file maebble.cfg" or "--config_file /home/user/.config/maebble/maebble.cfg".

Apologies or the confusion. I added the parameter for the config file without much though to solve my problem with multiple devices. I'll try to change it to something better in the next update.


All times are GMT. The time now is 09:25.

vBulletin® Version 3.8.8