Entries related to technology.

Programming in Tizen for the Samsung Gears 2 Smartwatch

A month or so ago, I got a Samsung Gears 2 watch. I was very excited to start programming for it, but have been too busy to really explore it, so I’ve been doing a little bit, here and there and finally have time to write a little bit about.


First, a little background. I was pretty excited to see a watch running Tizen. One of previous cellphones was the Nokia N900, which ran a version of Linux called Maemo. I liked programming for Maemo and the Nokia N900. But Maemo was merged into MeeGo and my old N900 started falling apart so my Linux on mobile devices programming subsided as I became more involved in my current job.

Part of the reason I like open source development for mobile devices is that, in theory, it should lower the bar to entry making such programming more accessible. I’m not sure how well this has really worked out in practice, however, the community of Maemo developers was pretty good at it.

Unfortunately, Tizen on the Samsung Gears 2 Smartwatch really hasn’t developed a good open source community yet, as far as I can tell, and the documentation seems to me to be a bit obtuse. So, with that, let me share some of my experiences getting going programming the Gears 2 Smartwatch.

Installing the SDK

The first big caveat, I’m running on a Windows 8 based laptop. This presents plenty of additional challenges, but if I can get it running on this box, it should be possible to get it running a lot of places.

First step was to install Java. In theory, this should be nice and easy. However, these days, there are more and more different choices for flavors of Java. I installed Java SE Development Kit 8u5 - Windows x64.

I also downloaded the Tizen SDK. I wasn’t sure if I needed the Tizen SDK, the Tizen SDK for Wearable 1.0.0b1, and/or other parts. It now looks like all I really needed was the SDK for Wearable, but it doesn’t hurt to have both.

The next issue I ran into was that the install failed. Apparently, this is not a unique problem. There is a blog post about Installing Tizen SDK 2.0 on Windows 8 64 bit. After the install fails, the install manager is left in the f AppData\Local\Temp\tizensdk directory. In that directory, run javaw -jar InstallManager.jar, and you should be good to go.

At least, that worked for the Tizen SDK. However, when trying to run the Tizen SDK for Wearable, even that presented problems. I kept getting the error, “Cannot find repository http://”

I read through the Tizen forum Can't install Tizen Sdk for Wearable because of "Cannot find repository." There was a lot of discussion about HAXM, which I’ll get to later.

The comment at the bottom gave the working answer. How to install Tizen SDK for Wearable (Samsung Gear). You need to download the SDK image from the same place you downloaded the install manager, and then enter the location of the SDK image in the advanced options of the SDK Install Manager.

Installing HAXM

The installation of the Intel Hardware Accelerated Execution Manager went amazingly simply, especially given the problems installing the SDK.

However, I ran into one problem. The virtualization technology needed to be turned on in BIOS. To make things more complicated, my hard disk is encrypted so I don’t have a standard bootup process. The bootup also was set to boot without waiting for people to change BIOS settings, so it was a challenge to get the BIOS changed. I’m running an HP ENVY 15, and activating vt-x from bios gave me the information I needed, when I managed to hit the F10 quickly enough on Startup.

Learning the architecture

Being the old command line Linux programmer, I figured I should be able to connect into the Linux box (in this case the watch), bring up a shell prompt, and start developing. I’m also used to working with Google Glass which connects to the Internet via Wifi or Bluetooth tethering. With my Nokia N900, it would connect to the Internet, and then I could connect to the phone over the internet using Secure Shell, or even set up a web server on my phone. I was hoping to do something similar with the Samsung Gears 2 watch.

However, it appears as if the Gears 2 Watch is set up a bit differently. It communications with a Samsung Smartphone over Bluetooth, but does not use TCP/IP. The advantage of this is that you don’t need a special plan from your cellphone provider that permits Bluetooth tethering. However, it does significantly limit what you can do. I suspect someone will find a work around for this soon enough.

To deal with this the Gears 2 architecture is set up to run in a bunch of different modes, with applications running standalone on the watch, or communicating with an app on the phone. I have not dug deep enough to find if there is a decent generic proxy app for Gears 2, but I’m dubious. You can read more about the architecture here.

Starting the Emulator

The development environment is Eclipse. I started Eclipse from the \tizen-wearable-sdk\ide directory and started poking around. However, I couldn’t get the Gears 2 to show up and I had problems with the emulator.

