Tales of Modest Success…

Lots going on – to summarize:

  • The recent site breakage was a result of serving mime type ‘*’ as ‘application/octet-stream’, to transfer jpeg images around for the camera project. Bad idea, as it broke this site.


  • Not using atom.io as an editor for this site is a major pain. Now that I have it mostly configured the way I like, using an editor that doesn’t auto-close tags, etc feels like using a manual typewriter.


  • The JPEG serial camera is working, and I think I know why they break now: Not all drivers are VC-0706, even if they look like it with a glance at the protocol. Worse, there are some mismatches between some of the available datasheets and the sample drivers (ie, Adafruits). The Adafruit driver should be considered gold (and it’s also where I got this camera from).


  • I spent a day and put together a companion/watch app for the Fitbit Versa that can fetch the security cam image and transfer and display it. The Versa is 350×350, so looking at a 320×320 image is fine. There is lag (it’s a serial camera, after all), but I’ll work to cut that time down as a side project.


  • While watching the console for watch and companion log messages, I noticed that the companion app was running some of the other test apps I’d sideloaded from Fitbit Studio, but wasn’t running on the watch. I suspect this is why the phone battery dies so quickly now; it’s not a 100% fitbit fault, it’s because I have a sideloaded app that is constantly trying to update it’s GPS coordinates and get network data on the phone. Although fitbit could do better to control runaway usage, it looks like it’s also up to the developer to add in some kind of ‘pause’ logic if the user isn’t interested in an app.


  • Hosting said jpeg image on the internet turned out in the end to be simple – but the journey took way too much time & testing:
    • Fetching an image from the Fitbit companion app (the part that runs on your phone), must be, for Android at least, https. Without https it just doesn’t work, and gives no error why.
    • Ok, so can I get ‘free’ https web hosting? That’s a two-part question;
      • Can you get a free cert? Yes; Let’s Encrypt (LE SSL) does just that, and they use domain info instead of IP’s, so it works on shared hosting.
      • Can you get free https hosting? Yes – but no. There are free hosts, but as part of the LE SSL first-time config process they answer each web request with a fragment of javascript meant to thwart bots (aes.js), so the SSL config process breaks.
      • There was no way I was going to sign up for another domain name, another web host, dns hosting, etc just to test a function call. Luckily I checked back with the dev forums on fitbit…
    • Thanks to fitbit community member lifetaker for the post about https. Two suggestions were made, and the obvious simple answer is to use a URL shortener like bit.ly. They front-end the request from the fitbit companion with https, and then things work as expected.


  • The camera serial protocol has some warts, but it did remind me that I’m not standardizing the serial link between the ESP chips and the AVR boards in the simplest way possible, and the VC0706 protocol is pretty simple (and could be simpler with fixed length admin commands). That deserves it’s own post, which I’ll do when I implement it for a sensor project that’s been running for a year but not sending it’s data anywhere but a WS2812 LED.


  • Not related to the camera, but a more foundational experiment, I did another iteration of a CRUD app for Vue.js + mongodb (and Axios, and Express). Part of working through the idea of putting the db schema in code (as a model) made me look back at the complexity of using URLs and JSON together, where it could be simpler, especially when all I need to do is POST a few fields of data to local data hub. That also deserves it’s own post.