Showing results for 
Search instead for 
Did you mean: 

Companion messaging and writing a file - Not working

I am getting pretty frustrated with the unreliability of the companion. It basically is stopping me from developing (and using) clock faces and app.


Please find below my companion code. My app/watch faces simply read the file. Messaging was limited in buffer and same issue with it being unreliable. 

I wake the companion every 30 minutes. I also ask to run the geolocation every 30 minutes.

Nothing works. File is only updated if I am connected to the studio and running the app from there. If I don't connect, I won't get updated data. Package.json permissions are in place (Connect to the internet, run in background, use geolocation).

Please advise.


import { outbox } from "file-transfer";
import { encode } from 'cbor';
import { geolocation } from "geolocation";
import { me } from "companion"

function geoLoc(){
  geolocation.getCurrentPosition(locationSuccess, locationError);
function locationSuccess(position) {
var myLat = position.coords.latitude;
var myLon = position.coords.longitude;
var ENDPOINT = "" + myLat + "&lon=" + myLon +"&key=" + API_KEY;

function locationError(error) {
  console.log("Error: " + error.code,
              "Message: " + error.message);

function getTide(ENDPOINT) {
  // console.log(ENDPOINT)
  .then(function (response) {
      .then(function(data) {
        // console.log(JSON.stringify(data));          
  .catch(function (err) {
    console.log("Error fetching tide: " + err);

function sendFile(data) {
  // console.log("Sending file...");
  const myFileInfo = encode(data);
  outbox.enqueue("tide.txt", myFileInfo)


// Helper

// Wake the Companion after 30 minutes
me.wakeInterval = 30 * MILLISECONDS_PER_MINUTE

if (me.launchReasons.wokenUp) {
  // The companion started due to a periodic timer
  console.log("Started due to wake interval!")
} else {
  // Close the companion and wait to be awoken

//Run geolocation and tide data every 30 minutes
setInterval(geoLoc(), 30 * 1000 * 60);
Accepted Solution

@JonFitbit any chances I can get some feedback on this?

I assume you guys are super busy, but I am not getting much help out of the forum and this same issue has been going on for a while. I am getting a bit discouraged of being involved in this...Smiley Happy

Accepted Solution
0 Votes

This is the companion code I am using:


outbox.enqueue("someFileName.cbor", cbor.encode(data))
  .then((ft) => {
    if (DEBUG_MODE) {
      console.log("Transfer of " + + " successfully queued.");
  .catch(error => Promise.reject("Failed to send settings: " + error));


and on the device:

// Event occurs when new file(s) are received
inbox.onnewfile = function () {


  var fileName;
 do {
   // If there is a file, move it from staging into the application folder
   fileName = inbox.nextFile();
   if (fileName) {
     if (fileName == 'someFileName.cbor') {
      var data = fs.readFileSync(fileName, "cbor");
      //do something with data


   } while (fileName);


the data is read back in to a JSON object so you can get properties from it, ie. data.somevalue etc 


If you set up a temp project using the file-transfer template you will see it in action.

Accepted Solution
0 Votes

Thanks @allyann

My problem is not writing a file. It is that the companion is not updating it automatically. It only connects to the internet, update the data and the file if I am connected to the studio and running the app.

Otherwise file is unchanged.


It makes it useless to create apps that rely on internet APIs for data.

Accepted Solution
0 Votes

removed post as I see you already do a wakeup call

Accepted Solution
0 Votes

"I am getting pretty frustrated with the unreliability of the companion. "

I am pretty sure that if you just limit yourself to write watchfaces that just show the actual time, things maybe will work.


Frustration is my most used work with the Ionic SDK.

Seems like Alpha quality... no responses to these threads.

At least if FitBit let us know that they are working on a real V1 to be delivered say before the end of the year*, I would stop getting frustrated too.


* That's when they are releasing the Nest app, which IMHO might need to have a reliable companion app to work great.

Accepted Solution

Do we have any news on the companion issue? I am starting to think about other platforms and selling my ionic. I don't really see a reason to struggle this much to get simple website data on a watch. I am no programmer, and I might be doing something wrong. But it should not be that difficult nowadays to fetch some data and display them.


Accepted Solution
0 Votes

I am on the same boat and ready to jump ship too as well.

I was under the expectation that features would be missing but whatever was shipped was supposed to be supported. Never been so wrong.

Hey, but it's cross platform, so you can write non working apps identically on iOS and Android! Cat Mad

Accepted Solution
0 Votes

My app development has now moved on to the phase needing messaging.


I too am finding it virtually IMPOSSIBLE to develop reliable messaging code to the companion app.


As others have stated elsewhere, If FitBit know there is a known problem, TELL US that it is known, and give us some sort of TIMESCALE of when it will be fixed.


Currently you have developers effectively WASTING THEIR TIME trying to get something working that is very likely to always FAIL because there is a gremlin.

Whilst having a gripe, it appears very obvious that FitBit staff "cherry pick" replies to the odd topic, whilst overlooking other topics.

Having purchased your product, whether alpha, beta, release candidate or otherwise, WE ARE YOUR CUSTOMERS. Please treat us as such.

As a community, we can help each other out, but there are things that only FitBit staff can answer...

Accepted Solution

They know this issue. Jon (JonFitbit) stated this on the discord chat.
But most of Fitbit staff had holidays and so there should be not much progress in this issue. Also I think this issue is more complex and tricky to find and to fix.

So we have to wait, maybe one month maybe some more...


And yes, I have also projects that needs messaging, but now it's time to develop standalone apps/watchfaces...

Accepted Solution
0 Votes

Thank you @qooApps for the information.


I do not use discord, and primarily use this forum for information.


It's the not knowing that wastes peoples time. If there are known issues it would be good to have a pinned topic listing known issues so it can be easily referred to, along with a status/timescale of fix. This would a) prevent a lot of wasted effort by developers b) frustration at something not working which isn't code related.


Don't get me wrong, I like the watch and the platform. I wan't it to work.

Accepted Solution
0 Votes

I know the discord is there. I posted there as well. It is great for straight developers’ chat, but I don’t think it was intended as a support forum. Maybe Fitbit should start by deciding where to support users to start with.


Said so, Watch was launched the first week of October. I did not assume to have all the functionalities ready, but to have a stable base to develop from.

So far has been a “this does not work”, “this neither”, “this will come soon”. And struggling to find answers on this forum. My original post is almost a month old, and that comes after other posts on similar issues.


Competitors are:

- Apple Watch. Stable platform, tons of users and apps, money making capabilities for developers.

- Garmin. Horrible software design, but stable platform and ability to create apps for the few developers with a lot of users. No money for developers.


3 months into launch, Ionic sits on a very buggy platform platform lacking functionalities, limited users, no official way for developers to make money.


So it is a passion project developing for the Ionic. After 3 months of struggle, passion is diminishing fast. I simply wanted to develop a watch face telling me the tide (as I surf) and an app that works as a wave count. 

Wasted enough time on it that if I don’t get some answers I am happy to look elsewhere.


Sorry for the rant. But every time I look at the watch I get upset that I need to take my phone to look at the tide..... I could see time and tide on a $50 watch and not have a $300 one that has a lot of potentialities and little functionality. I am tired of people selling potential and not products.


Accepted Solution
0 Votes

I'm absolutely agree with the other devs.

It's time to fix this issue - as soon as possible.

Highest priority.

Not only developers are frustrated also the normal users and this is the worst case.

If you have no developers and no customers, then the platform dies.


It would be good, if somebody from Fitbit (JonFitbit / FredFitbit) would answer here.



Accepted Solution
0 Votes

When I saw Fitbit bought Pebbles, I thought: they will make an official app for Pebble, improve a few things and launch a great product. It's going to be great!!

Instead they decided to start from scratch, picking JavaScript as a language, creating a new SDK, focus on "crossplatform", remove important features and release a very low quality SDK. As I said elsewhere if all I wanted were clockfaces or play Mario bros on a 1" screen, I wouldn't be happier. I've never seen a company fail so bad.

The secret to win over the competition is leap-frogging, offer something that the competition doesn't have.

If it wasn't for the convenience of being part of the Fitbit community without having to carry another device (the Zip is looking everyday more appealing), I would have left quite some time ago.

Also: not replying to these forum posts gives me a really bad taste.

Accepted Solution
0 Votes

Another rant here:


But to be honest I feel so much better since I gave up hope.

Accepted Solution
0 Votes

FWIW, I'm finding this to be problematic too.

Gondwana Software
Accepted Solution
0 Votes

There is an actual issue with the communication reliability that was reported by other developers before the holidays. The product team is working on it: I'll ping them to know where it is.


I like the suggestion to have a dedicated place for known issues: it will probably be on the

Accepted Solution

@FredFitbit It has been a week since you "pinged" the product team. Did the ping you back? Any news on this? I would love to see some transparency on this.

Accepted Solution

I've missed the question/response on Discord.
Is there a known issue with companion wake interval and / or messaging?
I have successfully fetched an internet image and send it to the device via the inbox. Getting it to appear without rebuilding and reinstalling the app a second time is proving tough. Triggering a refresh of the fetch is proving even tougher.

As I have not been able to get wake interval working I thought I would try using the "fs" library in the device code to check the last modified time of the downloaded clockface image. If it's older than my desired interval I then try to send a message to the companion.

Unfortunately, the message never gets sent from the Ionic to the companion as the messaging socket is not open.

Would love to know how they have (or will) implement the device to companion messaging. Is this push, or message queues, or perhaps a protocol URI like the gam links?


Accepted Solution
0 Votes

@FredFitbit wrote:

There is an actual issue with the communication reliability that was reported by other developers before the holidays. The product team is working on it: I'll ping them to know where it is.

@FredFitbit Did we miss the response from this ^, or are you still waiting on a response from the development team.


I like the suggestion to have a dedicated place for known issues: it will probably be on the

and did this ^ get any traction at all?

Accepted Solution
0 Votes