Works in Simulator Not on Watch

Former Member
Former Member
Hello, I just was able to get my fonts uploaded and working and have a decent watchface working on the simulator, however when I create select Connect IQ Build for Device Wizard and publish to prg, when I open up the face on the watch it pauses and then shows the default watch.

I created a developer key locally with eclipse and I am curious if that is the issue or if anyone had other issues getting their app to work on their watch.

Any thoughts appreciated!

Thank you
Ben
  • Hey,

    I'm glad that your fonts seem to be working. If you check in the Garmin>Apps>Logs directory on the device in mass storage you should find a CIQ_LOG.txt there. This gives more information about why the watchface is crashing. If we can see that then we should be able to help you pinpoint the issue.

    Thanks,
    -Coleman
  • With the file Coleman mentioned, you also want to make sure the "Build release version of project" is unchecked in the "Build for Device Wizard", as you'll get more info in ciq_log.txt if you build a debug version.

    You might see things like "symbol not found" in the log file, and that could be something like trying to access floors or getHeartRateHistory() on a device that doesn't have that data.
  • Former Member
    Former Member over 8 years ago
    Thank You!

    Awesome!! That was it.
    ERROR: Symbol Not Found Error

    It works with these calls commented out! I now need to figure out which one caused the error and find an alternative solution:

    var batt = Sys.getSystemStats().battery;
    var bt_status = "_";
    if (Sys.getDeviceSettings().phoneConnected) {
    bt_status = "bt";
    }
    var dnd_status = "";
    if (Sys.getDeviceSettings().doNotDisturb){
    dnd_status = "/";
    }
  • It's likely the doNotDisturb. (battery and phoneConnected have been around since 1.0.x CIQ) You haven't mention the watch/FW you're using, but DND is only on watches with a 2.x.x CIQ VM, so not on watches like the fenix3, 3HR, fr 23x,630, etc.

    Not sure which SDK you're running on your computer, but 2.2.1 is good at catching things like this.

    In the code, this is a good place to use a "has".

    Something like:
    var settings=Sys.getDeviceSettings();
    var dnd_status = "";
    if(settings has :doNotDisturb && settings.doNotDisturb) {dnd_status="/";}
  • Former Member
    Former Member over 8 years ago
    Thank You!

    I am coding for a garmin forerunner 630. There is an option to set to do not disturb so I was hoping that was right. I will step through each one.
  • Former Member
    Former Member over 8 years ago
    That was it, dnd_status

    That was it, dnd_status

    Thank you!
  • Even though DND can be set on things like the 23x and 630, it's not available in CIQ unless the watch has the 2.x.x CIQ VM. (the 630 have 1.3.x or 1.4.x) See the api doc:

    #doNotDisturb ⇒ Boolean

    True if “Do Not Disturb” mode is enabled on the device

    Returns:
    (Boolean)
    Since:
    2.1.0



    As I said, things like this will be caught in the 2.2.1 SDK/sim, and "has" is a way to go if you support multiple watches
  • Former Member
    Former Member over 8 years ago
    Thank You!

    Awesome! Thank you Coleman & Jim!

    I used to have the pebble time and really liked coding my own watchface, but once they stopped supporting time I decided to switch to garmin. I am super happy i did. The ui is much easier to navigate and coding seems more intuitive.

    I still need to tweak it, but happy with something similar on watch. The other metric I had on my pebble was a day/night map with the sun'd position in the center. I was able to step through each pixel and determine if a day or night pixel should be placed on the screen. Any chance you have seen graphic manipulation done like this on garmin? Just curious. Thank you for your help!

    For reference, here is side-by-side compare.

    Ben

  • Former Member
    Former Member over 8 years ago
    Unfortunately I think that type of map would be very tricky to produce with CIQ. We had a developer doing a similar type of per-pixel rendering early on, and he found that it took an extremely long time. That type of graphics operation is just really inefficient when running on the VM.

    There might be a quicker way to do it, but I don't know enough about that image to make any specific suggestions. There are some new graphics tools coming eventually that might help, but we are only able to bring these new features to the 2.x devices due to the resource limitations of the 1.x devices.