Fuse Pico Fundamentals
Before you try to understand the structure of the picos that make up the Fuse system, you should be sure you understand the basic information about picos in the background information.
Conceptual
The conceptual pico structure for Fuse appears in the following diagram. An owner has a fleet which has zero or more vehicles.
Each vehicle pico is responsible for receiving, storing, processing, and serving that data about the vehicle it represents.
The fleet pico manages vehicle picos and creates a fleet-level view of data from the vehicles.
Microservices
You should review Fuse as a Microservice Architecture to understand how individual picos can be seen as a collection of microservices. Understanding the microservice architecture of picos in the Fuse system is critical to being able to program services for Fuse.
Fuse Accounts and Provisioning
To make working with the Fuse API easier, we've created an account system that manages the following tasks:
- Creating an initial Fuse account. This also creates the owner pico and bootstraps it with needed rulesets.
- Creating a Fleet pico when the owner account is created.
- Linking the fleet pico with Carvoyant. This may involve creating a Carvoyant account
- Adding and deleting vehicles and ensuring that vehicles in Fuse are properly represented in Carvoyant.
All of the activities performed by the account provisioning system are available as part of the Fuse API and the accompanying JavaScript SDK. You can review the details of the account provision system in the GitHub repository for the Joinfuse.com site (where the account provisioning system lives.
Understanding OAuth in Fuse
Fuse accounts can be accessed using OAuth and that is the preferred method. Functions in the SDK help build OAuth URLs for accessing Fuse. The JavaScript SDK also includes a login()
function that can be used to login with user name and password. Use of direct login is discouraged except for mobile apps that don't store the username and password.
Fuse also uses OAuth to access the Carvoyant system. Because of the nature of OAuth, this requires that every Fuse user create a Carvoyant account and then link (using OAuth) their Fuse account to their Carvoyant account. A large part of the code in the vehicle and fleet picos is aimed at managing that relationship.
Fuse Subscriptions to Carvoyant Events
Carvoyant processes the signals from the OBD II device in the car and raises a number of events to the Fuse system. The way Fuse tells Carvoyant what events it wants to see is through a process that Carvoyant calls "subscription"). Don't confuse the subscriptions that the vehicle picos make to the Carvoyant system with the subscriptions that Fuse picos have amongst themselves. Here's the documentation for the Carvoyant Subscription API.
When Fuse creates or updates a vehicle, it creates four subscriptions to Carvoyant events:
ignitionStatus
: the vehicle ignition is turned on or offlowBattery
: the vehicle battery level drops below 12V (hard set by Carvoyant)troubleCode
: the vehicle has a new diagnostic codefuellevel
: the vehicle fuel level drops below 20%
Each Fuse vehicle receives an event from Carvoyant when any of these things occur.
There are many other events that Carvoyant can raise. Subscriptions to these can be made through the Fuse API.