01-15-2019 14:26
01-15-2019 14:26
So I am trying use the new File Transfer Inbox API on the companion side, along with the outbox API on the device side that was recently introduced in SDK 3.0. When I test my code in the simulator, it works perfectly well. The device correctly sends data using the outbox and the companion receives the data via the inbox.
But then, when I try to test the same code on my Fitbit Ionic that was updated to the latest version of the OS, it just does not work. No matter how many times I try and how many times I try to sync my Ionic device to my Android phone (Pixel 2 running Android Pie), it simply does not work. The companion just does not receive the data via the inbox. Seems like this feature is broken or not working correctly. Can someone explain to me what I am doing wrong? Why is this not working? Is this a known issue or something?
I really want to get out of this perplexing jam! Any help is appreciated!
01-16-2019 11:02
01-16-2019 11:02
Is your mobile app and device firmwar definitely up to date?
Firmware: Fitbit OS 3.0 - 27.33.1.30 (Ionic) or 32.33.1.30 (Versa)
Mobile app: 2.84
01-17-2019 20:32
01-17-2019 20:32
Sorry for the late reply. Yes, I can confirm that the software versions are correct. All the latest firmware, so Fitbit OS 3.0 and latest Android app
03-19-2019 16:59
03-19-2019 16:59
Did you solve this issue? I'm having the same problems.
03-20-2019 02:08
03-20-2019 02:08
Can you post a link to a project, or code sample you're using?
Thanks
03-20-2019 13:38
03-20-2019 13:38
I've uploaded a sample project here.
It's the basic digital clock example with inbox and outbox usage added to app and companion.
Here are some logs:
SIMULATOR (works): [HOST] [21:27:06]App Started app/index.js:30,3 [21:27:06]processAllFiles app/index.js:49,9 [21:27:06]Transfer of messageToCompanion.cbor successfully queued. companion/index.js:5,3 [21:27:07]processAllFiles app/index.js:30,3 [21:27:07]processAllFiles app/index.js:35,7 [21:27:07]messageToDevice.cbor received companion/index.js:8,5 [21:27:07]messageToCompanion.cbor received companion/index.js:22,27[21:27:07]messageToDevice.cbor enqueued companion/index.js:10,5 [21:27:07]received message: this is a test message,on the simulator it is send,it does not work on the real device REAL device (fails): [HOST] [21:22:55]App Started app/index.js:30,3 [21:22:55]processAllFiles app/index.js:49,9 [21:22:56]Transfer of messageToCompanion.cbor successfully queued. [HOST] [21:22:55]Launch complete - durations: foregrounding(1577ms), first paint(98ms), total(1682ms). [HOST] [21:22:14]Loaded and evaluated: file:///android_asset/bootstrap.js companion/index.js:4,1 [21:22:14]processAllFiles [HOST] [21:22:14]Loaded and evaluated: file:///data/user/0/com.fitbit.FitbitMobile/app_companions/416b13cc-709b-4d7d-a3ab-1e6eb89c0e91/0x05546db569db54a8/companion.js [HOST] [21:22:14]Companion wird bis [launchedOnTracker] gestartet companion/index.js:20,3 [21:22:14]messageToDevice.cbor enqueued app/index.js:30,3 [21:23:10]processAllFiles app/index.js:35,7 [21:23:10]messageToDevice.cbor received
03-20-2019 13:42
03-20-2019 13:42
I can dig up some code that lets you list the status of everything in the outbox, and monitor transfer status changes. Might that help?
03-20-2019 16:33 - edited 03-20-2019 16:37
03-20-2019 16:33 - edited 03-20-2019 16:37
Same problem for me.It seems to happen only on Versa/VersaLite models.
@MorrisTimm were you able to test your app on different phones?
03-21-2019 01:08 - edited 03-21-2019 01:10
03-21-2019 01:08 - edited 03-21-2019 01:10
03-21-2019 01:54
03-21-2019 01:54
function dumpQueue() { outbox.enumerate() .then(fileTransferArray => { console.log('dumpQueue(): length='+fileTransferArray.length+';'+Date.now()+";"); fileTransferArray.forEach(function(transfer) { console.log(` ${transfer.name}: ${transfer.readyState};;`); }); }); }
...
outbox.enqueue(fileName+'.jpg', buffer) ).then(fileTransfer => { console.log("image ["+fileName+".jpg] queued;"+Date.now()+';'); fileTransfer.onchange = onFileTransferEvent; });
function onFileTransferEvent(e) { console.log(`onFileTransferEvent(): name=${this.name} readyState=${this.readyState};${Date.now()};`); }
Some assembly required. 🙂
03-21-2019 05:57
03-21-2019 05:57
@MorrisTimm my wife has a OnePlus 3 and the file transfer is working for her. The problem is not only on the phone side..
03-25-2019 08:25
03-25-2019 08:25
@Gondwana I've tried to monitor the transfer state. I get a change to transferring on the watch, but that's it. It never arrives at the companion.
onFileTransferEvent(): name=messageToCompanion.cbor readyState=transferring;1553527287644;
@JonFitbit Did you have a look at the project? Any ideas?