While it should seem obvious how to set up the emulator, I scratched my head about it for a bit. So, the quick cheat sheet. In Eclipse, in the connection explorer in the lower left, click on the first icon entitled Emulation Manager. When the manager starts, click on Add New to create a new emulator. In the details on the right, enter the name of the emulator. I’ve created Test1 and Test2 using the defaults for all the other values. Click on Confirm at the bottom of that box.

Also, be sure you are doing this from the wearable-sdk. Otherwise, you’ll be setting up emulators for Tizen based smartphones.

Once you have your emulator created, click on the play button at the bottom of the emulator. This gets to wear I’ve run into different issues. I’ve tried launching the emulator manager multiple times and Eclipse complains that it is already running. Yet nothing show up in the list of available connections.

When I’ve clicked on the play button, nothing seems to happen, so I go on and try other things, which usually screw up everything. Be patient. On my machine, it takes about thirty seconds for the emulator to show up, and another thirty seconds before Eclipse discovers the emulator is running.

Once the emulator is running, you are ready to start testing.

Connecting the Watch

Again, this seems nice and straight forward. Connect the USB cable from the PC to the connector that snaps on the back of the Gears 2 watch. However, when I did that, I got nothing. It turns out that Windows needs driver updates to be able to recognize the USB device.

GUIDE: First Time with your new Tizen SDP - Drivers and certificate talks a bit about this and provides a link to I downloaded the zip file, ran the executable in it and the next time I connected my watch to my laptop, it showed up in the connection explorer.

Shell Access At Last!

With the watch connected, I could browse the files on my watch using Eclipse. I could also go into shell mode, using the command ‘sdb shell’ in the \tizen-wearable-sdk\tools directory. Looking at other sdb commands, there is ‘sdb root’ command. However, trying to enable root gives a Permission denied.

There is an article, [Hack] The Tizen Samsung Gear 2 and Gear 2 Neo get Root access I haven’t tried that yet since I haven’t gotten a need for root access yet.

And the development

I’ve been having problems with my machine crashing a bit recently, since I’ve started trying to develop for Gears 2. I’m not sure if the problem is with the IDE, the emulator, or completely unrelated, but it has been slowing down my testing. I did manage to side load a package on my watch using the commands in How to Install (sideload) .wgt app files on the Samsung Gear 2 smartwatch using SDB. This is also useful in finding out about certificates, which is an area I haven’t mastered yet. Once an application is slide loaded, removing it can be a challenge. How to uninstall an app in Tizen emulator? gives a good idea how to do it, except that the package id is in the config.xml file.

I’ve also run applications from Eclipse, which I’ll talk about more later.

I apologize for such a long detailed post about getting started with development for Gears 2. Hopefully, this will provide a good starting for others wanting to get going.

Samsung Gear 2, Week 1

I have now been wearing a Samsung Gear 2 Smartwatch for close to a week, so I feel that it is now time to write some initial thoughts. One of things that particularly caught my attention about the Gear 2 smartwatch is that it runs the Tizen operating system. I used to write code for my Nokia N900 which ran a predecessor of Tizen, so the idea of running a Linux based operating system on a smartwatch especially caught my attention.

However, I’ll aspects about Tizen for a later post. The upside is that it may be a much better, more open operating system. The downside is that it appears locked down, at least right now, and setting up the development environment is not as easy as I would like.

I am also interested in the smartwatch as another player in the rapidly growing wearable computing field. I’ve been wearing Google Glass for nearly a year now, and I continue to wear it at the same time as I wear Gear 2. One of the nicest features of both of these devices is the more instantaneous notification than a smartphone. When a notification comes in, glance up for Glass, glance at your wrist for Gear 2, or pull your smartphone out of your pocket, pick it up off the desk, or whatever.

On Glass, I get notifications about twitter, text messages, various news sources and gmail. Gears gives me access to corporate email and text messages. I’m starting to experiment with other notifications. They look promising. If you want a device for quicker notifications, Gears 2 seems to be a good way to go.

Of course, being a digital omnivore, I can easily imagine continuing to wear Glass and Gears at the same time. Ideally, I’d love to pair Glass with one of my phones and Gears with the other. Unfortunately, Glass requires at least Android 4.0.3 and Gears requires Samsung devices. I have a Samsung G4 and an HTC Insight, running 2.3.0. So, for the time being, Glass and Gear are both linked to my G4. When I get a chance, I will see if I can upgrade the HTC to Android 4 and see if I can connect it to Glass.

What differentiates Gears 2, from Gears 2 Neo and Gears 2 Fit is the camera. However, this is a 1.9 megapixel camera. These days, it seems like a 5 megapixel camera is the minimum, so I’ve been pretty unimpressed with the camera on Gears.

