Author Archives: Yuriy

Rocky.js – Pebble watch coding in JavaScript

Pebble never ceases to amaze. And every time you think – this is it, they reached the pinnacle of awesomeness – they surprise you again. This time they did pretty much the impossible – ported their C SDK to JavaScript, by creating Rocky.JS project. Ultimate goal is to run JS directly on the watch hardware – this will open way to huge number of new developers who hesitate to dive into depth of C. Meanwhile it provides ability to run Pebble code directly in a browser! It’s a lot of fun and as a bonus you can insert Pebble watchfaces directly into your website as evident by living watchface you see here.
Watchface you see running above is called Meyer Object it’s been available for Pebble watch for a while and I decided to port it to Rocky.JS Continue reading →

Restore natural picture look on Samsung smart TV

I really like my new smart TV from Samsung it has tons of bells and whistles. But one thing I noticed – no matter what I watch – series or movies, streaming or broadcast – picture has a “teleplay” feeling – like the action is happening on stage in the theater. If you recall what later Twilight Zone episodes look like you’d know what I am talking about. Maybe it’s supposed to look like this, but I like “film” feeling more. So I found a setting that restores natural picture look:

CYMERA_20160202_215011
Go to your TV menu, then select Picture -> Picture Options -> Auto Motion Plus and turn it off.

Fix Roku problem connecting to 802.11ac 5Ghz WiFi

I recently got a Roku 4 – at the time of this post the latest and greatest streaming players from Roku family. It comes with many bells and whistles – including ability to connect to 5Ghz WiFi networks. But for the life of me – it could not connect to mine. Player was seeing the SSID of the network, able to connect to wireless, but chocked on joining to LAN. Extensive chat with support lead nowhere – they wanted me to change WAN DNS and many other hoops that achieved nothing. For the record – my router is a dual-band one, and Roku had no problems connecting to 2.4Ghz band. But Internet speed falls dramatically over 2.4Ghz connection and I needed 5Ghz.

Finally I found one thing that worked.
AC Network
AC connection has 3 bandwidth modes: 20Mhz, 40Mhz, and 80Mhz. My router was set to 80Mhz to take full advantage of 1300 speed. None of my devices had problem with this (including, I might add, my previous Roku 3 player). But apparently Roku 4 couldn’t handle it. But as soon as I switched bandwidth to 40Mhz – boom, instant connection.

Streaming doesn’t suffer from this change, but it does lower LAN speed, so I’d like alternative solution from Roku if possible. Is this a known issue? Would an update fix it?


UPDATE 2016-02-01: Found a better workaround with the help of this awesome device.
Bridge
WUMC710 is a bridge between 4 Gigabit Ethernet connections and full 802.11ac WiFi. And it has no problem with 80Mhz channel. So I basically tell Roku it has a wired connection (and it does to the bridge) and the bridge has beautiful wireless connection to my router. You can grab the WUMC710 pretty cheap (I got mine for $10) and besides not having to slowdown your main network it makes actual Roku internet Speed much faster. Shame Roku’s own WiFi is not on par, but hopefully it will catch on

Fixing problem with Yahoo geolocation service

Recently two Pebble watchfaces I’ve developed based on Paul Joel designes: Clean&Smart and Cobblestyle began to experience weather update issues – as in “weather was not updated at all”. Looking into the issue I found a weird thing: If you set your location manually – weather worked. But automatic weather based on phone location did not.

The way automatic location works is pretty straighforward. First this function is called to determine location:

function getLocation() {
  navigator.geolocation.getCurrentPosition(
    locationSuccess,
    locationError,
    {timeout: 15000, maximumAge: 60000}
  );
}

It uses phone location services (GPS, if its available, otherwise network-based location). In case of success it calls locationSuccess function. And in my tests it always called it, so location was determined successfully. Continue reading →

Solved: Issue with Pebble framebuffer after notification is dismissed

Effect Layer Issue I’ve encountered a weird issue while working with EffectLayer Library (a visual effect library for Pebble smartwatch). In this particular watchface called Clean & Smart I used “invert” effect which inverts colors of the watchface should the user choose that option in settings. It was working fine when option changed when watchface was loaded/unload and behaved weirdly only in one particular scenario: when you would receive a notification (email, text etc.) and then dismiss it. Upon coming back from notification to watchface invert effect would only partially cover the watchface (as seen on the screenshot).
I don’t know exactly what was happening, but had a theory. Continue reading →

