<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by NeverwinterMoon on Medium]]></title>
        <description><![CDATA[Stories by NeverwinterMoon on Medium]]></description>
        <link>https://medium.com/@neverwintermoon?source=rss-8f891ea98075------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gQslcY-rcyZ5EIol.</url>
            <title>Stories by NeverwinterMoon on Medium</title>
            <link>https://medium.com/@neverwintermoon?source=rss-8f891ea98075------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 08:30:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@neverwintermoon/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Migrating from Google Core IoT to ClearBlade IoT]]></title>
            <link>https://medium.com/@neverwintermoon/migrating-from-google-core-iot-to-clearblade-iot-a348ad4b8f0f?source=rss-8f891ea98075------2</link>
            <guid isPermaLink="false">https://medium.com/p/a348ad4b8f0f</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[google-cloud]]></category>
            <category><![CDATA[clearblade]]></category>
            <category><![CDATA[clearblade-iot]]></category>
            <category><![CDATA[google-iot-core]]></category>
            <dc:creator><![CDATA[NeverwinterMoon]]></dc:creator>
            <pubDate>Mon, 13 Feb 2023 09:41:42 GMT</pubDate>
            <atom:updated>2023-02-13T10:02:05.651Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v6oKgwSaTqjLZ6U2W860KA.png" /><figcaption>ClearBlade IoT</figcaption></figure><p>So, Google, true to its reputation, decided to discontinue its popular IoT Core service, the announcement came on August 16, 2022. After using it for only a year at that time, our company was already deeply invested in the service, with thousands of devices relying on it for sending and receiving telemetry data. To help users transition, Google provided a year for migration and I started searching for alternative options.</p><p>My first choice was AWS IoT Core, which I had already researched alongside Google IoT Core when we first started our IoT journey. At the time, I had no prior experience with either platform, but I found Google’s documentation to be much clearer and more helpful. It was full of code snippets and example projects, which made it easier for me to get something up and running quickly. On the other hand, Amazon’s documentation was overwhelming with a lot of text and hard to navigate.</p><p>Remembering my earlier difficulties with Amazon’s documentation, I decided to explore other options. A search on Google led me to ClearBlade, which had seized the opportunity to attract new clients just a day after Google announced the end of IoT Core. ClearBlade made bold claims of easy one-click migration of all devices from Google IoT Core and simple firmware changes to switch over.</p><p>Note that I performed all of these actions in February 2023, several months after Google announced its sunsetting plans and ClearBlade advertised and launched their migration path.</p><p>However, the migration process was not as seamless as advertised. On the firmware side, it was indeed as simple as changing the host by modifying just one line of code to point it from Google to ClearBlade. Migrating the fleet was a different story. In order to do so, I had to activate the ClearBlade IoT product on the Google Cloud Marketplace. I successfully subscribed to the product, but it was in a pending state. To resolve this issue, ClearBlade required me to create a new account on their side, even though I already had an account with them that was registered a month prior and used the same email as the one I used for the Google Cloud service I was trying to migrate. This was extremely frustrating. I’ve tried using the existing account multiple times, but the product was stuck in the pending state that way.</p><p>A similar negative experience occurred a month prior when I was invited to join a prototype project with ClearBlade. The platform wouldn’t accept my automatically generated password from LastPass or Apple, and I had to manually edit it multiple times in order to register.</p><p>To transfer the existing fleet from Google IoT Core to ClearBlade, I was instructed to create a service account with specific permissions, create a service account key, export it as a file, and then import it into ClearBlade. This raised security concerns for me. I had been using Google’s service account keys three years ago, but since then, Google has recommended against using them for security purposes. Instead, they suggest using Workload Identity Federation, which I had already started using for GitHub CI. None of our services at this point use service account keys, which was another negative point for ClearBlade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/0*PR-hnKCkPkHZtDpf.png" /></figure><p>Anyway, I created the service account key and fed it to ClearBlade, eager to see the advertised one-click migration. It was there, but it was a disappointment once again. The fleet migration on the ClearBlade web console was limited to just 10 devices. It appeared to be a feature for testing purposes only, not for migrating the whole project, and I was disappointed. I double-checked, but nowhere was this feature positioned as being for testing only. ClearBlade simply advertised one-click migration, and that was it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*zo__8AhX4RKv5ZjS9B1mJA.png" /></figure><p>The actual full migration of the fleet involved using a special script, which can be found here: <a href="https://github.com/ClearBlade/clearblade-iot-core-migration">https://github.com/ClearBlade/clearblade-iot-core-migration</a> . The script took around an hour to migrate our fleet of thousands of devices, running on my machine. It might have been faster if it was run in the Google Cloud instance in the same region as our Google services. The migration took care of everything and moved all devices with their public keys to ClearBlade.</p><p>The moment of truth arrived when our firmware engineer tested with an actual device connected to ClearBlade. After modifying just one line of code on the firmware side (the host), the connection worked, but it was much slower than when connected to Google IoT Core. This is the worst of all the negative experiences I’ve described, as the migration steps only need to be done once, but the slower connection for all devices will be an ongoing issue. To be fair, this was a test with a single device. We are planning on having a more through test with more devices in the nearest future.</p><p>Furthermore, the user interface at [<a href="https://iot.clearblade.com/](https://iot.clearblade.com/)">https://iot.clearblade.com/](https://iot.clearblade.com/)</a> is not as user-friendly as the one at Google Cloud. For example, to edit the details of a project, you have to navigate to it from the project dropdown menu, which opens a new view and deselects the current project. Once you’ve finished editing the project details, to return to the registry overview of the project you have already selected before, you need to reselect the project from the dropdown menu. In contrast, on Google Cloud, you simply select the project and can perform all other actions, such as viewing the fleet overview or the account details, within the selected project.</p><h3>To sum up</h3><ul><li>The creation of a ClearBlade account was a challenging experience, as it did not accept commonly used automatically generated passwords, such as those generated by LastPass and Apple.</li><li>Activating the ClearBlade IoT product on the Google Cloud Marketplace was not possible with an existing ClearBlade account. It was necessary to create a new account entirely.</li><li>The advertised “one-click migration” was not as advertised, as it was only suitable for testing and not for a full migration of the project. The actual migration required the use of a special script.</li><li>In addition, the ClearBlade migration requires a Google service account key, which is considered an anti-pattern according to Google’s advice to use Workload Identity Federation instead of service account keys.</li><li>During the initial simple test with a single IoT device, the ClearBlade service was significantly slower than that of Google IoT Core.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a348ad4b8f0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PNG optimization on iOS and libpng]]></title>
            <link>https://medium.com/@neverwintermoon/png-optimization-on-ios-and-libpng-f9c5139dbb44?source=rss-8f891ea98075------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9c5139dbb44</guid>
            <category><![CDATA[cgbi]]></category>
            <category><![CDATA[libpng]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[png]]></category>
            <dc:creator><![CDATA[NeverwinterMoon]]></dc:creator>
            <pubDate>Mon, 31 Dec 2018 11:43:59 GMT</pubDate>
            <atom:updated>2018-12-31T11:45:52.114Z</atom:updated>
            <content:encoded><![CDATA[<p>We are using some legacy code in our iOS app that renders a simple 3D image using a texture atlas and OpenGL. The whole app is written using the latest Swift version, but the part that uses OpenGL — in Objective-C. I don’t know Objective-C, but that’s for a very good reason — the code written in that language has to be the least readable code I’ve ever seen written. Luckily, I had no need to touch that code for over a year now.</p><p>This week, the business came up with a requirement to update the look of the 3D image. I was given new texture atlas in PNG format and I assumed it’s going to be a walk in the park — I still won’t need to touch the code, and I’ll just swap one atlas for another.</p><p>The old texture atlas files were regular PNG files, but for some unknown (to me) reason, they had a weird extension. Internally the files were read by libpng, so there was no reason for them to have a different extension. I am always trying to understand (and possible change, if it makes things easier) what is unclear to me, so I’ve added the new atlas files with a regular PNG extension instead of renaming them to the custom one used in the legacy code. This is how I ran into the problem I couldn’t understand at all at first. libpng couldn’t read the new files complaining about some CgBI chunk.</p><p>The problem was with Xcode optimising all of the PNG files which are not a part of Assets by default and converting them to Apple’s non-standard PNG format — CgBI (<a href="http://iphonedevwiki.net/index.php/CgBI_file_format">http://iphonedevwiki.net/index.php/CgBI_file_format</a>). This format adds that extra header that couldn’t be recognised by libpng. This explains why someone before me decided to use some weird custom extension — to avoid Xcode running optimisation on the files. It was one way to solve the problem but there is another one, too. As soon as you add any PNG files to your project outside of Assets, a new set of options appears in the Build Settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*6g3U_nDg-a9boi7bVtFH4Q.png" /></figure><p>The above is the default state. For libpng to work in my case, I had to set both options to no. Then it started working nicely.</p><p>Some interesting links:</p><ul><li><a href="https://developer.apple.com/library/archive/qa/qa1681/_index.html">https://developer.apple.com/library/archive/qa/qa1681/_index.html</a></li><li><a href="https://imageoptim.com/xcode.html">https://imageoptim.com/xcode.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9c5139dbb44" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>