The Gears 2 Neo and Gears 2 Fit cost $200 and seem to be competing more with the Fitbit and related fitness bands. They cost twice as much as the competitors, and the camera makes it cost three times as much.

I did try the Nike Fuelband at one point and was very unimpressed. The fitness apps on the Gears 2 are nice. I’ve walked 6483 steps today. Well short of the 10,000 steps I’d like to be doing, but not bad. In fact, I’ve been over 6000 steps every day since I got the Gears. One thing that I wish it had was some way to download this information. There is a separate Exercise application, that doesn’t seem to share data, but does use the heart rate monitor. There is also a Sleep App which tracks how long and well you are sleeping. So far, no great insights from it, but it seems okay. It is supposed to be water resistant down to a meter deep. So, I’ve wondered about using it to track swimming, but I haven’t found an app for that. On Gears 2, you can share data from Gears Fitness apps as an image to social media. A nice start.

Ideally, I’d like to see patient portal type apps connect with Gears and that may be another test soon.

I have tried installing a few other apps on gears, but nothing has really caught my attention or worked nicely for me. The QR code reader seemed like a good idea, but hasn’t worked properly yet and the Facebook Quick View app seems flakey.

For me, the battery has lasted pretty well, I suspect it would run for two days between charges at the rate I’m using it right now. It recharges pretty quickly. I charge it while I shower and eat breakfast.

All in all, it is interesting enough for me to continue to wear regularly, experiment with, and explore development on. More later…

Online Video Tools

The annual Weitzman Symposium is coming up and at work, which we stream live every year. So, I’ve been exploring where things have been going with online video. It seems like there are a lot of interesting developments.

In live streaming, I’ve used a bunch of different tools. I did a lot on QIK years ago. However, that got bought out by Skype and shutdown. A friend gave me a heads up to save the videos, but I believe I was too late.

Another live streaming system I used a bit was Ustream. This is what we use at CHC. I’ve always liked UStream and they continue to be reliable. They have new software for streaming, called UStream Producer. I’ve only used the free version, which does most of what I want. The paid versions, Producer Studio and Producer Pro add options like multi-camera support and audio mixing. Not much new there.

The other real workhorse in video streaming is Livestream. I’ve used this a bit as well. They appear to be the first of the serious livestreaming platforms to work nicely with Google Glass. However, they organize their content around events as opposed to channels like UStream does. I find the event orientation a bit clunky.

I’ve also kicked around, ooVoo and Bambuser. None of them really have been that compelling for me, so I don’t end up using them often. However, I did use Bambuser from Raspberry Pi, so that was pretty cool.

In terms of video conferencing, at work we use Vidyo. I’ve participated in various Vidyo conference calls, and it seems fine, but I never really got a chance to get under the hood, so I can’t say a lot more about it. However, at work on Friday, we took a look at I was really impressed with it. The free version is very powerful, and the paid versions are pretty inexpensive for the features they provide. It is interesting to note that key investors includes Qualcomm as well as Patrick Soon-Shiong.

The other software that I started playing with is ManyCam. This allows you to switch between different cameras on a PC, screen cast, and even do some funky effects. I used it for doing some green screen broadcasting going out into both UStream and

So, any other online video tools I should be looking at?

Teaching Elementary School Children 3D Printing

A few months ago, CHC purchased a 3D printer. Since then, I’ve been learning how to create objects using various programs. Initially, I used Blender, which is a very powerful, yet complicated 3D rendering program. I figured it was probably too difficult to teach to elementary school kids. Later, I tried SketchUp which is much easier, and there is also a free version of this. I was thinking of teaching this to the kids, when someone suggested I try TinkerCAD.

TinkerCAD is a free web based 3D design program. It is very easy. However, you need to set up an account to use it and the terms of service said you needed to be thirteen to set up an account. I didn’t want to go through issues of trying to get the parents to set up accounts, nor did I want to set up a half dozen student accounts to manage.

Fortunately, it turns out, you can have many people logged into the same account at the same time, so I set up six computers running TinkerCAD and logged all of them into my account. I prepared a lesson plan based on the TinkerCAD quests going through how to move, copy and replicate objects, how to change your views, how to change the size and location of objects and how to use the opposite of an object, a hole, to create interesting designs.

