Archive | August, 2015

Fixing avr-eclipse paths

20 Aug

Fixing avr-eclipse paths

Just before summer, I started consulting work for a hardware startup here in Oslo. As part of this I've gotten to play around with and integrate lots of new toys such as VISA card readers and various communication solutions. I also inherited some AVR code for a circuit developed specifically for the project and yesterday I set up the tooling.

I guess I could have used all sorts of software alternatives to program the microcontroller, but since the people that created the codebase used Avr-Eclipse, I figured that I'd check it out. Using a GUI makes finding the right fuse settings a breeze and I love to have proper syntax highlighting and completion. Setting it up was easy using this guide, but getting the code to compile properly was somewhat difficult so I thought I'd jot down what I learned in case it helps others.

Setting path for AVR tools in Eclipse

All my problems boiled down to Eclipse not using the PATH variables for avr-gcc and avrdude. On my system I have CrossPack installed for working with pure AVR projects and then I typically use the Arduino tool + Sublime for anything Arduino-related. The Arduino tool automatically adds some things to PATH on the Mac/OSX so in theory, avr-eclipse should just find and use this. It didn't. Instead it pointed to an old, uninstalled version installed by MacPorts on my old Mac that got ported over to my second Mac. All the folders were empty as I unsinstalled MacPorts to use Brew instead several years ago, but the "smart" feature insisted that these empty folders were better than looking at the system PATH variable. I altered the PATH values to point to the CrossPack installation but that didn't help either.

The creators of the avr-eclipse plugin have tried to add some smarts to the configuration, but that failed completely for me. To set the correct location of the AVR tools you want to use, open the Eclipse menu > Preferences and then expand AVR > Paths like this:

Forget the Rescan button if you know what path you want to use. If you don't know the path to avr-gcc and the other tools, just open a terminal window and type:

which avr-gcc

This will tell you the path of the avr-gcc that can be reached through the normal PATH settings on your machine. Now you'd think that this is all you need to do, right?

Fixing the standard includes

I kept getting errors like this.

undefined reference to `debug'
undefined reference to `asm'

It basically means that AVR-eclipse can't find the class definitions for these files. To fix it, Right Click the name of your project in the Package Explorer window and select Properties at the bottom of this menu. This brings up the local preferences for the project. Go to the "C/C++ General" entry and expand the "Paths and Symbols" option. Make sure you're linking to the right version of the include files here:

If you've set the correct AVR hardware and the right programmer, you should now have a working setup. Hope this helps someone as it was rather hard to google all the bits required to get to this.


Testing with Testflight

10 Jul

Testing with Testflight

After Apple purchased Testflight, the service has been integrated into the workflow when publishing apps. Any app with a distribution profile can be sent to users for testing and the process is actually quite smooth compared to the old version. First your build is vetted by Application Loader (or XCode) and then you turn on testing for that specific build. I did however run into an issue worth publishing in case others run into it.

Normally, you'll just flick a switch to turn on Testflight Beta Testing and the app is ready to be tested by all internal to the team. In my case, I could flick the switch but nothing happened. I called Apple Developer support, but the guy I talked with completely failed at understanding what my issue was and he insisted on sending me something I knew was incorrect. He just wouldn't listen when I tried to tell him that something was wrong:

I eventually understood that the first of the two warnings (... must contain the correct beta entitlement) did not have anything to do with my certificate or provisioning file, but rather a missing directive in my app descriptor. Some googling led me to this article that explained how one had to add the beta-reports-active key to the Entitlements part of the descriptor. I now got an error when uploading the 

Build 168 does not contain the correct beta entitlement.

After reading all the replies to this thread I realised that I should not set the mobileProvision-file to be for AdHoc distribution. It should just be a Distribution profile for App Store. That's it.

I also had another issue getting my AIR app published this time. After updating to the latest XCode, I got the following error when uploading the app:

Invalid Bundle: The bundle does not support the minimum version os specified in info.plist

Turns out one have to add a bit about MinimumOSVersion to the InfoAdditions-section of the descriptor file as well. My entire iPhone descriptor settings are now like this:


Popcorn Time!

06 Jul

Popcorn Time!

Just a little summer sigh... I keep reading articles like this one (translated to English) about the famed Popcorn Time software that let's anyone view pretty much any movie when they want. In this article, the word "strømming" means "streaming" and the headline is that streaming of pirated movies has more than doubled the last year.

Nobody but the movie industry is surprised! We all want to stream movies like we've been able to for music for quite some time now.

In my opinion, Popcorn Time is Netflix done right, but without any legal issues holding them back. Suing Popcorn Time or it's users will not solve the problem. Just as with music - new distribution models will pop up and they'll be your competition in the future. The longer you wait, the worse you basically make it for yourself.

