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)

smurfy 2014-11-17 12:25

Re: [Announce] Pebble Watch Connector daemon 0.12
 
I did not notice the music controls problem, but i noticed that there is an "accept call" button now if someone is calling you.

I will try to add support for this aswell.

smoku 2014-11-28 10:51

Re: [Announce] Pebble Watch Connector daemon 0.12
 
Just FYI - I just broke the screen of my Jolla Phone. :-(
So, new releases "delays" may be expected...

javispedro 2014-12-01 03:31

Re: [Announce] Pebble Watch Connector daemon 0.12
 
I've been working on "PebbleKit JS" support (using QJSEngine). My code is currently on on a branch here: https://github.com/javispedro/pebble/tree/js-testing. I'm still doing large(ish) changes. At some point I hope to clean it up and create pull requests to Smoku.

The above is nowhere user ready, so don't use it unless you're planning to help. You need to drop the unzipped .pbw in a subdirectory of ~/.local/share/pebbled/apps. To show the config interface, run 'qdbus org.pebbled /org/pebbled test' once both the daemon and the UI are up and the watch is running the app you want to configure. Yes, the daemon currently callbacks into the UI but this is subject to change. This is just an experiment. It probably leaks memory like crazy.

So far I've got Twebble to run. Among other things this means I can make its web login interface to show up, and to read my timeline from my watch. However I've implemented only the minimal API required to get Twebble to run, so probably nothing else works. Up next are geolocation and other stuff.

EDIT (12-03): Weather already works too and the UI for configuration is now working (you can configure the currently running app, but cannot install new ones).

EDIT (12-06): Evernote and Yelp now work, including geolocation.

EDIT (12-08): See new post below with updated information.

MaemoUser 2014-12-05 21:27

Re: [Announce] Pebble Watch Connector daemon 0.12
 
Nice to see someone is working on this. :)

asa 2014-12-06 17:49

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

Originally Posted by MaemoUser (Post 1450827)
Nice to see someone is working on this. :)

Yeah, just bought Pebble too. Weather and Twitter would be nice to have.

MaemoUser 2014-12-06 18:01

Re: [Announce] Pebble Watch Connector daemon 0.12
 
I would love if the XBMC Remote works with this ;).

javispedro 2014-12-08 00:04

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

Originally Posted by MaemoUser (Post 1450914)
I would love if the XBMC Remote works with this ;).

Just tried and it seems to work. Unsurprising as it's quite a simple JS program!

Some additional updates because the instructions I posted above are now totally useless. There's now a UI to configure applications, but still no UI to install / uninstall them.

Firstly, you need to unzip the contents of the .pbw files you want to use in a subdirectory in $HOME/.local/share/pebble/apps/ . So that the final structure looks like this:
Code:

$ find .local/share/pebble/apps/
.local/share/pebble/apps/
.local/share/pebble/apps/Slides
.local/share/pebble/apps/Slides/appinfo.json
.local/share/pebble/apps/Slides/app_resources.pbpack
.local/share/pebble/apps/Slides/manifest.json
.local/share/pebble/apps/Slides/pebble-app.bin
.local/share/pebble/apps/Slides/pebble-js-app.js
.local/share/pebble/apps/Twebble
.local/share/pebble/apps/Twebble/appinfo.json
.local/share/pebble/apps/Twebble/pebble-app.bin
.local/share/pebble/apps/Twebble/pebble-js-app.js
.local/share/pebble/apps/Twebble/app_resources.pbpack
.local/share/pebble/apps/Twebble/manifest.json

The daemon should automatically pick up any changes without requiring a restart. Once this is done, if you open the corresponding application on the watch, the daemon will automatically start executing the Javascript parts. Please note that this will allow watch applications to obtain your current location and access the Internet; take appropiate care.


In order to configure a JS application, you firstly need to install it in both the watch and .local/share/pebble/apps, following the instructions above. Then, open the application in the watch. In the Pebble Jolla app, click on the "Pebble XXXX" button at the top (where XXXX is your connected Pebble's id). This should take you to a page where you can ping the watch, set the time, or "Configure the current app". Once you hit this button you will be redirected to a webpage depending on whatever application you're currently using. E.g. the Twitter login page for Twebble. Just complete the process and you will be taken back to the Pebble app. Configuration is done!


There's also support to upload/unload applications to/from the Pebble, but no UI for it yet. You still need to unpack the .pbw in ~/.local/share/pebble/apps to "install" it on the phone; this only allows you to upload the application to the watch.
Code:

qdbus org.pebbled /org/pebbled/Watch org.pebbled.Watch.AppSlots
Gets information about the current applications on the watch. There are 8 slots available on the Pebble, so you should get 8 "application UUIDs", or an empty string to indicate an available slot.


Code:

qdbus org.pebbled /org/pebbled/Watch org.pebbled.Watch.UploadApp 57e42595-c333-44fc-afa0-df4539c1f934 0
This will upload the application with UUID 57e42595-c333-44fc-afa0-df4539c1f934 to slot 0 on the watch.


Code:

qdbus org.pebbled /org/pebbled/Watch org.pebbled.Watch.UnloadApp 0
This will unload (remove) whatever application is on slot 0.


You can obtain an application UUID from its .pbw file, by looking inside the appinfo.json text file.

wormdrummer 2014-12-08 03:05

Re: [Announce] Pebble Watch Connector daemon 0.12
 
This is very exciting progress! :)

