Kinoma Studio for Linux Preview Release Notes (Version 1.3.37.1)

Jared Kaplan
  

Jared Kaplan

February 22, 2015

Welcome to the Kinoma Studio for Linux Preview. This is the first public release of Kinoma Studio on Linux. As much as possible, it shares the same capabilities as Kinoma Studio on Mac OS X and Windows. The great diversity of Linux distributions and configurations makes it impossible for us to verify Kinoma Studio for Linux on every system.

kinoma_studio_logo-high_contrast

We are providing this preview release so that you can try it on your system and share the results with us. We want to hear the good news (it works!) along with the problems you run into. Let us know on the Kinoma Studio section of the Kinoma Forum. The engineers and test team responsible for Kinoma Studio will respond to you there.

Read on for more details on Linux distributions that we have successfully tested Kinoma Studio for Linux on, and installation instructions.

Compatibility

Kinoma Studio has been tested and is known to work on:
* Ubuntu 14.04
* Debian 7.6
* Fedora 20

Kinoma Studio is available for 32 bit and 64 bit versions of Linux.

Preparing your system

Kinoma Studio requires Java. It runs best on Oracle Java 8; it also runs on Oracle Java 7. Install the 32 or 64 bit version of Java depending on whether you installed the 32 or 64 bit version of Kinoma Studio. Java can be installed using your package manager, or by following these instructions.

The Kinoma simulator requires 32 bit libraries to be installed when run on 64 bit Linux. The following commands install the necessary packages on Ubuntu 14.04:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libstdc++6:i386 libasound2:i386 libgtk-3-0:i386 libcanberra-gtk3-module:i386 gtk3-engines-unico:i386 unity-gtk3-module:i386

Installing WebKit is strongly recommended: it is required to access example code and documentation within Kinoma Studio. The following command installs WebKit for Ubuntu 14.04:

sudo apt-get install libwebkitgtk-1.0-0

Installing Kinoma Studio for Linux

To install Kinoma Studio, extract the downloaded archive to a directory on your computer. Kinoma Studio cannot be run directly from the archive, or from a directory that does not have write permissions.

Known issues

When the Kinoma Create Simulator launches, portions of the display area are sometimes missing. This can be fixed by resizing the Simulator window.

Kinoma Studio for Linux does not have a custom application icon.


Using the MaxBotix MB1010 Ultrasonic Rangefinder with Kinoma Create

Brian Friedkin
  

Brian Friedkin

February 20, 2015

Greetings fellow Creators! My name is Brian Friedkin and I spend most of my time under the hood working on the Kinoma Create frameworks and built-in apps. On the Kinoma Create home screen, the built-in Wi-Fi, Logs, Files and Samples apps are a few of my contributions.

Software design validation

As a software engineer, I spend a good chunk of time writing code. Generally speaking, software engineers tend to spend nearly most of their time focused on designing, writing, testing and fixing their code. When the product is complete we move on and repeat the cycle. Unfortunately, sometimes we lose sight of why we work so diligently. Thankfully the Kinoma team is passionate about building great products and we spend a lot of time validating our designs. As a member of the development staff, I wanted to take the opportunity to step back, use our tools, platform and product as you would and share my experience.

A decades-long love of hardware tinkering

Back in my early days I tinkered as an electronics hobbyist, designing circuits, etching my own boards (!) and building many kits. In fact, the Heathkit clock I built over 30 years ago still works and sits on my bedside table…

MB1010 1

But that’s ancient history and we should fast-forward to modern times…

Sensor sample apps and BLLs

I wanted to build a collection of sensor sample apps and BLLs, so I bought a handful of different sensors from SparkFun. I settled on the MaxBotix MB1010 Ultrasonic Rangefinder to start. The sensor provides range readings in inches and supports a variety of outputs, including PWM, serial and analog. I chose the analog output since the interface is trivial. We have many analog sample apps to draw from on GitHub.

Before writing any code I used the Front Pins app to configure the power, ground and analog pins.  The sensor is mounted on the right side front facing header:mb1010-illustration

Once I had the pins configured, I held my hand over the sensor and used Pin Explorer to check the analog output values. I was surprised to see what appeared to be a flat line corresponding to the range reading.

MB1010 2

Not exactly what I expected, so I took a peek at the data sheet and found that the sensor delivers 0.009766V per inch when powered at 5V. Hence the analog voltage output at close range is very small. Furthermore, the sensor detects objects closer than six inches range as six inches. Positioning the sensor further away from a wall yielded the expected results and the analog output voltage increased as I walked away from the wall.

MB1010 3

