• Make Music with Connect IQ and the LIDAR-Lite v4

    The Garmin LIDAR-Lite v4 LED is a LED based LIDAR solution. The LIDAR-Lite v4 is powered by a Nordic nRF52840 application processor, which means your can program it communicate distance measurements over ANT, ANT BLAZE, and BLE. By default, it communicates distance readings over ANT.

    This sample uses the LIDAR-Lite v4 to create a Connect IQ Theremin. The Theremin was an early electronic musical instrument, using two antennae to sense the position of the player’s hands allowing them to control oscillation and frequency. As the artist waives their hands around the antennae it amplifies the signals to make its trademark sound.

    Our demonstration uses ANT and the updated Attention.playTone API. The playTone now allows developers to pass in an array of Attention.ToneProfile objects. Strung together, your Connect IQ apps can now play some music.

    You can find the source to the LiDAR Theremin on GitHub.

    • Oct 22, 2019
  • Bluetooth Mesh Networking with Connect IQ

    This guest post was written by Gus Workman, a Garmin intern and Ohio State University student.

    Bluetooth mesh is a protocol that was released in 2017 by the Bluetooth SIG. Since that time, it has slowly started to gain traction for its many-to-many connection capabilities, enhanced range, and security features. The protocol is getting more attention with the big silicon manufacturers, and every week sees the release of new Bluetooth mesh IoT devices. Because this protocol is quickly rising in popularity, the team here at Garmin thought that it would be an interesting challenge to see if the Bluetooth mesh protocol could be supported on Connect IQ devices using the brand new BluetoothLowEnergy APIs. Out of this concept came two projects - a Bluetooth mesh library and an example application using the library.

    The following is a guide to the Bluetooth mesh library created as a 2019 summer intern project. This library can be used by Connect IQ devices that support the 3.1 Bluetooth Low Energy APIs. It can be used to create a Bluetooth mesh network, provision devices to add them to the network, and control devices on the network. It does not turn a Connect IQ device into a node in the mesh network, since it only supports interacting with the network via a proxy node. The library has been designed to make it easy to either build off a implementation of a BluetoothLowEnergy delegate or to create a custom implementation in order to have more control or support other Bluetooth functionality outside of Bluetooth mesh.

    The following guide primarily is geared toward introducing users to the sample barrel and sample application available on GitHub.

    Usage

    Bluetooth mesh is by no means a simple protocol - there are many great features (such as the excellent security Bluetooth mesh provides), but the multitude of features and small details can make it seem very difficult. Fortunately, this Monkey Barrel makes Bluetooth mesh much easier while also giving the developer access to the lower-level layers of the protocol.

    Getting Started

    To get started building Bluetooth mesh applications on Connect IQ, you will first need to download the barrel and import it. To import it into your project, follow the steps outlined in the Programmer's Guide. After importing the barrel into your project, you only need to add the following pieces of code to get started with Bluetooth mesh:

    1. Create a class that extends MeshDelegate and implement the following methods:
      1. onScanFinished()
      2. onConnected()
      3. onDisconnected()
      4. onNetworkPduReceived(networkPdu)
    2. If you plan on supporting provisioning new devices, you also implement the following methods:
      1. onProvisioningParamsRequested(capabilities)
      2. onAuthValueRequired()
      3. onProvisioningFailed(reason)
      4. onProvisioningComplete(device)
    3. Initialize a NetworkManager object and pass it into a new instance of your custom MeshDelegate class.
    4. (Optional) Call the networkManager.load() method to load the saved state, and put a call to networkManager.save() in the application's onStop() method to save the state on close.
    5. Import the BluetoothLowEnergy module with using BluetoothLowEnergy as Ble;
    6. In your app's onStart() method, call Ble.setDelegate() with the instance of your custom MeshDelegate class.

    That's pretty much it! Integrating the Bluetooth mesh Monkey Barrel is fairly easy.

    Connecting to Devices

    To communicate with the mesh network, your device needs to connect to a proxy node. Simply call your custom MeshDelegate.startScanning() method with an argument of MODE_PROXY to begin the process. Over the next five seconds, the device will scan for devices and collect the results into the scanResults array. The scan results are automatically filtered to only include unique results where the device is broadcasting a Bluetooth Mesh Proxy (or Provisioning if you used MODE_PROVISION as the argument to startScanning()) Service UUID. Because your custom delegate class extends the base MeshDelegate, you have access to the scanResults instance variable right within your onScanFinished() method. In this method, you should choose one of the devices to connect to, then call the connectToDevice(index) function with the index of the result from the scanResults array. The recommend way to choose one is to iterate through the scanResults array and find the device with highest RSSI value. For some cases, such as during provisioning, you might want to present a list of the scan results to the user.

    Sending and Receiving Data

    What about using the application to send and receive data? Most of your application logic concerning receiving data back from the network will reside in the onNetworkPduReceived(networkPdu) method - this is where you will want to act on the payload opcode for the PDU. To send data, however, you will need to do the following:

    1. Instantiate a AccessPayload class with the opcode and parameters you wish to send (if no parameters, pass in an empty byte array).
    2. Create a new TransportAccessPDU, passing in the application key flag (true if you want to encrypt the packet with an application key, false to use the device key), MIC size (for almost all access messages, use MIC_SIZE_4), and the AccessPayload object you created in 1.
    3. Initialize a new NetworkPDU using the static method newInstance(networkManager, ctl, dst, transportPdu). 
    4. Get the segmented and encrypted PDUs by calling the static method ProxyPDU.sesgment(PROXY_TYPE_NETWORK_PDU, networkPdu).
    5. Finally, now that you have your segmented data you can send it to the device with networkManager.send(segmentedData).

    This is all most applications will require, but this library makes it easy to use more complex features like defining your own packet types and encryption schemes.

    Provisioning

    Provisioning new devices into the network is a little more involved since user input is required at some stages. The implementation is largely left up to the developer to figure out the best way to present the data to the user, and then to use callbacks to continue the provisioning process. For the example application created with this library, I chose to primarily use Menu2 and GenericPicker to present the information. Provisioning with the library requires the following steps:

    1. Scan and connect to the device with MODE_PROVISION as the argument to startScanning(mode). The InvitePDU is automatically sent to the device that was connected to.
    2. The first packet that is received in response is the CapabilitiesPDU. After this is received, the system will call the onProvisioningParamsRequested(capabilities) callback function in your custom MeshDelegate class. In this function you must call the ProvisioningManager.onProvisioningModeSelected(startPdu) method (use self.networkManager.provisioningManager from your custom MeshDelegate class). You can display a list of authentication options to the user, but note that not all modes have been implemented in the library yet. Check the docs for more information.
    3. If output OOB authentication mode was selected, you will need to get the output value from the user when the onAuthValueRequired() callback method is called. You should have some form of input from the user, then send that value back to the library by calling the ProvisioningManager.onAuthValueInput(authValue) method. This will continue the provisioning process.
    4. Finally, the provisioning will either fail and the onProvisioningFailed(reason) callback will be invoked, or provisioning will succeed with your application being notified through the onProvisioningComplete() callback. Either way, provisioning is over. You should probably call the self.disconnect() instance function of the base MeshDelegate class from here, because the device will no longer accept data from the Provisioning Data In characteristic. Reconnect to the network using startScanning(MODE_PROXY).
    5. Finally, while the device is provisioned, you likely still need to configure the device before it is useful. See the below instructions for doing so.

    Configuration

    The configuration process involves adding app keys to the device, as well as binding those keys to specific models. Optionally, you can configure subscription and publication addresses for those elements. Because configuration is largely dependent on each use case, the library only provides the necessary tools to craft your own configuration scheme. There is no special ConfigurationManager class to handle this because all of the configuration PDUs are regular TransportAccessPDUs - the only difference is that the packets must be encrypted with the device key, and not an application key. So, make sure to set the akf field to false when initializing new TransportAccessPDU variables!

    The library does provide some helper classes to piece together configuration data:

    • Get the AccessPayload for retrieving the composition data of the device using CompositionData.getCompositionData(). Use this AccessPayload object as described above in the Sending and Receiving Data section above.
    • When you receive the composition data back from the device, you can parse it using the CompositionData.decode static function.
    • To add an app key to the device, use the AccessPayload from AppKeyConfig.getAddAppKeyConfig().
    • For setting an element's publication or subscription status, use AppKeyConfig.getPublishAddConfig() or AppKeyConfig.getSubscribeAddConfig() to get the necessary AccessPayload objects.
    • The AppKeyConfig class contains some additional opcode constants that are useful when receiving and parsing the acknowledgements and status PDUs back from the device that is being configured.

    To send other configuration messages, you need to figure out the correct opcode and parameters from the Bluetooth Mesh Specification documents

    Conclusion

    Bluetooth mesh is a powerful new way of interfacing with IoT devices. With the Bluetooth mesh barrel you can integrate Bluetooth mesh features into your own Connect IQ applications. As this technology becomes more prevalent, we can't wait to see what amazing apps the community creates!

    • Oct 15, 2019
  • App Store Database Update Complete!

    The app store database update has been completed successfully. You should now be able to upload new apps and update existing apps without issue. Thank you for your patience while the maintenance was completed.

    • Oct 9, 2019
  • App Store Database Maintenance Update

    Due to issues discovered after the update we will be extending the app store maintenance. During this time, there will be no impact on Connect IQ end users, but developer app uploads and updates have been temporarily disabled. We will provide updates via this post on the progress. We are working to resolve this as quickly as possible so you can share your creations. Thank you for your patience as we work to get this resolved. 

    • Oct 8, 2019
  • App Store Database Maintenance

    We're in the process of doing some app store database maintenance, for which we've needed to temporarily disable app uploads and app updates:

    We expect to have things back to normal later today, and there should be no impact on typical Connect IQ users. Apologies for the inconvenience! 

    • Oct 8, 2019
  • SDK Release 3.1.5

    Hello,

    We've released SDK 3.1.5 which includes device support and version changes, as well as some minor updates. Here is a list of some of the changes and updates:

    General Changes

    • Add support for the MARQTm Adventurer and MARQTm Commander.
    • Update minimum firmware and supported connect IQ version for the vívoactive® 3 / music / LTE devices
    • Update minimum firmware and supported connect IQ version for the MARQTm and fēnix® series devices.
    • Fix MapTrackView.setMapVisibleArea to update the map everytime it is called.
    • Add new DeviceSettings API isGlanceModeEnabled to determine if widget glances are enabled.

    Simulator Changes

    • Fix issue that prevented WiFi/LTE connection info from being provided on devices that did not have audio content provider app support.
    • Fix a few simulator crashes that can occur when pairing BLE sensors.
    • Fix incorrect data field layouts for the GPSMAP® 66 and 86 devices.
    • Fix issue with fēnix® 6 series fonts being slightly different from device.
    • Fix incorrect supported connect IQ API version listed for the vívoactive® 4 / 4s and VenuTm.

    Compiler Changes

    • Fix a crash that can occur in when compiling an animation from a GIF with frame delays set to 0.
    • Fix the app memory limit check for background / glance apps, which should not be checked when a device does not support the app type.
    • Oct 3, 2019
  • SDK Release 3.1.4

    Hello,

    We've released SDK 3.1.4 which includes a few bug fixes and some minor updates. Here is a list of some of the things we've done:

    General Changes

    • No Changes

    Simulator Changes

    • Add support for showing the current screen position of the cursor in the status bar.
    • Fix a font selection bug in simple data fields where a text font would be chosen if a number contained a minus sign.
    • Fix a bug on mac where the simulator would crash if you completed a 24-hour screen burn-in simulation.
    • Fix a bug where memory limits were not set correctly for widget glances.
    • Fix an issue that onLayout isn’t invoked for data fields, also disabled the Force onHide menu when running a data field, as onHide will never be invoked for it.

    Compiler Changes

    • Fix null pointer exception seen when using automatic build with a project using antialiased custom fonts.
    • Sep 18, 2019
  • Connect IQ 3.1 Now Available!

    At long last Connect IQ 3.1 is here! Here are some of the new features it brings to the table:

    • Exception Reporting: Access crash logs from the field and fix issues faster
    • Animations: Use the new Monkey Motion tool to add animated clips to your apps
    • Bluetooth Low Energy: Write apps that communicate with Bluetooth Low Energy (BLE) peripherals 
    • Relative Positions in Layouts: Use percentages in layouts for coordinates to make layouts that scale across a range of products
    • Expanded Storage: Store more information on device. 
    • Wi-Fi in Device Apps: Use the new Communications.SyncDelegate to download content over Wi-Fi
    • ANT+ Manufacturer Pages: Access manufacturer pages of connected ANT+ peripherals

    You may have noticed we also launched some products the past few weeks. I’d like to take a moment to talk you through some of the products and new features.

    vívoactive® 4/4S – The vívoactive 4 and 4S are the natural continuation of the vívoactive line. There are two sizes (small and regular) both of which have the latest Elevate sensors and support music. The one button version has been updated to have two buttons on the right side; one for start/stop and another for back.

    fēnix® 6S/6 – The fēnix 6s/6 are successors to the fēnix 5 series. There are two sizes (small and regular) with the latest Elevate sensors.

    fēnix 6S/6/6X Pro – The fēnix 6s/6/6X Pro are successors to the fēnix 5 Plus series. There are three sizes (small, regular, and ShaqTm) with the latest Elevate sensors and all support music. The 6X Pro Solar adds a solar cell to allow charging while operating outside.

    Venu – The Venu is a new variant of the vívoactive 4. In addition to the latest Elevate sensors and music, the Venu is the first Garmin wearable to feature an AMOLED screen. This is the most beautiful screen ever on a Garmin watch but introduces new considerations for your apps.

    Legacy Series – These are vívoactive 4 and 4s units branded with Marvel content. For all intents and purposes consider them vívoactive 4 and 4s units.

    Here is a technical breakdown of the devices:

    Feature

    vívoactive 4S

    vívoactive 4

    fēnix 6S

    fēnix 6S Pro

    fēnix 6

    fēnix 6 Pro

    fēnix 6X Pro

    Venu

    Screen

    MIP

    MIP

    MIP

    MIP

    MIP

    MIP

    MIP

    AMOLED

    Resolution

    218x218

    260x260

    240x240

    240x240

    260x260

    260x260

    280x280

    390x390

    Icon

    36x36

    43x43

    40x40

    40x40

    40x40

    40x40

    40x40

    40x40

    Colors

    64

    64

    64

    64

    64

    64

    64

    16 BPP

    Music

    Yes

    Yes

    No

     Yes

    No

    Yes

    Yes

    Yes

    Maps

    No

    No

    No

    Yes

    No

    Yes

    Yes

    No

    Inputs

    Touchscreen

    Touchscreen

    Buttons

    Buttons

    Buttons

    Buttons

    Buttons

    Touchscreen

    Widget Glances

    No

    No

    Yes

    Yes

    Yes

    Yes

    Yes

    No

    Watch Face RAM

    96K

    96K

    96 KB

    96K

    96 KB

    96K

    96K

    512 KB

    Data Field RAM

    32 KB

    32 KB

    32 KB

    128 KB

    32 KB

    128 KB

    128 KB

    32 KB

    Widget RAM

    512 KB

    512 KB

    64 KB

    1 MB

    64 KB

    1 MB

    1 MB

    512 KB

    App RAM

    1 MB

    1 MB

    128 KB

    1.25 MB

    128 KB

    1.25 MB

    1.25 MB

    1 MB

    Music RAM

    512 KB

    512 KB

    N/A

    512 KB

    N/A

    512 KB

    512 KB

    512 KB

    Glance RAM

    N/A

    N/A

    32 KB

    64 KB

    32 KB

    64 KB

    64 KB

    N/A

    Background RAM

    64 KB

    32 KB

    32 KB

    32 KB

    32 KB

    32 KB

    32 KB

    64 KB

    The fēnix 6 and Venu introduce some features we did not cover at Connect IQ summit that are only available in the 3.1 SDK. Lets talk about them briefly.

    Widget Glances

    The fēnix 6 series introduces some changes for widgets that will permeate across the Connect IQ ecosystem. The widget loop is converting from a carousel to a list presentation, which will make it much faster for users to navigate their information. When the user clicks on your glance, it will launch into the foreground.

    To support this new behavior, CIQ is introducing in 3.1 a new glance background type that allows your widget to update its glance presentation behind the scenes.

    1. Implement getGlanceView in your Application.AppBase instance
    2. Implement an instance of GlanceView that renders the base view
    3. Adapt your first page on Fenix 6 products to be the click in page instead of the base page.

    AMOLED

    The Venu is the first Garmin watch with an AMOLED screen. Your apps now can have breathtaking presentations of information and gorgeous imagery, while still retaining days of battery life. However, now that we have given you all these gorgeous colors, could you, like, not use them?

    Please?

    Here is the challenge with AMOLED – every pixel draws power. If you want your apps to fall within the regular amount of battery life, you want to have as much black on screen as possible, especially in screens that are showing activity information. You’ll notice that with most of the native applications, black is the new black. It’s okay to work a periodic splash screen or gradient into your apps – make the app look great! – but for screens that are supposed to show constantly updating data, the blacker the better. Also, if you have header and footer gradients, try to have the darker parts at the outer edges.

    Just remember this handy guide when doing app layouts for Venu:

    AMOLED Always On Watch Faces

    Always On watch faces behave differently from MIP to AMOLED. With MIP screens, you can use View.onPartialUpdate to update a portion of the screen every second. With AMOLED screen, this is no longer allowed. Instead, when WatchUi.onEnterSleep is called, you are allowed to render a watch face that must obey the rules of the AMOLED burn-in
    protector:

    • No more than 10% screen pixels can be on
    • No pixel can be on longer than 3 mins

    Ways you can prevent burn in are by drawing the time with a thin font, shifting the time every minute as not to repeatedly leave the same pixels on, and not having static tick marks that leave the same pixels on.

    Note that watch faces can detect whether a product has screen protection enforced by checking the value of DeviceSettings.requiresBurnInProtection.

    Note about AMOLED Resources

    The default color depth for the Venu is 16 bits per pixel, similar to Edge products. If you do not use the <palette> option when importing resources, be aware that your images will grow in file size, and by proxy take a lot longer to download to the device. You can also add the attribute compress="true" to your image resources, with the trade offs that images may take longer to load and compression is not available on Connect IQ 1.x products.

    Start Today

    New Features. Better Tools. New Devices. Get the SDK today and make your apps dance and sing. 

    • Sep 9, 2019
  • Garmin Connect iOS App Settings FIXED in 4.22.2 Hotfix Release

    Hello Developers and Users,

    I'm happy to announce that we were able to get the iOS settings bug fixed in a hotfix release of the Garmin Connect App! This is great news for a few reasons. One, because settings are fixed. Two, because our users are happy and will stop emailing all of us! And finally, because we did it! We worked together and we were able to get things fixed quicker than our normal schedule. Just more proof that Connect IQ is indeed an important and growing piece in the larger Garmin ecosystem. So give yourselves a pat on the back and celebrate! Slight smile

    -The Connect IQ Team

    • Sep 5, 2019
  • Garmin Connect iOS App Settings Broken in 4.22 Release

    Hello Developers and Users,

     

    As many of you know by now, there were some changes that made their way into the Garmin Connect App on iOS that have caused a break in app settings. We were made aware of this issue and reported it immediately. Despite our best efforts to get the necessary changes made before the launch of 4.22, the bug continues to persist. For that, we are sorry. We understand that, not only does that break functionality for a specific set of our common users, it also generates quite a bit of email traffic for you as well.

     

    We've done two things here to help mitigate this:

     

    First, this forum post acknowledging and addressing the issue through an official Garmin source.

     

    Second, we've communicated with our product support teams that this app settings issue on iOS is not an issue that can be addressed by you, our external developer community. In such, they have been instructed to advise customer complaints to utilize the Connect IQ Store App for iOS for settings changes and that there is no need to contact you, the developer, as this is an issue on the Garmin side of things. Users may need to uninstall and reinstall their affected CIQ content before using the Connect IQ Store App in order to remove a corrupted settings file. Our Product Support agents know to communicate this as well.

     

    Our goal is to have this issue resolved within 1 release cycle or sooner. We can't guarantee a fix before the next normal release, but we will continue to push for greater priority.

    Thank you for you patience and understanding,

    -The Connect IQ Team

    • Aug 27, 2019