MaemoUser 2014-12-08 10:09

Nice awesome work :). And thank you for checking XBMC remote.

@javispedro is it possible to provide an rpm of the latest version? So I can try some things and help you?

I tried to built js-testing which was successful but the options do not show in the UI.

Now it's working ;). Qt Creator was borked ;).

Ok, I see in your branch the hotfixes for segfaults are missing. That's why the daemon does not work for me ;).

javispedro 2014-12-08 14:05

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

Originally Posted by MaemoUser (Post 1451082)
Ok, I see in your branch the hotfixes for segfaults are missing. That's why the daemon does not work for me ;).

Hm... Which hotfixes?

MaemoUser 2014-12-08 14:13

Re: [Announce] Pebble Watch Connector daemon 0.12
 
This one for example:

https://github.com/smokku/pebble/com...250927a832315f


I found it out because in your code there is no message "Can not decode message data length invalid".

grep -R "Can not decode message data length invalid" * reveals nothing as for master of smokku it does.

javispedro 2014-12-08 15:09

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

Originally Posted by MaemoUser (Post 1451104)

That one is certainly merged in, being quite old...
It's probably a brand new crash.

I have rewritten the way packets are read because I was "losing" packets when compared to Android's pebbled, and I suspected it's because they were close to the limit of what can be sent in a single RFCOMM frame (which is around ~330 bytes). In the original version either the entire packet fits in a single ->readAll() or it gets dropped. However, it turned out that only the DATA_LOG messages are large, which are actually mostly useless...

I have commited some changes right now to clean up the frame decoding parts a bit. I doubt they'll fix whatever crash you're seeing. Try to get a stack trace, or look at the logs for any hint.

MaemoUser 2014-12-08 15:17

Re: [Announce] Pebble Watch Connector daemon 0.12
 
But the code is not included if I search for this code part in the js-testing branch. I will try to merge it manually and see if it works afterwards.

javispedro 2014-12-08 15:23

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

Originally Posted by MaemoUser (Post 1451111)
But the code is not included if I search for this code part in the js-testing branch.

Yes it is (read that with Monty Python John Cleese's voice :) ).

If you search for _that_ specific string you won't find it, because I've rewritten that part. Every other change including the voice related ones are there.

EDIT: If you believe you're getting the "0" packets that commit tried to workaround I'd like to know more information before simply readding that workaround. In my tests the official Android app _does not_ ignore "0" packets, so if the watch is sending them we must be doing something wrong. I would prefer to diagnose that and be accurate to the Android app behavior.

If you are using QtCreator, can you just launch pebbled it in debug mode and pinpoint where in pebbled's source does it crash? And also add the few debug log lines from before that?

MaemoUser 2014-12-08 15:40

Re: [Announce] Pebble Watch Connector daemon 0.12
 
Ok, will do it when I am at home :).

javispedro 2014-12-08 16:24

Re: [Announce] Pebble Watch Connector daemon 0.12
 
I have built a package using QtCreator itself. I have implemented almost everything I wanted to implement, so now only the boring parts remain, like the UI for managing apps :). This may take a while, so I decided to put out a package for now.

Note the disclaimers still apply -- I have only been using this for a couple of days, so it may be "problematic". Bugs may cause to e.g. corrupt the apps installed on the watch, in which case you may need to "revert to factory settings". Since I haven't implemented firmware upgrades or anything like that, it should be impossible to actually brick a Pebble.

If you need to return to Smoku's branch ensure you fully uninstall my package first.

MaemoUser 2014-12-08 16:59

Re: [Announce] Pebble Watch Connector daemon 0.12
 
Ok, looks like I have a strange version of Twebble it crashes app and watch immediatly. Weather works without a problem. Which version of Twebble do you use?

javispedro 2014-12-08 17:04

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

Originally Posted by MaemoUser (Post 1451123)
Ok, looks like I have a strange version of Twebble it crashes app and watch immediatly. Weather works without a problem. Which version of Twebble do you use?

