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

Companion messaging and writing a file - Not working

Replies are disabled for this topic. Start a new one or visit our Help Center.

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 API_KEY = MY API KEY HERE HIDDEN FOR PRIVACY;
var myLat = position.coords.latitude;
var myLon = position.coords.longitude;
var ENDPOINT = "https://www.worldtides.info/api?datum=LAT&extremes&lat=" + myLat + "&lon=" + myLon +"&key=" + API_KEY;
  
  getTide(ENDPOINT);
}  

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

function getTide(ENDPOINT) {
  // console.log(ENDPOINT)
  fetch(ENDPOINT)
  .then(function (response) {
      response.json()
      .then(function(data) {
        // console.log(JSON.stringify(data));          
        sendFile(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)
}

geoLoc();

// Helper
const MILLISECONDS_PER_MINUTE = 1000 * 60

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

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

//Run geolocation and tide data every 30 minutes
setInterval(geoLoc(), 30 * 1000 * 60);
Best Answer
42 REPLIES 42

We are testing some fixes at the moment of writing those lines. It will improve the communication issues, but even if it's a top priority, we still have work to do about it as it's a complex problem involving many layers of our platform. We should have an update coming soon.

 

As for the "known issues", we will have something today or tomorrow at worst.

Best Answer

@SunsetRunnerAppreciate the update. Thank You Smiley Happy

Best Answer
0 Votes

@SunsetRunnerThank you.

Best Answer
0 Votes

@SunsetRunner thanks for the info. I appreciate letting us know.

Best Answer
0 Votes

@SunsetRunnerwrote:

 

As for the "known issues", we will have something today or tomorrow at worst.


Any update on this ? We are quite a long way beyond “today or tomorrow”. 

Best Answer

Thanks for keeping me accountable. My fault, I need to get used to being back in a company where I'm not the only one taking the decisions 🙂

 

I drafted a first version of the page and waiting on another department to approve it. As soon as I can, I'll publish it. Of course, it's a first draft and it will be constantly improving.

 

In the meantime, anything you need to know quickly about the potential issues we have?

Best Answer
0 Votes

@SunsetRunner

 

Again appreciate your response. Knowing what the known issues are and their likely fix timescales, documentation for spinners, tile lists including currently active tile etc.

 

It seems there is a constant flow of questions from newcomers to the forum that would be answered with an up to date and current known issues list. 🙂

Best Answer
0 Votes

In the meantime, anything you need to know quickly about the potential issues we have?


 

 

Fred, seriously: if it's taking this long to publish a list of known issues, how long do you expect us to believe it will it take to actually fix them? I mean, it's not like you have a competitive advantage over Apple watch / Android Wear (and all the other platforms out there that from an SDK perspective are doing so much better than FitBit Ionic including *cough* *cough* Pebble) and you need to protect it with the utmost secrecy... 

This is borderline unacceptable, sorry to say 😞

So back to your question: is FitBit committed on the Ionic SDK outside the casual watchface development? If not I will stop clicking refresh on the "SDK Development" page and start feeling better after giving up my hopes. 🙂

Best Answer

Fred is working with other teams to develop a long term solution to the "known issues" list, sorry it's not a quick return.

 

Are we committed to building a platform outside casual clock face development? Definitely. We're creating a platform for our devices beyond Ionic, and we're fixing issues and adding new features and functionality. We're somewhat at the mercy of our release schedule, which can make it appear like nothing is happening, but I can assure you it is. The next firmware is imminent and focusses heavily on comms fixes.

Best Answer
Are we committed to building a platform outside casual clock face development? Definitely.

That's great to hear

We're creating a platform for our devices beyond Ionic 

I hope it doesn't mean that the Ionic is already obsolete 🙂

Best Answer
0 Votes

wrote:
I hope it doesn't mean that the Ionic is already obsolete 🙂

Absolutely not, I'm just saying that we're investing in a platform, not an SDK for a single device.

Best Answer
0 Votes

wrote:
We're somewhat at the mercy of our release schedule, which can make it appear like nothing is happening, but I can assure you it is. The next firmware is imminent and focusses heavily on comms fixes.

Hey Jon,

Can you please clarify "at the mercy of a release schedule"? Does it mean that firmware and fixes are released on a scheduled basis, and not once solved?


I started this post 2 months ago, and that was after I had issues for a while and trying to solve them.

@SunsetRunnermentioned some fix for the next day about 2 weeks ago.

I received a random statement on Discord ("your setInterval will never work") from you. That is the extent of the help and solution on this so far. I understand that the comm issue apparently is pretty deep in your coding structure. But am I wrong in expecting a little more help and support from a company that expect free work from passionate users?
I am not referring to you or Fred, per say. But as I mentioned before, looks like this all Ionic SDK project is way understaffed at the moment.

Best Answer
0 Votes

@agsurf5

 

We do have a regular release schedule, but specific fixes can be prioritised. All releases go through rigorous testing and field testing, and this all takes time.

 

There aren't any resourcing issues, and we're working to provide better support on the forum. Unfortunately the forum doesn't really provide a good mechanism for following up on posts, but we're aiming to improve our level of care.

 

I thin regarding your setInterval issue, I said that it wouldn't run, but I don't recall seeing a reply from you. I may have misread the code, but I'm happy to try to work with you on your issues, direct message me on Discord and we can work through it.

Best Answer

I tried download my picture into my Fitbit ionic from photo album watch face many times but it did not work.

Best Answer
0 Votes

@SunsetRunner: can you start a new thread with your issue please? Also, when doing it, please add more details about what you are trying to do and the errors you get. Thanks

Best Answer
0 Votes

I download APP “Photo Album” from my iPhone for my Fitbit ionic watch. I download “Photo Album Watch APPS”  from Fitbit APP. so I made my photo to photo album then I click my Fitbit ionic for photo album down and it kept to say please run  phone app photo album watchface www.photoablumwatchface.com. I did it but it is not working.

Best Answer

I am having the same issue here.  Paid for the app and the developer will not refund...says it is a Fitbit issue.

Best Answer

@SunsetRunner: please contact our customer support for help about app usage.

Best Answer
0 Votes

@salonick: can you contact the customer support about that so they know. Also, can you send me the name of the clock face or app you are talking about in private please? I would also like to know what exactly is happening as I may want to check with the developer directly.

Best Answer
0 Votes

I've been working on something similar to the Photo Album app. The reliability of the file transfer function may impact on my app too. If anyone would like to test the app (which hasn't been approved by Fitbit yet), go here.

 

While I would appreciate any suggestions, I've been slaving away on this for almost four months now so I'm mostly in need of encouragement!

Peter McLennan
Gondwana Software
Best Answer
0 Votes