Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New companion inbox/device outbox (file transfer) API from 3.0 is not working

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!

Best Answer
11 REPLIES 11

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

Best Answer
0 Votes

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

Best Answer
0 Votes

Did you solve this issue? I'm having the same problems. 

Best Answer

Can you post a link to a project, or code sample you're using?

 

Thanks

Best Answer
0 Votes

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
Best Answer
0 Votes

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?

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Same problem for me.
It seems to happen only on Versa/VersaLite models.

@MorrisTimm were you able to test your app on different phones?

Best Answer
0 Votes

@Gondwana: I could try that. Might provide more info about what is happening.

@FitFace: I have only tried it on my Versa with a OnePlus3. I could try it on an Ionic, but I currently have no other phone.

Best Answer
0 Votes

 

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. 🙂

 

 

Peter McLennan
Gondwana Software
Best Answer
0 Votes

@MorrisTimm my wife has a OnePlus 3 and the file transfer is working for her. The problem is not only on the phone side..

Best Answer
0 Votes

@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?

Best Answer
0 Votes