How NOT to attack this

The obvious way to attack this is what the movie industry is currently doing. They slam the Digital Millennium Copyright Act in the face of those pirating instead of removing stick (or even forest) in their eye. They drag kids and parents to court for illegally watching movies. I wonder why one have to work in IT / Web to understand that this will not solve a single problem? Why can't they just understand once and for all, the old distribution model is gone and they have to solve this with software & licensing?

What the movie industry SHOULD do

First of all, they should read this 7 year old review from the EFF of what happened when the RIAA sued more than 30.000 individuals. They gained nothing, but rather lost their public reputation as a watch dog for the industry. People don't pirate movies or make services like Popcorn Time to be evil. They are solving what the industry does not do itself - the obvious way to distribute movies.

There is no practical reason not to distribute movies digitally. There may be legal / monetary issues regarding the licensing of each film, but that is irrelevant to the end users. When the music service WiMP (now part of Tidal) started here in Oslo, they had 1 programmer and 8 lawyers. That's how clumsy these things are in music. I don't expect it to be easier with films, but that's no reason to hold on to an antiquated system? The first studio to clear legalities and make their ENTIRE back catalog of movies available will be the winner.

For several years, record labels report about increased purchase and use of music - thanks to the streaming services. As soon as Hollywood understands that they can activate their massive back catalog of assets, they will make the illegal streaming services will disappear - just as the P2P music pirating disappeared. The first company to make a Spotify for movies (offering movies from most or all studios) will be filthy rich.

Nobody really wants to pirate movies. It just happens to be easier than getting them legally.

Image by Tim Cowley, CC By-SA 4.0


Including Native extensions on OSX

01 Jun

Including Native extensions on OSX

Making a small GUI project that controls some hardware today and stubled upon a bug that I solved when using the neat COM-port extension for AIR by Nick Kwiatkowski.

I got the following error upon compiling:

Process terminated without establishing connection to debugger.
Not supported native extensions profile

This comes from the AIR project being set to target all platforms by default. By adding the "supportedProfiles" tag in the application XML, the problem will disappear:


This solves the first problem, but you'll most likely get another one:

Process terminated without establishing connection to debugger.
The content cannot be loaded because there was a problem loading an extension: Error: Requested extension com.quetwo.Arduino.ArduinoConnector could not be found.

This comes from the Native Extension not being included with the project by default. Right click your Project -> Properties -> Actionscript Build Packaging -> Native Extensions and check the checkbox under Package. Flash Builder may incorrectly claim that "This ANE is not used in the application". If all goes well, your project should now compile.

Also be sure to read the old FAQ on Google Code to get your Arduino Connector project up and running on both Windows and Mac as you'll find that the DLLs pthreadGC2.dll and libgcc_s_dw2-1.dll are required.

Teaching with robots

20 Oct

Teaching with robots

The last two years I've done a course in at Westerdals Oslo School of Art, Communication and Technology (formerly NITH). The school offers Bachelor & Master studies in informatics and I've been brought in as a teacher on the topic of Embedded Systems. The course (200 hrs total) is a volunteer topic for third year students that covers all the basic use of Microcontrollers as well as some Embedded Linux.

It's been a great experience and I get to play santa - giving students a customised version of this kit. 4Tronix have been very helpful in making me a super Arduino-kit that covers the entire curriculum at a price that the school can live with. The only part of the curriculum that isn't covered by this kit is robotics and motor control. This year I think I've found a near perfect solution that I though I'd share with other educators.

First year - cheap robot kits

The first year I did the typical thing - I looked up various robot kits and grabbed what I thought would be a decent kit. The problem with this approach was that I didn't know what kits were good and not. Price was also an issue. The budget ($150/student) only allowed me to get 4 kits. With 28 students, that wouldn't work too well so I sat down and designed the NITH Penbot. This little Open Source robot uses cheap stepper motors to navigate & a servo to lift a pen. That way you have a robot that can be printed in 40 minutes (body + 2 wheels) and the students could build them with the components they already had in their kits.

It didn't go bad at all, but a lot of time was spent on the assembly. The focus of the course is software for hardware, not soldering/gluing/crafting. Due to the time needed to put the kits together, we didn't do much robot driving the first lesson (4 hours each) and had to postpone it to the week after. This in turn caused other problems as the students needed their Arduino's so as soon as the robot driving was finished, they had to dismantle the whole thing to be able to do other exercises. We also realised that while popsicle sticks are a cheap building material, they're not very solid at all. In other words - my solution worked but was not ideal. I knew I had to find a better solution for next year.

Maker Faire Oslo