After confirming the sensor output with Pin Explorer, I wrote the BLL. Sensor manufacturers often provide tutorials and application notes and I found a good tutorial on the MaxSonar family of sensors. Kinoma Create’s A2D pins return the measured voltage as a floating-point value between 0 and 1. So the BLL simply needs to read the A2D value, map that value from [0, 1] back to the original analog reading and then convert to inches. Here’s what that looks like in the KinomaJS BLL:

exports.pins = {
    range: {type: "A2D", supplyVoltage: 5.0, voltsPerInch: 0.009766}
};

exports.configure = function(configuration) {
    this.voltsPerInch = configuration.pins.range.voltsPerInch;
    this.supplyVoltage = configuration.pins.range.supplyVoltage;
    this.range.init();
}

exports.read = function() {
    var measured = this.range.read();
    var range = (measured * this.supplyVoltage) / this.voltsPerInch;
    return range;
}

 

The value returned from the read function corresponds to the range reading in inches.

With the BLL written, I built a simple test app to verify the range readings before building the UI. I wanted to capture the readings for review, so I used the built-in Logs app and K4.log function to write the readings to a log file. The test app issued a repeating read command once per second and logs the reading:

application.invoke(new MessageWithObject("pins:/MB1010/read?repeat=on&callback=/range&interval=1000"));

Handler.bind("/range", {
	onInvoke: function(handler, message) {
        var range = message.requestObject;
        K4.log("MB1010", "Range: " + range.toFixed(2));
	}
});

 

While I ran the app I stepped further and further away from the wall. I then examined the log file and confirmed that the range readings increased.

MB1010 6

With the sensor integration working as expected, I set off to work on the sample app. I’ve written many of our sample apps and I strive to keep each sample small and focused. That way developers can quickly find the resources they need. That said, I sometimes try to make the sample apps visually interesting to take advantage of the Kinoma Create display. Plus building simple prototype user interfaces with KPR is easy. ☺

The rangefinder is kind of like a digital tape measure. As a nod to that reference I built an interface that quotes a tape measure. I used the pixlr online editor to snag the yellow color from a tape measure photo. The app displays the range reading in large black numbers over the yellow background. Lastly I render a gratuitous row of tick marks along the top screen edge to balance the layout. The tick marks are implemented using the KPR Canvas API. KPR Canvas caches its bitmaps so the tick marks are only rendered once on launch.

MB1010 7

Of course it doesn’t make much sense to have both the sensor and screen facing forward, because you have to take measurements facing backwards. So I used some painter’s tape to mount the sensor on the back of the Kinoma Create.

Here’s the final prototype:

MB1010 8

Experiencing Kinoma Create as our developers do

It was fun to “switch sides” and experience our platform through the eyes of our developers. I hope you enjoyed this short walk through and I look forward to sharing more sample apps down the road. All the sample apps, including the MB1010 rangefinder, can be found on GitHub.

 

Brian Friedkin is a Principal Software Engineer in the Kinoma group at Marvell, working on a variety of projects and supporting the forum as BrianKinoma. Before joining Marvell, Brian was a co-founder of Kinoma Inc., which was acquired by Marvell in 2010. As a Principal Engineer at Apple, Brian was a member of the small engineering team that brought QuickTime to Windows. Brian has created consumer-level multi-platform applications, and embedded real-time software, for key industry players including Palm, SONY, Seiko Instruments and HP.


Valentine’s Day Love for Kinoma Developers

Peter Hoddie
  

Peter Hoddie

February 14, 2015

The Kinoma team is always working on ways to help developers, and has recently published some useful new information.

Two great articles on KinomaJS programming

Our User Experience Architect, Dr. Andy Carle, is teaching the Introduction to Human Computer Interaction course at UC Berkeley this semester (CS160). To get students started on KinomaJS, Andy is writing tutorials on various KinomaJS topics. They’re loaded with step-by-step examples, including sample code, screen captures, and details on how to get around in Kinoma Studio. Even experienced KinomaJS developers can learn some new tricks from these articles. We’ve turned the first two into Tech Notes.

His first article, “Mobile Apps in Kinoma Studio,” teaches the fundamentals of KinomaJS application development. The article addresses how to work with many different UI elements in the MobileFramework, Creations, and Controls modules—including labels, grids, buttons, checkboxes, radio buttons, sliders, switches, and fields. It also covers how to use themes, skins, and styles. The code uses templates—which are a relatively new and still underutilized capability of KinomaJS—making it very straightforward to create reusable UI components. Some of the first apps the students built based on this material were great fun.

kinomaMobileApps

Andy’s second Tech Note is “Asynchronous Communication in KinomaJS,” which details the messaging system. KinomaJS uses messages for all kinds of critical purposes including HTTP requests, hardware pin programming, and communication between application modules. A good understanding of messaging is essential to successful KinomaJS programming. This article shows you how to use messages, in particular how to apply results of a message response to the UI of your application.

