maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [SFOS] [Announce] Pebble Watch Connector daemon (https://talk.maemo.org/showthread.php?t=93399)

smoku 2014-06-27 23:35

[Announce] Pebble Watch Connector daemon
 
This is my daemon+app for connecting Pebble Watch to SailfishOS.
Get it at OpenRepos: https://openrepos.net/content/smoku/pebble

Please report bugs and request features at: https://github.com/smokku/pebble/issues
You can discuss here of course, but creating an issue makes it more "formal" ;)
You can also discuss on Gitter: https://gitter.im/smokku/pebble

Features: https://raw.githubusercontent.com/sm...ster/README.md

Releases: https://raw.githubusercontent.com/sm...pebble.changes

smoku 2014-06-27 23:35

Re: [Announce] Pebble Watch Connector daemon
 
[reserved for future use]

Boxeri 2014-06-28 06:06

Re: [Announce] Pebble Watch Connector daemon
 
Have to try this once I get back home.

What are your current plans for IM messages and Music player (and if possible CuteSpotify) controls?

These are my most important features. Have you checked the app SkippingStones by Wonko here in TMO? He has also been working on this.

Great job, Thank you!

smoku 2014-06-28 16:50

Re: [Announce] Pebble Watch Connector daemon
 
IM messages are already forwarded. I'm using the Conversations interface, so everything handled as conversation gets passed to Pebble.

Music Playback control is next on my TODO list.

HtheB 2014-06-28 16:57

Re: [Announce] Pebble Watch Connector daemon
 
Smoku, maybe this one is also very interesting for you:

There is an interesting Android app (Pebble Dialer)
https://play.google.com/store/apps/d...o.pebbledialer

This app and watchapp shows you: the call log, phone contacts to dial someone, answer an incoming phone call
you can turn on the speakers of your phone when you've answered a phone call, and even turn off/on the mic.

an AWESOME app that I would like to see on our jolla too! :)

Here you can find the github repo:
https://github.com/matejdro?tab=repositories

Source of Android companion app:
https://github.com/matejdro/PebbleDialer-Android

Source of the Pebble watchapp:
https://github.com/matejdro/PebbleDialer-Watchapp

smoku 2014-06-28 19:02

Re: [Announce] Pebble Watch Connector daemon
 
Pebble Dialer is nice and I will happily add support for it.

Thanks for the source pointers - I should be able to find the protocol it talks to the phone and emulate it in pebbled. :)

smoku 2014-06-30 00:34

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Just released 0.2 fixing huge bug crashing daemon. Upgrade recommended.

Alexxxl 2014-06-30 12:21

Re: [Announce] Pebble Watch Connector daemon 0.2
 
is it possible to port it to MeeGo ?

smoku 2014-06-30 12:23

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by Alexxxl (Post 1431440)
is it possible to port it to MeeGo ?

You mean Harmattan?

I'm not sure whether Harmattan allows for user-session level daemons.
Also it lacks Nemo specific services I use to monitor Voice Calls and Conversations.

So, possible - yes, feasible - no.

Alexxxl 2014-06-30 13:55

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by smoku (Post 1431441)
You mean Harmattan?

I'm not sure whether Harmattan allows for user-session level daemons.
Also it lacks Nemo specific services I use to monitor Voice Calls and Conversations.

So, possible - yes, feasible - no.

yes, harmattan ...

What do You mean about user-session level daemons?

smoku 2014-06-30 17:59

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by Alexxxl (Post 1431445)
What do You mean about user-session level daemons?

Code:

$ systemctl --user list-units

HtheB 2014-06-30 23:37

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Schturman made a script to run Pebbled on your homescreen.
https://openrepos.net/sites/default/...con-icon_0.png

https://openrepos.net/content/htheb/pebble-toggle

smurfy 2014-07-02 11:49

Re: [Announce] Pebble Watch Connector daemon 0.2
 
@smoku

Nice start and it looks more integrated than SkippingStones. I'm currently using SkippingStones and already contributed a Watchface weather support.

Is your app opensource as-well? Main thing i don't like with SkippingStones is that there is no deamon.

I think a big part is supporting custom WatchApp/Face handlers on the phone side. Not sure if it is possible to support the JS api on the phone side or if there is need to reimplement the handlers ourselfs.

smoku 2014-07-02 16:02

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by smurfy (Post 1431613)
Is your app opensource as-well? Main thing i don't like with SkippingStones is that there is no deamon.

Yeah. This is exactly why I developped own solution.
You will find the source on my GitHub: https://github.com/smokku/pebble

Quote:

Originally Posted by smurfy (Post 1431613)
I think a big part is supporting custom WatchApp/Face handlers on the phone side.

I will eventually stea..^W copy that part from SkippingStones ;)

Quote:

Originally Posted by smurfy (Post 1431613)
Not sure if it is possible to support the JS api on the phone side or if there is need to reimplement the handlers ourselfs.

JS api?

smurfy 2014-07-02 18:35

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Cool, i will take a look at your source and probably do some pull requests too :)