Does it happen the moment you try to open it on the watch, even when it is disconnected?
This may happen if it's been misinstalled or corrupted. Try uninstalling it (either using qdbus org.pebbled .... , or an Android/iOS device) and then reinstalling it.

I use "1.1.0", downloaded from http://izqui.me/twebble .

MaemoUser 2014-12-08 20:44

Re: [Announce] Pebble Watch Connector daemon 0.12
 
The problem with Tweeble seems to be solved in the latest git commits :). Tweeble now working fine for me.

javispedro 2014-12-08 21:10

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

Originally Posted by MaemoUser (Post 1451162)
The problem with Tweeble seems to be solved in the latest git commits :). Tweeble now working fine for me.

Thanks, I've updated the package accordingly. It seems like the crash was triggered when the Twitter login page took more than a few milliseconds to respond :)

MaemoUser 2014-12-10 21:44

Re: [Announce] Pebble Watch Connector daemon 0.12
 
After some days of use i must say "works like a charm". No problems so far it just works :).

javispedro 2014-12-11 00:41

Re: [Announce] Pebble Watch Connector daemon 0.12
 
Here's what I use my 8 slots with:
- Compass (hopefully to be replaced by a map program at some point..): no JS side
- Multi Timer : no JS side
- Twebble: working flawlessly except posting tweets, which doesn't seem to work. Not that I would never like to do that either way since keyboard is just painful. Also viewing my own profile is broken but it seems broken under Android too. In fact, I can't post tweets from Android either...
- Weather: flawlessly
- Authenticator: didn't try the JS side very much, but it seems like it's just configuration UI, and the actual logic is done on the watch. Good.
- Misfit: no JS side, but I don't understand where this application gets its data from. It measures "deep sleep" even when the Pebble is turned off.
- Yelp: working flawlessly. I had to patch the JS side a bit because the original was insane regarding timeouts (e.g. "get me a fresh GPS fix in 2 seconds, stat! and if you try to be sneaky and send me a cached GPS position that is just 1 femtosecond old I WILL notice it and DIE HORRIBLY!!"). I suppose Android plainly ignores those timeouts.
- Evernote: the JS side takes a whopping 10 seconds to load on my Jolla (taxing QJSEngine, I guess), creating a very noticeable delay. I sometimes get "undefined" when trying to browse my notebooks, however no JavaScript exceptions actually fire. The word "undefined" comes from the Evernote servers.... and in fact I get the same behavior on Android too, just less frequently. Those guys ship a XML parser written in JS, so...

Note I haven't tried any actual "fully javascript" app (e.g. cloudpebble) yet, so if you've been able to run one, I would be interested in hearing reports.

By the way the next firmware upgrade brings multi-language support to the table. However changing languages on the watch seems virtually the same as uploading a new firmware.
I'm not sure how "safe" is Pebble's recovery mode, so will probably not experiment with firmware loading.

sconf 2014-12-13 22:28

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

Originally Posted by javispedro (Post 1451557)
I'm not sure how "safe" is Pebble's recovery mode, so will probably not experiment with firmware loading.

Can you elaborate what you mean by above?

Couple of weeks ago I had a horrible experience, when Pebble clock and Android app were stuck in the middle of firmware update. Nothing seemed to work, but after pressing clock buttons in panic the clock seemed to go into recovery, which also was not helping. Only after fiddling with recovery and new pairing of bt things started miraculously work again; fw was loaded along with all clock apps. Phew...

shinchim0 2014-12-14 08:44

Re: [Announce] Pebble Watch Connector daemon 0.12
 
Does this app still works now? I have Pebble & recently update the firmware to 2.8.1, but it just connect for few sec after paring. nothing works after that... if any one pebble still works, pls do tell me what version your pebble

MaemoUser 2014-12-14 08:52

Re: [Announce] Pebble Watch Connector daemon 0.12
 
What version of SailfishOs are you running? U10, then you need to download the version from github and not from openrepos.

beeki 2014-12-14 08:57

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

Originally Posted by shinchim0 (Post 1452119)
Does this app still works now? I have Pebble & recently update the firmware to 2.8.1, but it just connect for few sec after paring. nothing works after that... if any one pebble still works, pls do tell me what version your pebble

Bought pebble steel a week or so ago, it also does not pair. Shows pairing on jolla and clock, but then clock disconnects.

MaemoUser 2014-12-14 08:59

Re: [Announce] Pebble Watch Connector daemon 0.12
 
U10on Jolla?

beeki 2014-12-14 10:43

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

Originally Posted by MaemoUser (Post 1452124)
U10on Jolla?

1.1.0.39 Uitukka here

MaemoUser 2014-12-14 11:02

Re: [Announce] Pebble Watch Connector daemon 0.12
 
Then you need to install the version on github. Otherwise it won't work. Or the version of javispedro this works, too.

smoku 2014-12-14 11:19