AsynchronousCommunicationKinomaJS

Command line development for Kinoma Create

We wanted KinomaJS development to be accessible to all developers. That’s why we built Kinoma Studio. Many developers prefer to have an IDE rather than have to work from the command line. But there is another group of developers, really good developers, who can’t imagine developing without command line tools. For those developers, we’ve put together kct, Kinoma Create Command Line Tool. This command line tool lets you build, install, launch, and stop KinomaJS apps on Kinoma Create and the Kinoma Create simulator. kct is supported on the same platforms where Kinoma Studio runs: Macintosh and Windows today, with Linux just around the corner (see below!).

Patrick Soquet, our Kinoma Software Architect, has written step-by-step instructions on building and using kct. You can download the sources code to the tool from our GitHub page. As you would expect, kct itself is written in JavaScript.

kct-notes-logo

Even more sample code

The only thing better than really good technical documentation? Working sample code that shows how to do exactly what you need to do. One of our most prolific developers of sample code is Brian Friedkin. He’s posted three more samples this week, each showing how to work with a specific piece of hardware.

1. analog-trimpot uses a classic potentiometer readily available from SparkFun. These knobs are simple to build into your projects. Brian shows you how to hook it up to control the volume level of a video playing on your Kinoma Create.SparkFun CDN smalleranalog-trimpot-example

 

2. analog-HIH4030 uses the Honeywell humidity sensor and Texas Instruments TMP102 temperature sensor to create a simple environmental conditions display. The example shows how to chain together messages to retrieve synchronized sensor readings—an advanced use of KPR messages going beyond the introduction in Andy’s great article on Asynchronous Communication.analog-HIH4030-exampleSparkFun humidity sensor

3. serial-7segment-display uses a retro style 7-segment LED display from SparkFun. The example shows how to control the display using a serial connection and how to use the built-in keyboard to enter text to display on the LCD display.

serial-7segment-display-example

SparkFun part dislay

Now, I know what you are thinking, “These sound really cool, and I want to run them now, but I don’t have the hardware components.” Here’s the cool thing: each of these samples includes a hardware simulator. You can run them on your computer using Kinoma Studio right now. You can modify the app or use the BLL to build your own. If you order the components today, by the time they arrive, you’ll have your project coded and working.

Make your own Hardware Pins Simulators

Using Pin Simulators is a great way to get experience using a hardware component without having the physical object. Someone has to write those pin simulators. Most of them have come from the Kinoma team. Did you know you can create your own, too? They are just JavaScript modules. The simplest pin simulator can be coded in a few minutes using the built-in data driven simulators. If you want to build a custom simulator, you can do that using the usual KinomaJS user interface programming tools.

Many of our pin simulators were created by Sean Allen, who also happens to be the programmer behind Pin Explorer. Sean has put together a tutorial that walks you through how to build both data driven and customer simulators, complete with exercises at the end to test your new skills. Check out his article in the Kinoma Tech Notes.

pins-simulator

Kinoma Studio for Linux

The biggest project we’re working on is support for developing on Linux. Many of our developers have reminded us that Kinoma Create is a Linux device, so it makes perfect sense to develop for it using Linux. We agree. This coming Friday February 20th, we’ll post the first preview release of Kinoma Studio for Linux. The Linux version includes all the same capabilities as the Mac and Windows versions, including the Kinoma Create simulator. We’ve focused our development and testing on recent versions of Ubuntu. We’ll provide detailed compatibility notes with the preview release. We are looking forward to your help trying out the preview release on your Linux system, so we can shake out the compatibly issues. There are so many variations of Linux that we can’t do this ourselves, so we are happy to have the support of our community.

Moving forward, our plan is to release Kinoma Studio for Linux builds at the same time we post new builds for Macintosh and Window.

linux-studio

Kinoma Forums

If you’re developing with KinomaJS for Kinoma Create or mobile apps, you should be a regular visitor to the Kinoma Forums. That’s the best place to ask questions and share your knowledge. There’s a growing body of great information and practical experience there. In recent weeks, the forums have been buzzing with questions from the Berkeley CS160 students, especially in the days before their next assignment is due. If you are just getting started with KinomaJS, the struggles and successes of these students are a powerful learning tool.

And a BIG thank you to Will Dimmit, an early Kinoma Create developer, for the many answers he has posted in response to questions on the Kinoma Forum. He is generously sharing his expertise and experience developing with KinomaJS to benefit the community. Check out his forum posts for all kinds of good tips.


Kinoma Create at MIT’s “WiFi and the Internet of Things: a hands-on workshop”

Basuke Suzuki
  

Basuke Suzuki

February 9, 2015