Detect IFRAME click from parent page

If you need to detect a click on a Web Page, that’s trivial: just catch Document or Body onclick event and any element on the page you click will bubble the event to your handler.

But if one of those elements is an IFRAME – that won’t work. IFRAMEs contain other pages and their events a contained within their content and don’t bubble up. Luckily there’s a way. Take a look this snippet of jQuery code:

$('IFRAME').on('load', function () {
   $(this).contents().on('click', function () {
      alert('Click Detected!');
   })
})

It attaches handler to IFRAME’s content’s onclick event, but only after IFRAME has already been loaded. Place this code in parent page that contains IFRAMEs and it will work universally across all browsers to detect when IFRAME was clicked.

NOTE: As usual in these scenarios, this works only if parent page and children pages comply with Same Origin Policy.

Restore bricked HTC One M8

Today my trusty HTC One M8 informed me that OTA (over the air) update of system software is available. Android security updates. Naturally I let the system download and install the update. Unfortunately after install phone refused to boot – it was getting stuck on HTC logo on white screen. Bummer.

Now I researched “stuck on logo” topic in depth and tried different methods to unstick it. No dice. Moreover, after chat with HTC Support and following their advice phone would simple go to blank screen. Double bummer. Continue reading →

How to make your Pebble smartwatch really tick

“Tick tock, goes the clock, And Now what shall we play?”.

Pebble smartwatch is an amazing piece of hardware with no less amazing software to support it. Pebble appstore boasts huge variety of watchfaces from intricately carved art pieces to simplicity personified. And the apps, my gods the apps! You want to track your sleep, count swimming stokes, automate your home – Pebble can do all those things and more. But something was missing. Something that ordinary mechanical clocks could do since the dawn of time.

Tick tock, goes the clock, And then what shall we see?
Continue reading →

Solution: Windows 10: Unable to start Appstore apps

Ok, I went ahead and upgraded to Windows 10. everything went smoothly, all my settings and installed apps preserved and work without a hitch. I am loving the interface and getting along with Cortana pretty good.

But after a while I encountered a weird issue: Appstore installed apps – e.g. Calendar, Mail etc. even Windows AppStore itself wouldn’t launch. I’d either get a cryptic error message, something along the lines “Application did not start, please contact system administrator” or very briefly a window would appear and immediately closed.

Looking into Event log was a bit more explanatory, but not too much: “Microsoft.WindowsStore_8wekyb3d8bbwe!App failed with error: Access is denied. See the Microsoft-Windows-TWinUI/Operational log for additional information.

If you google it – you will find many possible explanations of the problem and many possible ways to solve it offered, but none of those worked for me. Finally I figured it out (and Event Log entry gave me a clue): C:\Program Files\WindowsApps folder was missing necessary permissions:

WindowsApps

Namely, “ALL APPLICATION PACKAGES” was missing read & execute permissions on that folder (had to to uncheck “Hide protected operating system files” in Control Panel, File Explorer options to be able to see it). Once I added correct permissions – appstore apps started launching with no problems.

Sprite animation on original classic Pebble smartwatch

SDK 3.x for Pebble Time smartwatch offers cool and very convenient set of functions to create animation from your existing GIF or MP4 via APNG support. APNG is an obscure “Animated PNG” format (at the time of the post only Mozilla Firefox supports it) but it’s very powerful and can store animation in much more compressed format than traditional animated GIF, so Pebble chose it for a reason. So if you have a GIF, convert it to APNG with Gif2Apng (or if you have a video, convert MP4 to GIF first and then to APNG) and you’re ready to use it on Pebble Time. Just keep the size in check, since Pebble has to load entire APNG sequence in memory, try not to go overboard. The first video is showing animation from my “Vortex” watchface using this approach on Pebble Time.

But what about original classic Pebbles? Eventually they will get firmware 3.x and SDK 3.x support and with that APNG functions among other advantages, but at the time of this writing it is still hazy when this is going to happen. But where there’s a will there’s a way – you can still use your MP4/GIF source for animation it’s just a bit more tricky. Instead of dealing with a single APNG file as your resource and relying on Pebble firmware to draw the frames you will need to help it a little.

First you will need to split your source into individual frames, for example using this service. Yes, you will be dealing with individual frames, so don’t go creating a Hollywood blockbuster. But don’t fret, it’s a bit more manual work, but you won’t have to hand-crank the moving pictures all the way.
Continue reading →