Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: (Classic)

...

 

Info
titleFeedback Welcome

We're constantly working to improve our documentation and developer experience, should you have any feedback, questions, or concerns, please feel free to contact us.

 

Setting Up Your Personal Cloud on SquareTag.com

If you don't already have a SquareTag Account, the first step to developing an CloudOS application is creating an account and configuring your new cloud. Just visit https://squaretag.com and look for the "Signup" link in the upper-right hand corner of the page:

...

Congrats! Your cloud is now setup for CloudOS application development and you've installed the tools you need to make awesome apps! Lets take a look at writing your very first app.

Writing Your First App

Alright, lets look at what it takes to write a "Hello World" CloudOS application.  Open a new file called HelloWorld.krl in your favorite editor and paste the following template in: 

...

These are actions are defined within the SquareTag and CloudRain modules. Note that we have not yet imported these modules. Let's go import those modules now.

Importing the CloudRain and SquareTag modules

KRL modules can be defined and imported into other rulesets. A module is literally just a ruleset that provides functions and actions for you to use. See the Modules page for more info on modules. We have two modules that we are trying to use (CloudRain and SquareTag) that have not been imported yet. To import these two modules, add the following two lines into the meta block:

...

Awesome! This app is now ready to be tested. Lets look at registering, installing, and running this app.

Installing and Running Your App

Alright, so we have a ready-to-go file named HelloWorld.krl. How do we tell CloudOS about it so it can run it for us? We use the Kynetx Developer Kit!

...

The second follows from the fact that every user has their own instance of a pico with it's own data, applications, and addresses (we call them channels). So any user that wants to run an application has to install it, after it's been registered. 

Registering the App

First, open up the Kynetx Developer Kit (KDK, for short), and click "List Rulesets.":

...

After entering your source code URL, click "Register Ruleset." If it was successfully registered, you'll be redirected to a list of your registered rulesets. It should look something like this (with a different value for RID and Source URL of course):

Installing the App

Now CloudOS now knows about our ruleset, we just have to add this ruleset as a developer application, and we're good to go. You'll need to know the ruleset ID (RID) of the ruleset you just created in order to install it in the following steps, so take a minute to copy it to the clipboard or write it down. 

...

If you don't see this, check the preceding steps. The information on debugging KRL rulesets might also be helpful

Next Steps

Writing apps for SquareTag involves a lot of new concepts. The following will help you understand SquareTag Development better:

...

  • Build your own echo server to understand the event protocol. 
  • Try using an external API in your app
  • Try linking Dropbox to your app. 
The KRL cookbook has other projects you can try. 

...