Wi-Fi and the IoT at MIT

It was an honor to speak at MIT’s “WiFi and the Internet of Things: a hands-on workshop,” alongside Mark Easley of Texas Instruments’ LaunchPad team, and  Christopher Rezendes who runs IoT advisory firm INEX Advisors. I was tapped to introduce CoAP, cover the fundamentals of this new protocol, and address if CoAP can be considered “Fast & light HTTP for IoT.”

mit_logo

The session started off with an overview of IoT hardware and software, and standards of Wi-Fi for wireless transmission of data. We reviewed how Wi-Fi compares to other wireless technologies, especially in the context of the IoT. As expected, security, privacy, and encryption with wireless technologies were also discussed.

CoAP

In introducing CoAP, I kept in mind that the student attending this workshop were interested in the theoretical aspects of the protocol, as well as real world applications. It’s so satisfying to present to a group that very likely have incorporated the lesson directly into their studies, research programs, and entrepreneurial crowdfunding projects.

Basuke at MIT PicFrame

The whole talk was recorded live and is available for replay:

If you’re interested in just the slides I presented, you can view them here:

Hands-on to hackathon

Attendees then participated in a group project to develop a wireless, multiplayer game that runs over Wi-Fi. That session concluded with a “Hackathon” to explore the limits and applications of Wi-Fi, CoAP, and emerging IoT hardware and software.

The people you meet at MIT

As happens when at MIT, this event gave me the opportunity to meet some true luminaries in computing, including David Reed, the designer of UDP. CoAP is implemented on top of UDP, so it was especially cool to have him there for this talk.

Prior to heading to Cambridge, I happened to record a quick video of two Kinoma Create devices communicating with each other using the UDP-based IoT protocol.

I also got to meet Bob Frankston, co-creator with Dan Bricklin of VisiCalc, and Fellow of the Computer History Museum.

Basuke and Bob Frankston

Our host for this event was Brian DeLacey, whose skills at organizing fascinating technology events traces back to his work with the Boston Computer Society’s Mac user group.

Brian DeLacey cropped

Second MIT visit for the Kinoma team

This session that I participated in complements the “Internet of Things: Connecting Anything and Everything to the Internet, a Hands-on Workshop” Peter Hoddie reported on earlier.

MIT, round three

The Kinoma team’s next visit out to MIT will be for Make:MIT, a hardware hackathon promoting innovation that is geared towards those who are excited and passionate about designing and building. We’re a top sponsor of this upcoming event, and we hope to see you there!

 

Basuke Suzuki is a professional software designer and programmer. Currently, Basuke designs and codes the network protocol layer of Kinoma Create, Marvell Semiconductor’s JavaScript-powered IoT construction kit. He has developed independent implementations of the MQTT, WebSockets, and CoAP network protocols, both clients and servers. Basuke’s experience implementing these, as well as extensive experience using HTTP, gives him strong insight into selecting the optimal protocol for a given application. Basuke has been working with end-user and server-side applications since 1991, and has continued to pursue his craft and passion through his work, as well as involvement in the programming community. Basuke is involved in MOSA, a well-regarded and active organization providing support to Macintosh software developers throughout Japan. He has delivered several talks to this organization, including addressing topics of “Unit Test with Xcode,” and “How to Develop a Good Location Aware iPhone App.” He authored a book on the Apple Newton, as well as articles on QuickTime and Mac OS X.


Kinoma Create webinar 3 – Hardware Pins Simulators

Sean Allen
  

Sean Allen

January 23, 2015

Please join us for a Kinoma Create webinar on Hardware Pins Simulators Friday, January 30, from 1–1:30pm PST!

Click here for the date and time in your time zone.

pin-simulator-screenshot

About Hardware Pins Simulators

With the Kinoma Create Simulator, you can develop and debug the application for your project entirely on a computer. But how do you write the application code for the hardware components (sensors, lights, buttons, and servos) plugged into your Kinoma Create when running the simulator on your computer?

With Hardware Pins Simulators, of course! They provide an accurate simulation of hardware components by emulating the API calls of your BLL. That way, your same application code runs unchanged on both Kinoma Create hardware and the Kinoma Create Simulator.

Hardware Pins Simulators are a powerful tool for accelerating your project’s development. Not only do they speed development and debugging, but you can start building your application software before you have the hardware components.

There are many Hardware Pin Simulators available already and you can build your own, often in just a few minutes.

During this webinar we will:

  • Show several examples of Pins Simulators in use by existing sample applications.
  • Discuss Pins Simulators API’s and their two flavors: Data Driven and Custom.
  • Get our hands dirty by actually coding and deploying one of each type.
  • Explain the complementary relationship between the Pins Simulators and Pin Explorer debugging tools.