While teaching at NITH, I was helping my kids building robots at home based on the kits from MakeBlock. My son got a Robot Starter Kit first, but when my daughter saw how much fun her brother had - she wanted one as well. Perfect! Here I'm getting my daughter to jump head first into STE(A)M education! My son did all of his robot alone (apart from the remote), but I had to help my daughter quite a bit. The building itself went quickly, but her project required custom hardware & software so she couldn't do it all by herself. They had their own stand at MakerFaire and it was a big experience for them both!

Having seen the quality of the Makeblock kits, I instantly bought some kits for myself. Over this last year I've built several robots and even a 3D printer based on this system, so it was obvious to think about using the same robot kit with the students.

Second year - Makeblock

For my second year, I now have 34 students! More students = more kits. I was able to convince the headmaster that since the Makeblock kits could be reused across more years, we should spend the extra money. I split the students into 8 teams & we got started. The teams were split into two - one half focusing on building, the other on software & picking up batteries (not included).

A nice thing about the kits is that they come with instructions for two different robots that each have their merit - a tracked vehicle or a wheel driven robot.

The students could of course have improvised and built other robots if they had more time, but these two are a good starting point. I had deviced a challenge in the form of a labyrinth that the robots had to navigate. A tracked vehicle will usually slip if you drive too fast, so driving slowly is key with this bot. The wheeled robot is easier to contol precisely, but no team selected that design initially. The "tank-design" is just much cooler looking I guess?

I'm very happy with choosing Makeblock over typical Arduino-style kits with plexi and tiny screws. The first team had their robot kit up and running in only an hour! There were practically no questions about how to build the bots and since the robot kits have their own Arduino with builtin motor drivers, there was no need to disassemble the robots in between classes. The only issue we had were a beam that was too short and an Arduino board that didn't work 100%. This was no problem since we had a spare kit, so we used parts from that.

Here's a short video from both the building and the competition (with some cheesy music from the Youtube video editor):

Summing up

As opposed to the previous year, the students quickly understood the difficulty of programming autonomous robots. This caused them to come up with various mechanisms using code to better detect the surroundings. Many tactics were tried and we all had great fun looking at the results. If this was a robotics course, we'd have much more time to dwelve into some proper problem solving. With the 4-5 hours we have available, it's only a small introduction to a much larger topic. The students loved it though and some now even blame me for having given them a new hobby.

I achieved my main goal of getting more time dedicated to coding the robots, rather than building them. Nothing was destroyed and it's now all nicely packaged for next years students to use the kits.


Making a custom 3D printer controller

20 Aug

Making a custom 3D printer controller

While working on my new printer, I realised how ugly most reprap controllers are. All those I've seen use large SD cards & bulky oldskool LCD's with really poor contrast and viewing angles. Why not use Micro SD & an OLED screen?

You can actually build your own custom controller using any combination of screen, SD reader and encoder, but I couldn't find a good description of how to do it, so here it is. Setting it up with the Marlin firmware can however be a daunting task, so this article aims to document how I went about doing it.

I should start by saying that this is not "the right way" to do it, but I'm describing two of the many possible ways to do it. This description is for Marlin. If you are using Repetier on your printer, you may pick up some advice but the specifics will be different.

Picking the parts

My biggest annoyance with the typical LCD's used in these controllers is that if you're not standing directly in front of it, you can't really read the display. OLED displays use less energy than traditional LCD displays. They're easily viewed from any angle and have a fantastic contrast. I settled on one from that has the required 20 (wide) x 4 (height) character displays. These are less than 4mm (1/64 inch) thick and has good mounting holes. Cost $34.

The SD card reader was something I had picked up from DX a long time ago A straight SD reader based on SPI. I got the encoder from Adafruit and I found a standard buzzer that was fairly small in a drawer. Pretty much any screen, SD reader, encoder and buzzer can be used.

Putting it together

Next is the fun part of figuring out how your controller should look! Grab your components and try to lay them out as smart as possible. Next you'll need a way to connect them together. A standard perfboard cut to 125 x 35 mm (48 x 13 holes) is what I needed. Your needs will probably be different, but using perfboard makes it easier to lay things out and solder it once you know how you want stuff.

Another alternative is to design your own professional PCB using software like Fritzing. It would be a good first project, but it takes time to get the PCB produced. You can also add indicator LED's and other custom components if you want to, but these will require you to add more custom code.

Finding your way around Marlin

I have a somewhat varied programming background, but C++ isn't exactly my native tongue. That's also my reason for doing projects like this - to learn more. I find the Marlin codebase a bit confusing. The root file is Marlin_main.cpp. The Arduino IDE will make a copy with .ino extension of this file when you start up the Arduino IDE.