disclaimer: i'm new to pebble and never used pebble with android or iphone, except using a friends android to update my firmware and install some apps

As far as i understand the pebble sdk, until pebble sdk 2 you needed a companion app on your phone to communicate with the outside world and the pebble.

With sdk2 they added a JS api Which runs inside the offical pebble phone app and allows you to write your "companion" apps in js, with simple settings and outside world communication

Maybe at some point we could emulate this JS engine to support some of the watchapps/faces nativ

smoku 2014-07-02 19:20

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by smurfy (Post 1431654)
disclaimer: i'm new to pebble and never used pebble with android or iphone, except using a friends android to update my firmware and install some apps

I bought my Jolla Phone a month ago and I've been using Pebble with android phone for half a year now.
I just installed Pebble app on my netbook running android-x86, to have a look how the original works, as I do not own an Android phone any more. (Yay!)


Quote:

Originally Posted by smurfy (Post 1431654)
With sdk2 they added a JS api Which runs inside the offical pebble phone app and allows you to write your "companion" apps in js, with simple settings and outside world communication

I didn't develop for Pebble before, so thanks for all the pointers.

Quote:

Maybe at some point we could emulate this JS engine to support some of the watchapps/faces nativ
Seems like a plan.
I have a lot of experience with Qt WebKit bridge and Qt Script engine looks similar. :)

smurfy 2014-07-02 19:39

Re: [Announce] Pebble Watch Connector daemon 0.2
 
I did a quick look at the "modern" watchface i'm using and which uses the JS api it's look quite easy.

Basically its an JS engine which supports common javascript including "XMLHttpRequest", window.navigator.geolocation.getCurrentPosition and a new Object called "Pebble"

The Pebble object supports different methods, like sendAppMessage or openURL, there are also some events fired to be listened.

openURL method for example opens the given url in a browser (QWebkit?) and the external website then can GET a special protocol url in the browser window with json data which then in return can be accessed in the JS coded via an eventlistener on the "webviewclosed" event.

smoku 2014-07-02 21:47

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by smurfy (Post 1431659)
openURL method for example opens the given url in a browser (QWebkit?) and the external website then can GET a special protocol url in the browser window with json data which then in return can be accessed in the JS coded via an eventlistener on the "webviewclosed" event.

I'm OK with embedding JavascriptCore in a daemon.
I'm not OK with embedding full-blown browser in a daemon. ;)

Alexxxl 2014-07-03 09:09

Re: [Announce] Pebble Watch Connector daemon 0.2
 
do you have any video how it works ?

towhatend 2014-07-03 20:42

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Tried it, but it shows wrong name when I tested to call from another phone.

Bundyo 2014-07-03 20:57

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by smoku (Post 1431673)
I'm OK with embedding JavascriptCore in a daemon.
I'm not OK with embedding full-blown browser in a daemon. ;)

The settings part is in fact in the UI part of the Pebble Android app :) No sure if we will need more than a JS engine in the daemon.

smurfy 2014-07-04 13:05

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by Bundyo (Post 1431762)
The settings part is in fact in the UI part of the Pebble Android app :) No sure if we will need more than a JS engine in the daemon.

Yes the settings part is and should be in the ui part here too.
Problem is that the "companion" part also needs XMLHttpRequest and GPS thing which is not supported by QScriptEngine, only QWebkit

My idea would be doing the app handlers as a separate deamon and communicate with the main daemon. (dbus?)

The pebble js kit handler would be a separate deamon like one for SmartStatus+ for example.

The app deamon could be activated or suspended by the main daemon based on the launcher message (49) from the pebble (not sure if the message is sent reliable)

smoku 2014-07-04 13:40

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by smurfy (Post 1431812)
Problem is that the "companion" part also needs XMLHttpRequest and GPS thing which is not supported by QScriptEngine

These are easy enough to code in C++.

Quote:

Originally Posted by smurfy (Post 1431812)
My idea would be doing the app handlers as a separate deamon and communicate with the main daemon. (dbus?)

I see no reason to split them into separate processes. Just adds another layer of complication.

smurfy 2014-07-04 15:12

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Was just an idea to not bloat the main deamon with app handlers the user probably don't use.

I still would suggesst adding some kind of dbus interface to allow third party apps to communicate with pebble.

smoku 2014-07-04 15:20

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by smurfy (Post 1431829)
Was just an idea to not bloat the main deamon with app handlers the user probably don't use.

AFAIU the idea is to load JS "companion app" only for the time when the "watch app" is active on Pebble. When user closes the watch app, the companion app is unloaded.


Quote:

Originally Posted by smurfy (Post 1431829)
I still would suggesst adding some kind of dbus interface to allow third party apps to communicate with pebble.

Good, but unrelated, idea. :)

smurfy 2014-07-05 11:28

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Great.

I looked at the app and had some problems with it.

1. 99% of the time it does not show the caller id. I noticed that it seams to be a problem with the dbus thing. lineId is empty. But dbus-monitor shows the lineId. (probably getAll vs get)
2. The app does not work. (always no watch found) while the daemon connects and at least call notifications get triggered
3. I have problems compiling. While compiling "lib" i get warnings but it does compile:
Code:

ln: creating symbolic link `libpebble.so': Read-only file system
make: [libpebble.so.1.0.0] Error 1 (ignored)
ln: creating symbolic link `libpebble.so.1': Read-only file system
make: [libpebble.so.1.0.0] Error 1 (ignored)
ln: creating symbolic link `libpebble.so.1.0': Read-only file system
make: [libpebble.so.1.0.0] Error 1 (ignored)

And daemon/app fails to link with
Code:

"/opt/cross/bin/armv7hl-meego-linux-gnueabi-ld: cannot find -lpebble"
I use windows and the virtualbox mersdk to compile.

Any tips?

smoku 2014-07-05 18:08

Re: [Announce] Pebble Watch Connector daemon 0.2
 
1. I get that too, but very rarely. Possibly a Nemo bug.

2. I broke it in 0.2. Already fixed in 0.3.

3. These errors are very weird. Possibly some issues with your SDK. Do you have it freshly installed or upgraded from some earlier Alpha?

smurfy 2014-07-05 22:39

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Ok,

about the compile problem:

With Virtual Box 4.1.8 creating symlinks on shares is disabled.
After enabling it, it still does not work, "protocol error", i guess thats because i use windows as host.

Copying the libpebble.so.1.0.0 to libpebble.so manually works and daemon and app now compiles.

smoku 2014-07-06 01:45

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by smurfy (Post 1431885)
2. The app does not work. (always no watch found) while the daemon connects and at least call notifications get triggered

Was it working for you in 0.1?

I'm pretty sure it was working fine in 0.1 with daemon running, but I cannot reproduce it now.
I always have a resource busy error when app tries to connect to pebble. Looks like I cannot open two concurrent connections to Pebble. Even when I downgraded to 0.1. Strange. I'm (pretty) sure it was working before...

MaemoUser 2014-07-07 07:31

Re: [Announce] Pebble Watch Connector daemon 0.2
 
I have no Pebble yet, so excuse the maybe dumb question ;).

Is it possible to install an application to the Pebble like Twebble and use it via your lib?

smoku 2014-07-07 09:13

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by smurfy (Post 1431920)
Copying the libpebble.so.1.0.0 to libpebble.so manually works and daemon and app now compiles.

There is no libpebble in master anymore. Should help. :)

smoku 2014-07-07 09:14

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Quote:

Originally Posted by MaemoUser (Post 1432002)
Is it possible to install an application to the Pebble like Twebble and use it via your lib?

Not yet.
So far it supports call and message notifications only.

MaemoUser 2014-07-07 09:31

Re: [Announce] Pebble Watch Connector daemon 0.2
 
Ok, thx :).

An integration of the IRC for Sailfishclient would be cool, too. And maybe it's possible to connect to the Twitter and Facebook Implementation of the Jolla.

smoku 2014-07-09 00:10

Re: [Announce] Pebble Watch Connector daemon 0.3
 
Just released 0.3

smoku 2014-07-12 00:16

Re: [Announce] Pebble Watch Connector daemon 0.4
 
Just released 0.4

I.T. Backstage 2014-07-12 09:32

Re: [Announce] Pebble Watch Connector daemon 0.4
 
First of all, thanks for all your work so far!
Since the last update, automatic reconnect works great! But sadly, call-notifications don't work anymore.

Unfortunately log-file says, Pebble isn't connected:

Quote:

12.07.2014 11:22[0x0070f240] ERROR watch::WatchConnector - Error connecting Pebble: -1Die Ressource ist zur Zeit nicht verfügbar
12.07.2014 11:24[0x0070f240] ERROR watch::WatchConnector - Error connecting Pebble: -1Die Wartezeit für die Verbindung ist abgelaufen
First entry means sth. like "ressource isn't available", second entry means "time-out while waiting for connection".

Whats strange is that messages forwarding and ping works fine.

smoku 2014-07-12 09:45

Re: [Announce] Pebble Watch Connector daemon 0.4
 
Damn.
I didn't have my second phone for a few days, so I couldn't test phone calling. :-/
Will fix it as soon as I get it back. (today/tommorow)

smoku 2014-07-12 22:18

Re: [Announce] Pebble Watch Connector daemon 0.5
 
Just released 0.5

smoku 2014-07-12 22:20

Re: [Announce] Pebble Watch Connector daemon 0.4
 
Quote:

Originally Posted by I.T. Backstage (Post 1432539)
Unfortunately log-file says, Pebble isn't connected:
First entry means sth. like "ressource isn't available", second entry means "time-out while waiting for connection".

These messages are logged when Pebble isn't around and pebbled tries to connect. The resource that isn't available is Pebble's BT serial port... ;)

I.T. Backstage 2014-07-14 14:30

Re: [Announce] Pebble Watch Connector daemon 0.5
 
Call notification works fine again :) Thanks for the quick fix! Hope there's more to come ;)


All times are GMT. The time now is 05:14.

vBulletin® Version 3.8.8