Re: [Announce] Pebble Watch Connector daemon 0.12
 
I added a note on OpenRepos info page.

MaemoUser 2014-12-14 12:05

Re: [Announce] Pebble Watch Connector daemon 0.12
 
Isn't the new version backwards compatible?

javispedro 2014-12-14 15:41

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

Originally Posted by MaemoUser (Post 1452159)
Isn't the new version backwards compatible?

No, it is not; if you open the new version in the old firmware, the daemon will also crash on startup, as does the old version if you open it in the new firmware.

By the way, I've been working on some UI for uploading/unloading apps from the Pebble:
http://depot.javispedro.com/jolla/pe...le-bankmgr.jpg
Apart from this, I've added support for the getWatchToken / getAccountToken JavaScript functions. The first one will return a (MD5) hash of the watch serial number; the second one will return a random number that is persisted between reboots. This means setpebble.com apps should now work and configure properly. I'd still like to add some "per-app" randomly generated salt instead of using the app UUID in order to actually make the hash secure.

Here is the updated testing package.

You still need to manually unpack .pbw files in ~/.local/share/pebble/apps for everything to work. The plan is to eventually register a file association so that downloading .pbw files from the browser will automatically unpack them there.

Smoku, did you get your Jolla back? :) I would like to send all these changes back, if you are OK with that. Would you prefer small patches, or is a "big" pull request OK?

Apart from the UI + bank/app manager changes, I've done some design ones, such as entirely changing the D-Bus interface (D-Bus naming conventions + lots of new methods), using autogenerated d-bus interfaces/adaptors (still on top of the existing PebbledProxy/Interfaces), rewrote the WatchConnector's read loop (so that it handles fragmented packets), moving the music functionality out into musicmanager.cpp (so that it always uses the last MPRIS service which sent a signal instead of listening for name registrations), and detecting ICU via pkgconfig.

javispedro 2014-12-14 16:57

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

Originally Posted by sconf (Post 1452089)
Can you elaborate what you mean by above?

I am not sure if Pebble can recover from a completely botched firmware upgrade. The watch supposedly stores two firmware versions, so it should be able to roll back to the second one, but I'm not sure how much damage can you do to it from the Bluetooth protocol.

smoku 2014-12-14 18:09

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

Originally Posted by javispedro (Post 1452174)
Smoku, did you get your Jolla back? :) I would like to send all these changes back, if you are OK with that. Would you prefer small patches, or is a "big" pull request OK?

It turned out the damage is not that big that I thaught. The screen does not degrade anymore and is in usable state. And the fall broke the speaker, so I have to rely on Pebble to get the calls. ;-)
So, it generally works...

You can create one big pull request. I can see that you read my intentions for the watch page exactly as I thought it of. :D

Please rebase on the current master though, as yesterday I removed Log4Qt dependency, so the logging is a bit different now.

But for historical reasons it would be better if you would create a separate commit for every functional change - like you described. It does not even have to be atomic - changes can be interrelated. But it's always better to see a separate reasoning in 'git blame' than one big "Added support for JS apps" line.

MaemoUser 2014-12-15 12:39

Re: [Announce] Pebble Watch Connector daemon 0.12
 
Just installed the upgraded version. I like the watch page with the applications very much :).

wormdrummer 2014-12-16 05:58

Re: [Announce] Pebble Watch Connector daemon 0.12
 
The new version is awesome so far!.

Just a silly question, how do I get the weather to work? Do I need to use a specific watchface or app on either the pebble or my jolla?

MaemoUser 2014-12-16 07:37

Re: [Announce] Pebble Watch Connector daemon 0.12
 
Just follow the instructions of javispedro. Download the weather app from pebble store of your choice. Extract it and put it in the right directories and install it on the watch.

shinchim0 2014-12-18 06:03

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

Originally Posted by MaemoUser (Post 1452145)
Then you need to install the version on github. Otherwise it won't work. Or the version of javispedro this works, too.


how to get the github version? mind to show me how with step by step? thanks

MaemoUser 2014-12-18 08:10

Re: [Announce] Pebble Watch Connector daemon 0.12
 
You need to download this version:
http://smurfy.de/files/jolla/pebble-..._2.armv7hl.rpm

Then stop the running pebbled and uninstall it. Afterwards via developer mode and "su-devel" run rpm -ivh pebble-0.12-1-update9_2.armv7hl.rpm

wormdrummer 2014-12-18 09:15

Re: [Announce] Pebble Watch Connector daemon 0.12
 
sorry Maemouser, what command do I use to stop pebbled and uninstall it?. Whenever I try by uninstalling via warehouse, I get amissing dependency problem when installing the new package....


All times are GMT. The time now is 12:07.

vBulletin® Version 3.8.8