At the top of this file is a load of #include statements. These are mostly files full of #define statements that are replaced by the compiler every time you hit "compile", but they also contain methods that will reside in a "global/root" namespace. Take the fairly central file "stepper.h". This is the header file for "stepper.cpp" that controls how the printer moves. None of the methods here belong to a class. They're just "there".

Coming from an object oriented programming background, I didn't expect this. I guess there's things/limitations such as dependency on interrupts that can force certain ways of doing things?

As far as I know, the first control panel for Marlin was added by fellow Ultimaker owner Bernhard Kubicek (thanks Bernhard!). After this, many others have hacked in support for their own panels. Over time, the codebase, and especially the config files, have become a little messy so it can be kind of hard to navigate.

Implementing your own screen

More or less any screen can be used, but it will require some modifications to the Marlin codebase. The first you'll need is a small library that can print characters to your screen. Most screens will have standard functionality for this, so if you're lucky you won't need to write more than a little wrapper-code. In my case I received a barely functioning code snippet, so I had to do a little more work. You can find a ZIP-file with my Marlin implementation here.

These are the main functions that your screen class will need:

createChar(uint8_t, uint8_t[]); // custom characters such as temp meter
void printChar(char);

The clear() function obviously clears the screen and setCursor tells where the next character is placed on the screen. With these two and a print-command, you'll have all you need. But wait - print() isn't on the list? No, but if you look at my example OLedI2C.h class, almost at the top it says:

class OLedI2C : public Print

This means that the OLedI2C-class inherits all the functions in the print-class (Print.h) and expands on this. Without inheriting these methods, you'd have to write 18 functions to handle printing of all data types (uint8,uint16,char, bool, double and so on). The OLedI2C-class also "overwrites" the write-method. It changes the default behaviour of the Print-class to instead print to the screen we're implementing.

There's also two "special" commands in the list above. One creates custom characters (createChar) and the other prints it (printChar). These allows us the output graphical symbols for folder navigation, temperature, time and more. A standard "Character LCD" will typically have up to 8 slots for creating such symbols. If you're using a "Graphical LCD", you can create all the characters you want as long as you have the memory required. My implementation also has other methods, but you may not need these.

When you have a well working screen-class it's time to make the actual implementation that Marlin will use. You set this up as shown below.

Method 1 - modifying the existing classes

When you're building your own machine, you will need to make modifications to the Marlin firmware. There's two main methods to adding LCD support. The first involves adding it to the existing file "ultralcd_implementation_hitachi_HD44780.h" and use

pins.h - all I did here was to change the SDSS pin for my Megatronics 2.0 hardware (board type 701). Other than that I've kept all the default pins as defined. If you're using Ramps or something else, you'll need to look up what pins to use in the online documentation.

Configuration.h - Here I added a custom section for my screen:

#define OLED_SSD1311 // Oled based on the SSD131x chip series character display
#ifdef OLED_SSD1311
  #define ULTIPANEL
  #define NEWPANEL
  #define SDSUPPORT
  #define LCD_WIDTH 20
  #define LCD_HEIGHT 4
  #define LCD_I2C_ADDRESS 0x3c   // I2C Address of the display

The OLED_SSD1311 define is my main switch. If this is defined, it'll include the things below.

The ULTIPANEL enables encoder support. This is one of the more messier things in the codebase. This also enables other things but it does not cause problems for me. It would however be great if there was a generic define that just enabled just the Encoder and not other things related to SD card, menus & Ultimaker specific features.

NEWPANEL enables lots of LCD-related features, but is also used for Encoder-specific features. SDSUPPORT is really the only include that does exactly as it's name says. Width/height is used for menu scrolling and the I2C address is just there as it's "convenient to have". In my case I could just as well hardcode it in the class as all the screens of this type use the same address.

ultralcd.cpp - This is the main class controlling everything related to the screen and SD card file selection. It has static stub methods that serves as an interface for other implementations. Here I had to add an include-statement for my custom class:

#include "OLedI2C.h"

OLedI2C.h & OLedI2C.cpp - header and implementation of the custom OLED character display. You can also use a non-character display, as long as you provide the same methods mentioned above. Put these files together with your other Marlin files. I created most of this class in a small, separate project since uploading the whole of Marlin takes quite some time. For testing it's better to have a tiny project to test with or you'll be over-caffeinated well before lunch.

ultralcd_implementation_hitachi_HD44780.h - this is where you integrate an instance of your own screen. All that is needed is two edits. The first is to add the instantiation of your screen beneath the section that has the heading "Create LCD class instance and chipset-specific information". I added mine at the end of the if/elif/endif statements:

(other screens)
#elif defined(OLED_SSD1311) // OLED
  #include <OLedI2C.h>
  #define LCD_CLASS OLedI2C
  LCD_CLASS lcd;
  // Standard directly connected LCD implementations

These blocks are compiler arguments, so the whole block will be replaced at compile time and only the parts that are #defined will be included in the compiled code. Next is that you add your init-call to the lcd_implementation_init() method:

(other screens)
#elif defined(OLED_SSD1311)

This is the method I opted for as I generally like the way the typical Marlin LCD works. To go completely custom - read on…

Method 2 - creating your own implementation

What if you don't want the default contents on the display? What if you want to make a super-fancy, full color with lots of bitmaps-screen? Then you'll do the things above, but omit the changes to "ultralcd_implementation_hitachi_HD44780.h". Instead you'll want to replace the default instance of "ultralcd_implementation_hitachi_HD44780.h" and use your own file instead:

ultralcd.cpp - Remove the include at the top and instead add a toggle at the top of this file for the specific screen that included the right class if the OLED_SSD1311 was set:

#if defined(DOGLCD)
    #include "dogm_lcd_implementation.h"
#elif defined(OLED_SSD1311)
    #include "oled_1311.h"
    #include "ultralcd_implementation_hitachi_HD44780.h"

myCustomOled.h - In this file (can have any name) you need to implement your own version of all the methods in ultralcd.cpp. The class holds an instance of the custom screen and handles all the actual hardware.

Be advised that this approach is more time consuming, but you could of course just copy the contents of "ultralcd_implementation_hitachi_HD44780.h" and modify only the things you need.

Things learned

There's always something to learn when doing a new project that you can carry over to coding in general. For instance - when you get the Arduino/C++ error "someClassName does not name a type" this basically means that the compiler can't find the definition of the class "someClassName". If you look closely at the error message it will usually tell you where you need to add an #include statement so that the compiler knows what to do. Probably obvious to seasoned C coders, important info for me grin

By doing this I've now implemented a full library for a custom piece of hardware with only a little to start from. I had to read the datasheet carefully and there were several things I could have added. This is how I hooked it up to my Megatronics 2 board:

End result

Size, readability and looks was my main reason to do this project. I'm quite happy with the results when I'm comparing it to the two most common Reprap Controllers:

Not only is my custom controller smaller - it's also thinner despite using standard components on a perfboard:

Is it worth it? I think so, but it could certainly be a good product just to sell a super-thin controller like this. I only need a single one, so it's not for me , but someone should make a standard reprap controller that looks as good as the Panucatt Viki LCD, but with an OLED grin
Next up: printing a nice enclosure for it!

Useful reading

Here's some links that I found useful when solving this project:

Partial description on how to do this
#define's & pre-processing
Schematics for UltiPanel with rotary encoder

This also gave me a chance to do some extra documentation around the Megatronics 2.0 electronics that I use for the printer.

Why I’ll never use Windows Phone again

04 Aug

Why I’ll never use Windows Phone again

It's been a while since I posted a good rant. Here's one that's been brewing for some time. I refuse to belive that ANY Microsoft employes that ever had an iPhone or Android, actually tried to use Windows Phone for a full year. I have and I can tell you - it's utter bullshit. I don't doubt that a lot of talented people have worked hard to make it happen, but without someone capable of telling what is good and bad, you cannot succeed. The whole OS reeks of a lack of interest and use.

I gave it a full year as I figured they'd get som time to fix the major bugs. Despite three fixes delivered over the air, they have not solved anything that could help me like the platform. They have however added a menu with "Extra settings" that I'll never use.

Here's my 6 biggest annoyances:

The Search Button

This is my single biggest gripe with Windows Phone and the person that made this choice should be fired immediately. He/she has done irreversible damage to the company in insisting on this bug/feature. When I'm pressing the search button - it is ALWAYS in a context! I have ZERO interest in opening Bing (see below) when I'm clicking the search button - EVER! If I'm in Spotify - I want to search Spotify for a song. If I'm in my contacts list - I want to search for my contacts. If I'm in a browser, I want my PREFERRED search engine. This would be so easy to understand if you ever used this phone.

