pebble-health-export
pebble-health-export copied to clipboard
Data transfer
Hi,
I've prepared simple php script:
<?php
$data = $_POST['pebble'];
file_put_contents('./test.csv',$data, FILE_APPEND);
started it: php -S 0.0.0.0:3000
and set up in phone proper url address: http://<ip>:3000/index.php
and named field name to pebble
but pebble shows progress only on first progress bar - second is all the time empty, and I don't have any communication to my "script"... I've turned on wifi in my phone (iPhone).
Is there any special requirements I have to do to be able to export those health data to PC?
Maciej.
Honestly, which that description I admit I have no idea what is going on. But then again, I only have access to Android phones. The first bar tells that the data is successfully transferred from the watch to the phone but something goes wrong between the phone and the script.
Usually I test using the browser from the same phone, by having the script output something visually recognizable, or setting up a dummy form that hits the script. I haven't yet encountered any situation where it does work from the phone browser but not from the Pebble application (except a typo in the setting page).
I have to admit that my app is very bad at error reporting. In the next few weeks, I plan to release a new version with a button to check connectivity in the settings page, and after that I will try to report HTTP errors on the watch.
Sorry for being of so little help.
Hi,
I've tried my url to php server from iPhone and request finished with success - I can see in console that request was sent and I can see result.I added one line at the end:
echo date('Y-m-d H:i:s');
to be able to see any response from the script.
I have no idea what else I can check:/
Maciej.
Maybe my phone is missing some additional app that is required by Health Export? Maby I should install something from app store?
Hi, I really can't thing of any additional app that might be required. But as I said, I have no direct knowledge of the Apple ecosystem. What I gather from it is that the Pebble App is enough.
However in my tests over the last few weeks, I found that the Pebble App isn't very good at reporting HTTP failures. I haven't even found a way to discover whether there is an internet connection or not, and the timeout is seldom triggered after the deadline. So my promises of better handling are severly hampered by the lack of upstream error handling :-(
I'll still try to figure out a way to check a server from the configuration page (at least it runs in a full-featured browser), but it would help in the cases where the (future) configuration page tester reports everything is fine but the Pebble App doesn't communicate.
The problem seems to be a lack of support of FormData in the Pebble app at iOS. I get this from the logs:
[19:49:48] pkjs> Error: Pebble Health Export: ReferenceError: Can't find variable: FormData at line 117 in pebble-js-app.js
I was able to fix this problem by manually generating the POST string instead of using FormData which is not supported in iOS.
Yes, me too. I don't have the source here, but I'll make a PR. Also, if battery usage is a problem, it might help to send the data in binary format instead of character strings. This should reduce bandwidth to 30.1% of the original (not taking into account the bandwidth needed for the commas and newlines.)
Thanks a lot for developing and testing a solution!
Just see my comment on the pull request, and I'll prepare a version 1.2 next week-end (hopefully).
Do I understand this correctly, that the behaviour of seeing only first progress line moving is normal behaviour when using iPhone? I think i've got the newest app, can I test the update somehow? or should I wait for new release?
I wouldn't call it "normal behaviour", because it is really a bug, but that's how things are known to be currently.
Maybe the other people here can provide something to test, but as far as I'm concerned it's easier to publish a new version than to provide a test. As soon as I'm able to make a binary, I'll test it in my unit and publish it immediately if it works. That will be at best 8h from now, or more likely 30h from now (or if we're unlucky next week-end).
I have just uploaded and published the version 1.2 containing Brian Swenson's fix. I don't know how long it takes to propagate, but please let me know if there are still issues with this new version.
After updating to 1.2, this started working on iOS, but after Pebble 4.4 update, i'm getting previous behaviour again.
It looks like list of supported data encodings changed, when I modified settings to use B-64 it started working again.