The students came in, sat down at the computers, and started working. Many of them had played Minecraft in the past, and were used to moving around cubes to create 3D designs, although they may not have thought of it that way. They all quickly started creating objects and reshaping things. There went my lesson plan.

So, I watched the students as they played at 3D design and I pointed out things they didn’t pick up automatically. A few had problems finding objects other than the basic geometric objects and I got them to scroll up and down the objects on the left. Many had probably moving objects up and down along the Z axis, and I showed them about using the little black arrows above and below the objects.

We also, fortunately, had more students than computers, and some students arrived a little bit late. This meant that the students needed to share computers, but more importantly, it gave them an opportunity to teach one another what they were learning.

I spent a little time talking about how long it takes to print objects. The basic cube takes about twenty minutes. Two cubes together, only takes a few minutes longer. The complexity of the object seems to contribute more to the time it takes to print an object than the size of it.

I show them how I could take their designs, save them as STL files, open those files in the Makerbot program, and then print the object. Seeing their objects printed, while understanding how long it took to create objects really inspired them, and by the end of the hour, every student had an object they wanted printed. They helped change the filament of the printer to the color they wanted and excited watched their objects appear.

I only had enough time to print the first two smallest object and I figure I’ve got a full day of printing objects from these students ahead of me. They will swing by later to print up their objects and perhaps share some of their own designs.

I pointed out to their parents how they could set up accounts, and share objects they created publicly. I expect I’ll be getting some emails about other objects they create.

The key take away in teaching kids 3D printing with TinkerCAD: Set up the environment, let them start playing with the program, give them hints on places where they might get stuck, encourage them by printing a few objects, and get out of the way. The students picked up TinkerCAD much more easily and quickly than even I had expected.

Getting Started with 3D Printing – Day 2 – Files

After printing a couple samples off the SD card in the new Makerbot Replicator 2 at work, my next step was to download some things off the internet and print them.

Actually, the next thing I had tried was using the Makerbot Digitizer. I downloaded MakerWare for the Digitizer and scanned my Google Glass. The scan didn’t come out all that well, and I started to look around for ways to edit the scan.

This led me to GETTING STARTED WITH 3D DESIGN. The first thing that they suggested was choosing one out of around a dozen different tools. A couple of them I had worked with in the past, including SketchUp and Blender. I downloaded both, as well as a few other tools and looked for a quick start guide. I like SketchUp because it is easy to use. I like Blender because it is powerful. Yet I couldn’t find a good quick start, so I set them aside and started exploring Thingiverse.

Being an Ingress player, I found a nice Ingress Enlightened Faction badge. It seemed like downloading something from Thingiverse and printing it was the next best step to get better acquainted with 3D printing on the Makerbot.

The file I downloaded was in .stl format which stands for stereolithography or Standard Tessellation Language, depending on who you speak with. You can open an .STL file in MakerWare and, if your printer is connected to your computer via a USB cable, print the object on the printer.

When I opened the faction badge, I received a message saying the object was off the platform and asking if I wanted to reposition it. I moved it on to the platform and printed it. Unfortunately, partway through the printing, it hung. It may be that my PC had gone to sleep during the printing, or there may have been some other problem. It also printed an edge around the object that I didn’t want.

When you print, you have a lot of options to choose. Getting going, I took the defaults. One of which was Raft, which creates this edge. It is useful if you have an object that doesn’t quite fit together, but most of the time of no value or downright annoying. Unfortunately, it took me a little while to figure this out.

To get around the issue of my PC going to sleep while printing, I took to saving the image as a X3G file. This is, essentially, the compiled format of the object, ready to be printed. I could then copy it to the SD card for the printer and print from that. This worked much better for me.

Along the way, I also found a few other file formats there are important to the initial understanding of 3D printing on the Makerbot. The STL file is the first, and most important format. You need to get things into STL format, so you can load them into Makerware to either print or save to the SD care. STL format can be Ascii or Binary. So far, I’ve only used the Binary format.

STL files can be combined into a zip file, along with a manifest file. These thing files can be loaded into MakerWare to load several STL files at the same time. The only thing file I’ve worked with so far is the example nut and bolt file.

When you export a file from MakerWare, you can export it in X3G, S3G or gcode. So far, I’ve only used X3G format and will experiment with the others later.

Blender can read and write STL format files. SketchUp needs an addon to do this. In my next blog post, I’ll write about taking existing images and objects in other formats, like JPG, SVG and OBJ and converting them to STL files that can then be loaded in MakerWare and printed.

As always, any thoughts, questions or suggestions are encouraged.

Syndicate content