When more than 50% of all apps (including Microsoft's own) needs to implement it's own search button in software AND you have a physical one that does not do anything sensible - it would be obvious to most developers to combine these. In many apps there's actually a menu bar at the bottom of the screen just to show a search button. It must be some incredibly stubborn person inside the company that insists on this. That person cannot be using Windows Phone at all. After using it for a year, I now have a long list of (mostly shitty) applications. To change a setting I have to scroll quite far. Imagine how neat it would have been to search this list of apps instead of going to Bing.


Settings menu is presented as text, but non alphabetical. Why on earth is Flight Mode and (screen) Brightness not on first page, when Theme & Internet Sharing is at the top? How often will anyone Microsoft developers actually change their theme? And how many "average" users will ever use the internet sharing? And why use text rather than icons for a non-alphabetical list? I refuse to believe that a single hour of user testing went into this.

Internet sharing

This feature turns off at it's own will. If I turn it on - I really want it to be on ALL the time UNTIL I turn it off myself. I have no interest in power saving for this feature. I just want it to work an not turn off every time I take a minute to answer an email. It does not work the way it's implemented now. It's simply too annoying to use.

Common volume

There is one common volume setting on the whole phone. This controls both media playback, ringtones, speaker volume and haptic feedback. Turn it off and you'll walk for half a day enjoying silence. Then you'll panic and realize you've lost tons of phone calls, Skype calls, messages and other notifications. Smart smartphones knows that AT LEAST the ringtone must be a separate volume or people will screw up and if this is due to the smart-phone not being smart enough, they'll get a better phone.

Lack of apps

It's ok not to have thousands of apps just when you're launching something. It's ok that not all the major app vendors support you right away. You MUST however do some filtering and make some CORE apps. Not having a youtube app is unforgivable. I know Youtube is a Google property, but that's irrelevant. Without a proper Youtube-app, you only got half a smartphone. It's that important. Allowing more than 30 wrappers around the web version of youtube is not adding value. It is destroying value. If I have to download 10 bad apps just to get one that is good, I'll stop downloading apps. It's that simple. Throw out the shit, retain and promote quality.

It's ok to not make just as good apps as Google, but you need to have the basics working. The Maps-application that come with Windows Phone, fails to locate pretty much anything other than cities. If that's a feature, you should probably name it "City-search", but you should not call it "maps" if it cannot find features on a map. I've viewed maps in the app and stared on the name (written on the map) and despite this, the search feature is unable to find that very location. I dunno why, but there apparently no relation between the map and the search. This makes the app somewhat useless.

If you want to get thousands of QUALITY apps in your store, you need to make sure that the vendors of cross platform authoring systems add your export. Adding Windows Phone export in Adobe AIR could give you millions of new installs. All they'd need to do is to recompile and export. Unity already exports to Windows Phone and I'm sure quite a bit of the current apps come from that. Nobody will learn a new platform/OS unless it's from Apple/Google and you know you have a huge market waiting. If you're entering this market to compete with them, you'll need to make it super-easy to make apps. You cannot force everyone to get a PC and learn Visual Studio.


My WinPhone is a Samsung Ativ S. The specs are pretty neat. It should be lightning fast. When I type a URL in the browser, suggestions will pop up as I type. This is nice, but not when the first suggestion pops up 3 whole seconds after I started typing. As I try to tap any of these suggestions, the list will re-order, so and I'll open some random URL. Come on. This is just looking up and displaying a list. It's a very basic programming task. How can this possibly take three seconds on this hardware and why on earth didn't anybody notice this and fix it after a whole year?

Bonus grudge: Bing as a search engine

I refuse to believe that it isn't possible to make something better than Bing. If I'm at a silent party I will sometimes pull up my phone and have people suggest random things that we should search for using Bing. We'll then laugh together at the results. Yeah - the results are so bad that it's fun. They are for some reason much worse if searching from a phone than from the desktop. If I worked at Microsoft search department I'd be crying.

One example: at Bitraf I hosted a workshop about "Myke kretser" (Soft Circuits written in Norwegian). Just before the event I used Bing to see if they had indexed the page. This was a month after I put it up on The search for "Myke Kretser" returned 1970's NBA player "Mike Kretzer" first and then even more irrelevant results. Come on. Not even one of the two words are alike or has even remotely the same meaning? Google had it right two days after I posted the event on Meetup. Bing now returns the correct phrase, but links to my slides from the workshop (derivate) rather then the Meetup page (source).

Bye, bye

If I spent more time, I could probably come up with more than 30 solid software and usability bugs in Windows Phone. The whole OS is incredibly unpolished. In addition, my Samsung Ativ S phone has been randomly rebooting at least once a day. I originally attributed this to a software bug, but none of the updates from Microsoft/Samsung ever solved it. To be honest, I now doubt it's a hardware bug. Good riddance Windows Phone. It's been an annoying year with you. I won't go back…



07 Jul


I really love those squeezed-in weeks of work in between family holidays. It's a rare time to catch up on thing like blogging, reading & updating a few personal projects. I just finished reading The Martian by Andy Weir that I got recommended from @hpeikemo. It's a really thrilling book that I'm sure we'll see as a hollywood movie soon. The story is kind of a "Robinson Crusoe meets McGyver on Mars". After reading it, I gave it to my son who completed it in just two and a half day. Great summer read!

I finally got around to update my Arduino Companion app. It's ratings have suffered quite a bit since Android 4.4 is now pretty common and it took Adobe a LOT of time to fix the bugs. When the fix finally was available, I was stuck with client work and didn't manage to set aside the two days required to fix it. I can only apologise that it took this long.

It sucks to loose the 4.6+ rating on Android, especially since it's mainly due to ppl like Nicholas Castle that wrote the 1-star review to the right. I don't mind a 1-star review that says that the app does not work (when it does not), but this is kind of harsh from someone that hasn't even seen the app? It's not like he paid anything (it's a free app) or that I have a 100 person customer service department. I make the app on my spare time, I give it away and my email is listed below the app. Oh well. I guess I'll rather thank users such as John, Daniël, Luiz, Thomas, Tim, Bryce, Samantha and many others for nice and polite feedback with reminders to fix the problems. As soon as Apple approves the app, the more than 105.000 iOS users of the app can download the update to version 1.2. The more than 102.000 Android users can get it today. More than 200K happy users… Crazy isn't it? grin

The months since December is sort of a blur as I've done more client work than I usually do. The most fun commercial projects this autumn was building a series of custom wifi-enabled LED signs as well as working with UNO. After summer I'm really looking forward to teaching another half-year of Embedded Systems at NITH here in Oslo. There is something really special about seeing computer science students actually understanding the core operations that enable the computers they use every day. It's all just one's and zero's, but you don't really get it until you have to create the bits yourself by turning power on/off at the right intervals… The students were really happy with the course last year and I have plans to make it even more fun this year!

Since I've worked long days, I haven't had that much time for my hobbies but I've gotten quite far on building a X/Y robot that I have plans to complete before going to the Maker Faire in Trondheim in August. It'll be able to draw, print and probably also do some light CNC'ing when I'm finished.

Just before the summer holidays I managed to squeeze in two weeks to build a brand new 3D printer from scratch using Makeblock! This new printer will have a bigger build envelope, but it will also be able to use flexible plastics, nylon, wood and bronze materials thanks to it's construction. Read more about all the advantages here. With that you would think that this fills my appetite for 3D printers, right? Not quite. I spent my tax return on signing up for the Titan 1 SLA printer as well. It'll give me extremely high resolution models as well as solve my problem of printing parts over night without disturbing the family. That said - the Makeblock-based printer is much more silent than my Ultimaker. Looking forward to November & meeting the Titan!

What platform next?

20 Feb

What platform next?

In 2013, Adobe completely dropped the ball on the Flash Player and AIR. All further development has been moved to India. This normally means that the software has been put in what is referred to as "Maintenance mode". Any serious bugs will be fixed, but don't expect much in terms of new features. If you take a look at the Release Notes for AIR 4.0, you'll see what I mean.

AIR will exist for many years still, but it's time to look forward and figure out what's next. What I'm looking for is a platform that will let me create both mobile and standalone apps easily, like Adobe AIR was but with a company that is still committed to the technology. Perferably with a solution that can create smaller and faster apps than AIR.

Some alternatives

For many years I wanted to look into Haxe, but I never got really into it. It was just to "techy" to get going. I really want a one-click installer that gives me all I need to get started. Some of my coder friends spent lots of time with Haxe and said really nice things about it. Other friends have looked towards Java. Joa Ebert has a nice thing going with Defrac and the demo video he published recently looks awesome. I don't want to move in the direction of Java though.

I've also looked at Corona. I really like the idea of using Lua as the main language but Corona only outputs for devices. I've played around with Unity a bit and that I really liked. It's very geared towards games though, so while it's fun, it's also not exactly what I'm looking for.

Ever since I started programming as a kid, I've shyed away from C & C++. Memory handling and pointers always seemed like unnecessary complications, but after playing around with microcontrollers with 2Kb ram and less, I've changed my opinion about that. The last two years I've done lot's of it and I'm really enjoying it. Seems like a good direction to go? Everybody said nice things about C# and Microsoft Visual Studio, but Microsoft don't have much of a story in terms of cross platform app publishing.

This autumn I've done a series of lectures at NITH on the topic "Embedded Systems". Great fun! One day during a break, I got a call from a former NITH student and acquaintance asking if I had any plans after my teaching duties. 

Outracks & Uno

Some days later I were in the offices of a company named Outracks. This is a relatively small company with a massive goal. They're building a complete coding ecosystem from scratch, right here in my hometown of Oslo. With this I mean that they are creating a language called Uno that has compilers so that it can output to iOS, Android, desktop and more. That just sounds like an AIR clone, right? Not quite. Uno is the first programming language to unify GPU and CPU pogramming. You write the app and all the shaders in the same language. The end result will run on both GPU and CPU and in many cases you don't even need to think about that part of it. The export is always a native app (no runtime bloat), but Uno also exports to HTML5/JS with 3D done as WebGL. In other words - you can make GPU accelerated apps for pretty much any platform with Uno.

They're also creating an authoring tool called Realtime Studio that is a complete coding environment with integrated preview, a solid code editor, inspectors, node view for code (loving this one!), drag and drop support, gui for various export targets and more. On top of that they're creating a UI FrameWork and exactly this was what they wanted me to help with.

The plan was that I were to develop a desktop app for a (still secret) client using their complete toolkit. Over a 1.5 month period I worked on the app and provided tons of feedback and I have to say this is shaping up to be one hell of a toolkit! The UI framework is completely GPU based and this does wonders when it comes to speed. Imagine having a slightly scaled down version of the Flex framework running completely on the GPU?

Why it's so cool

Uno is closely related to the C# language. If you already have C# experience, you'll be able to jump right into x-platform development. I however had basically no C# experience when I started the project and that was one of the things they wanted to test. How quickly would I pick up the language? What would I miss from other platforms? What would be the big hurdles?

Despite all the tools being under constant development, I would say that it took only 2 weeks to learn the language. After that I was fairly productive and knew where I was going. The next 2 weeks went by trying to understand and use correctly all the new goodness available to me that I never had in Actionscript. Uno has support for overloading, abstract classes, swizzling, lambda expressions, extension methods and much more. The last two weeks were really productive and we did reach a finished product. That said, it is still being actively developed and polished and I can't wait till I get to tell more about it.

The one thing that I still haven't wrapped my head fully around is writing shaders. While Uno makes this much easier, it is still something that I'll need to learn more about. Something also tells me that this is something that'll take quite some time as it's a quite different mindset. GPU's work in paralell and all operations happen on all pixels at the same time. That takes some getting used to from thinking more or less serially. What I can say is that I'm pretty sure that I've found what I'm looking for. This is actually the only platform that I feel comfortable spending my time on. Worst thing that could happen is that I've learned C#.

Uno will launch with lot's of official API's that are supported on all platforms. In addition there will be several APIs that are available for some platforms that you can download support for. Outracks has made a backend that is extendable, so if there is a feature you need in a specific platform, you can just add it yourself. It's like Native Extensions on stereoids. Want MIDI on the desktop? Find a premade library in the form of a DLL, write some interfacing methods and you're ready to go. This is going to be incredibly useful for those special hardware integration projects that I sometimes do for museums and exhibits.

Bottom line

I could transition in just a few weeks to a completely new platform. That's pretty cool in itself. Not only can I target iOS, Android, browsers & desktop, but Outracks are playing around with support for lots of other devices and platforms. In the office there were FireFox phones, Nvidia-boxes and lots of other interesting hardware. The apps I've made play with blazing speed and I've seen things that I've never before seen running on a mobile GPU. I can't say how much better that feels than seeing things like this go unnoticed. Having spent a lot of time in the Adobe Forums lately, I've seen many hundred important questions go completely unnoticed by Adobe. I need a platform with people that care and I feel that Uno is by far the strongest contender.

A public beta will be launched at FITC this coming week, so be sure to sign up for that. If you're actually at the event, make sure you catch one of the two sessions that Simo is presenting. He's been using Uno longer than anybody and he's made some seriously good looking things with it!


Apple is not currently accepting applications built with AIR 3.9

03 Feb

Apple is not currently accepting applications built with AIR 3.9

From the 1st of February, you'll get the following error message when trying to submit your Adobe AIR based app to Apple's App Store:

    Apple's web service operation was not successful
    Unable to authenticate the package: somenumber.itmsp
    ERROR ITMS-9000: "This bundle is invalid. Apple is not currently accepting applications built with this version of the SDK." at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage)

From February, you'll have to build your AIR apps using the iOS 7 SDK (comes with XCode 5). In other words - if you are using Flash Builder or the Open Source Flex SDK to make iOS apps, you'll need to upgrade a bit. Adobe added support for this in the 4.0 Beta version of the AIR SDK that is now available on Adobe Labs. I do not know how this affects Windows users, but for Mac users you just download Xcode 5.x and use this instead of XCode 4.x. Next you download the AIR 4.0 Beta SDK and install it. Instructions for how to install/upgrade your AIR SDK can be found here.

With the beta and XCode installed, all you have to do is to up the version number to 4.0 in your App XML and maybe update the path to the new iOS simulator for testing.

Note: this only applies to new submissions. All apps that are already approved are still good.