<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="//www.w3.org/2005/Atom">
  <channel>
    <title>Midnight.Computer</title>
    <description>This is a blog with all of my technical ramblings, experiments, and whatnot.
</description>
    <link>https://midnight.computer/</link>
    <atom:link href="https://midnight.computer/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 17 Dec 2018 22:08:58 +0000</pubDate>
    <lastBuildDate>Mon, 17 Dec 2018 22:08:58 +0000</lastBuildDate>
    <generator>Jekyll v3.5.2</generator>
    
      <item>
        <title>wireless ergodox because why not</title>
        <description>&lt;p&gt;I’ve done kind of a lot of keyboards at this point. I made two &lt;a href=&quot;https://atreus.technomancy.us/&quot;&gt;Atreus&lt;/a&gt; from a kit, modified one to be wireless, and then almost completely rebuilt it after stepping on it and crushing the case. Then I got into Ergodox, and built one of those from an &lt;a href=&quot;https://input.club/devices/infinity-ergodox/&quot;&gt;ok kit&lt;/a&gt; from Input Club. Finally, I decided 40% boards are not really for me, so I made a &lt;a href=&quot;https://www.instagram.com/p/BjgfmlxHbZT/&quot;&gt;compact wireless planck&lt;/a&gt; that didn’t work terribly well ergonomically.&lt;/p&gt;

&lt;p&gt;So, I have a lot of boards, and they’re all of the microcontroller with matrix variety. They were all kits because I thought hand-wiring was a pain in the ass, and large PCBs tend to be expensive to have custom-made for a one off. But, time moves on and I’d heard about what’s called ‘hand wiring,’ where you don’t need a pcb to hold the switches. I got some plates for an ergodox from a european company for a steal, and bought switches from Mouser. Then, this fall happened, in which I was super busy with work and travel and so nothing got done.&lt;/p&gt;

&lt;p&gt;Thinking about it, though, that’s not true; I designed the thing and managed to solder all the components together before I went on vacation in October. I used an adafruit feather M0 w/bluetooth that I had sitting around, since they’re great for wireless keyboards, and the Boldport Ixpando, which is a breakout for the microchip MCP23017, a 16-bit i2c shift register. I read a couple guides on hand-wiring, bought a bunch of diodes, and threw it together. The bottom plates are some 3/16” aluminum I just happened to have laying around. Brass standoffs and M3 machine screws hold the key plates to the base.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://midnight.computer/images/ergodox/IMG_2534.JPG&quot; alt=&quot;Matrix Wiring&quot; /&gt;
&lt;img src=&quot;https://midnight.computer/images/ergodox/IMG_3188.jpeg&quot; alt=&quot;More matrix&quot; /&gt;
&lt;img src=&quot;https://midnight.computer/images/ergodox/IMG_2624.jpeg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After I got that done, it sat for a couple months while other matters occupied my time. But, eventually I got back to it and modified my existing wireless keyboard firmware to work with the shift register. That’s a project that’s still ongoing, because there’s still a tiny bit of lag; 25ms to scan is a little too long. I’ve wrestled with it quite a bit just to get it to work, but it finally does.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://midnight.computer/images/ergodox/IMG_3233.jpg&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;https://midnight.computer/images/ergodox/IMG_3232.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;(If you look closely you can see that the battery is disconnected; that’s because I was debugging, but it works just fine. I do need to put in an on/off switch…)&lt;/p&gt;
</description>
        <pubDate>Mon, 17 Dec 2018 19:45:25 +0000</pubDate>
        <link>https://midnight.computer/2018/12/17/wireless-ergodox-because-why-not.html</link>
        <guid isPermaLink="true">https://midnight.computer/2018/12/17/wireless-ergodox-because-why-not.html</guid>
        
        
      </item>
    
      <item>
        <title>iphone x</title>
        <description>&lt;p&gt;I just read the &lt;a href=&quot;https://www.ifixit.com/Teardown/iPhone+X+Teardown/98975&quot;&gt;iFixit teardown of the new iPhone&lt;/a&gt;. The new phone is a remarkable piece of technology but I’d like to draw your attention to one image in that post:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d3nevzfk7ii3be.cloudfront.net/igi/OYsIHWAHwVUNSilS&quot; alt=&quot;Image courtesy iFixit and their Creative Commons license&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now, to most of you I’m sure this looks like a bunch of blobs and glitter, separated by large rectangles. It’s really a lot more than that though, and I’d like to talk about what I see when I look at this photo.&lt;/p&gt;

&lt;p&gt;It’s a product shot, evenly lit, on a bright white background. The product stands in stark contrast to the cleanness of the surface it’s shot on. But other than that, it’s not much to write home about, aesthetically.&lt;/p&gt;

&lt;p&gt;This picture is all about details, though. The surfaces of both sides of the interior of this PCB sandwich are a perfect &lt;em&gt;horror vacui&lt;/em&gt;; every available space is covered. That means that almost none of the area on the top of the board is given over to traces, the lines on the board that actually connect the part; it also means there are a large number of blind and buried vias, which are both more expensive and error prone. I see this and I think, that’s gotta be at least an 8 layer board on each side.&lt;/p&gt;

&lt;p&gt;Then I start to think about how I would design this. The upper bound for the number of traces, every pin discreetly connected to every other pin, is on the order of millions of them, but I’d be surprised if there were more than 10,000 “nets” (that is, discreet connections between sets of pins). For reference, my watch has 100, and took me a week to route. The engineers that built this board could do mine in an hour or two, probably; so we’re talking 1,000 engineer-hours just to route the connections on the boards. That’s one guy and 6 months, or a team of 10 (with managers) and 2 months (because engineering time doesn’t scale lineraly; coordination of effort takes time, too).&lt;/p&gt;

&lt;p&gt;It’s probably a team of 20 and consistent 1 month iterations; they have to do quick turns for problems and changes in the supply chain, uncertainty about whatever parts come in, alternate versions for different vendors for different parts (different cellular radios, sensors, whatever). There’s a lot of uncertainty when you begin a project like this. You don’t know what the vendors can &lt;em&gt;really&lt;/em&gt; deliver in 18 months in quantity 100 million. That’s not 20 engineers total, but 20 for this small facet of the overall design.&lt;/p&gt;

&lt;p&gt;For example, the cameras. The cameras, even one of them but especially both of them, represent an amazing amount of work. The sensors had to go through design and testing; the optical systems, likewise. They have autofocus and optical image stabilization, which is completely nuts. Not just “man this is a lot of engineering” but “are we sure apple isn’t working with aliens on this one?” nuts. (It’s really just the progression of a bunch of related tech, including accelerometers and very small electromagnets, but I digress).&lt;/p&gt;

&lt;p&gt;Even once you have that design, it’s not done; there are assembly and process engineers that have to do their work, too. The robots that place components work a certain way, and the tool paths that put the components in place have to be right, or there’ll be too many failures.&lt;/p&gt;

&lt;p&gt;There are a couple other interesting facts I’ve gleaned from this picture: they’re using what look like chip antennas for bluetooth and WiFi, which is a little odd. I could be wrong about what those pink blobs are, though; usually the antenna is part of the metal bezel on the outside of the case (those may be test antennas or something, too). There’s the crazy notch in what turns out to be the bt/wifi chip to accommodate a big capacitor (first spotted on twitter by someone else). That either means the supplier put that there and they’re taking advantage of the board area, or &lt;em&gt;apple asked them to make that notch&lt;/em&gt;. Nuts.&lt;/p&gt;

&lt;p&gt;So, yeah. I might have to pick one up.&lt;/p&gt;
</description>
        <pubDate>Tue, 07 Nov 2017 07:25:53 +0000</pubDate>
        <link>https://midnight.computer/2017/11/06/iphone-x.html</link>
        <guid isPermaLink="true">https://midnight.computer/2017/11/06/iphone-x.html</guid>
        
        
      </item>
    
      <item>
        <title>towards an open internet of things</title>
        <description>&lt;div style=&quot;width: 500px;&quot; class=&quot;center&quot;&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;en&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Someone should go and invent an open standard and build a bunch of devices on it&lt;/p&gt;&amp;mdash; photomattmills (@photomattmills) &lt;a href=&quot;https://twitter.com/photomattmills/status/910361827166638081&quot;&gt;September 20, 2017&lt;/a&gt;&lt;/blockquote&gt;&lt;script async=&quot;&quot; src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;&lt;/div&gt;

&lt;p&gt;this reply of mine was kind of meant to be flippant, but it really got me thinking, what would it take to make a truly open IoT platform? What does that look like?&lt;/p&gt;

&lt;p&gt;So first, and this is a thing &lt;a href=&quot;http://interconnected.org/home/2017/08/16/smart_home&quot;&gt;Matt&lt;/a&gt; said as well: it needs to work without the internet. Manual controls, default modes, all need to be part and parcel of the thing. Like smartwatches: most of them don’t gracefully fail to ‘just a watch’ when you first have them and haven’t set them up, they just fail completely to do anything. Smart bulbs are another example: If I spend $60 on a smart bulb, it better turn on and respond to a fucking dimmer out of the box without an app. It’s not too much to ask; I know this because I’ve designed lightbulbs before.&lt;/p&gt;

&lt;p&gt;So: let’s say you have the OpenHome app (terrible name, we’ll have to iterate on that), and you buy a light bulb that supports it. What does that setup look like? Ideally, you plug in the bulb, it turns on a bluetooth 4.0 radio and announces it’s there to the world; your app sees it and tells you there’s a new device, would you like to pair?&lt;/p&gt;

&lt;p&gt;So, first: the device must work under all circumstances the dumb device worked. Second, service discovery and connection needs to be fairly seamless. once that’s done, the device needs to advertise what sensors and services it offers. If only we had an API for dynamically building APIs lying around… oh yeah, &lt;a href=&quot;http://graphql.org/&quot;&gt;GraphQL&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So the first thing you query for is a list of supported things to adjust and sense, and make a UI that doesn’t suck for things like adjusting temperature and color and volume; and then just enable the sliders (come on, we know it’ll be some sliders) that the service supports. For our hypothetical light bulb, it could be on/off (boolean), brightness percentage (interger out of 100), and maybe color (RGB hex, so an INT). Our hypothetical app has default and customizable, sharable setups for all of these values. You also need to be able to group devices (turn off all the lightbulbs etc).&lt;/p&gt;

&lt;p&gt;Ideally you’d have a little wall-wart server (remember those? what a joke in these days of raspberry pis and &lt;a href=&quot;http://vocore.io/&quot;&gt;vocores&lt;/a&gt; &amp;amp;c) that you plugged in and actually all the new smart devices talked through it, so when you wanted to add a control device (tablet, phone, friend house sitting) it just joins the wifi, open the OpenHome app, it detects the OpenHome server (couple ways to do this), it asks you if you want to control all the things, and pings authorized users for ackles. Then, the same service discovery mechanism that works for one device will load the whole home into the newly minted authorized user’s device.&lt;/p&gt;

&lt;p&gt;Will anybody implement this? Probably not.
&lt;span style=&quot;display:block;&quot; class=&quot;center&quot;&gt;
&lt;/span&gt;&lt;/p&gt;
</description>
        <pubDate>Wed, 20 Sep 2017 04:41:11 +0000</pubDate>
        <link>https://midnight.computer/2017/09/19/towards-an-open-internet-of-things.html</link>
        <guid isPermaLink="true">https://midnight.computer/2017/09/19/towards-an-open-internet-of-things.html</guid>
        
        
      </item>
    
      <item>
        <title>laptop shenanigans</title>
        <description>&lt;p&gt;There is something wrong with me. Well, several things wrong with me, but I’m here to talk about laptops. Every couple years, I get tired of paying the apple tax, and get it into my head that I’m going to either&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Take some PC hardware and make it a hackintosh&lt;/li&gt;
  &lt;li&gt;Make this year the year of linux on the desktop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, for the last 9 months or so I’ve been screwing around, all the while my main machine was a pretty lackluster Macbook. It has times where it’ll just seize up suddenly. I’d had it maybe three months when I bought a Lenovo with the intention of turning it into a hackintosh, and when that didn’t work out, I tried to be an Ubuntu user for a month. That &lt;em&gt;almost&lt;/em&gt; worked.&lt;/p&gt;

&lt;p&gt;Eventually I gave up and committed to suffering with the macbook a little longer. There’s only so much of that I can take, though, so about a month ago I started again, in earnest. I figured I’d give a different distro a try, so I downloaded and installed &lt;a href=&quot;https://elementary.io/&quot;&gt;Elementary&lt;/a&gt; on the Lenovo. It’s a really great desktop distro. Polishes a bunch of the rough edges of Ubuntu with a custom window manager, and some sensible defaults. No cruft at all, and runs really well.&lt;/p&gt;

&lt;p&gt;It came down to a couple missing pieces of software though. The lightroom replacement, Darktable, well, it sucks. Like, its error conditions were difficult to troubleshoot for me, and I’m a developer. The UI is plain bad (sliders that are 4px on a side? who thought that was a good idea?). The methods for organizing photos are sub par. It’s possible it’s like KiCad and I’m a couple hours of video tutorials away from happy productivity, but I really doubt it. The aesthetic sense of the person who designed that UI… is just someone I’ll never understand. It’s like nobody told them it was supposed to look good, so they just threw all this junk in a bunch of different places.&lt;/p&gt;

&lt;p&gt;Enough ranting about darktable, except to say that it’s actually gotten a little better in the last 2 years. Not a lot, someone needs to put some money into it and completely re-design the UI with a cohesive strategy, but a little. Slightly less crashy.&lt;/p&gt;

&lt;p&gt;I did not, after that, try to find any 3d CAD software for linux. Blender is supposed to be usable, but it’s not really CAD, just 3D modeling.&lt;/p&gt;

&lt;p&gt;So, I’m writing this from a 13” macbook pro, fresh out of the box this afternoon. it’s a thing of beauty. Everything works. I can use my 4k display at 4k. I can &lt;em&gt;edit photos&lt;/em&gt; on that 4k display, and it’s marvelous. I’m reminded of basically every other tool I’ve used that’s suited for the job: it just gets out of the way. So yeah, I’m happy with the new machine.&lt;/p&gt;
</description>
        <pubDate>Fri, 01 Sep 2017 08:33:11 +0000</pubDate>
        <link>https://midnight.computer/2017/09/01/laptop-shenanigans.html</link>
        <guid isPermaLink="true">https://midnight.computer/2017/09/01/laptop-shenanigans.html</guid>
        
        
      </item>
    
      <item>
        <title>the setup</title>
        <description>&lt;h2 id=&quot;who-are-you-and-what-do-you-do&quot;&gt;Who are you, and what do you do?&lt;/h2&gt;

&lt;p&gt;I’m Matt Mills, I’m a programmer, a &lt;a href=&quot;http://matt.pictures&quot;&gt;photographer&lt;/a&gt;, and maker of &lt;a href=&quot;http://ourglass.watch&quot;&gt;watches&lt;/a&gt;, among other things.&lt;/p&gt;

&lt;h2 id=&quot;what-hardware-do-you-use&quot;&gt;What hardware do you use?&lt;/h2&gt;

&lt;p&gt;For the programming, a Mac laptop, currently a 13” Macbook Pro, maxed out. This was an upgrade from the teeny macbook, and what a difference the horsepower makes. One of &lt;a href=&quot;https://midnight.computer/2017/06/29/wireless-atreus.html&quot;&gt;several&lt;/a&gt; &lt;a href=&quot;https://input.club/devices/infinity-ergodox/&quot;&gt;ergonomic&lt;/a&gt; keyboards, and a 30” screen to plug it into on my desk. Programming happens mostly in my head, and the space between what I know and can find out with google.&lt;/p&gt;

&lt;p&gt;For the photography, I’ve got two main cameras, a &lt;a href=&quot;https://www.amazon.com/Fujifilm-X-Pro2-Body-Professional-Black/dp/B01A8DUR74&quot;&gt;Fuji XPro 2&lt;/a&gt;, and a &lt;a href=&quot;https://www.amazon.com/Nikon-D750-FX-format-Digital-Camera/dp/B0060MVJ1Q&quot;&gt;Nikon D750&lt;/a&gt;. For lenses, I’ve got a 14mm f/2.8 and 35mm f/1.4 for the fuji, and a 24-120mm f/4, a 500mm f/6.3 mirror, a 40mm f/2, and a 50mm f1.4/D for the Nikon. I also have a bunch of 35mm cameras I never use, and some medium format gear, notably a Fuji GW690 II. Epson V600 scanner and P600 printer (which I hadn’t noticed until just now they’re the same number).&lt;/p&gt;

&lt;p&gt;Like most photographers I know, I have a bag problem. Can’t find the perfect one, just keep trying. I used to really favor Domkes, but lately I’ve been carrying a &lt;a href=&quot;https://www.amazon.com/Think-Tank-Photo-Retrospective-Black/dp/B0080F65V0&quot;&gt;ThinkTank Retrospective 7&lt;/a&gt;. It holds the laptop, and whatever camera setup I’m hauling currently. I also use a home-made messenger bag that’s sort of an amalgam of the different bags I’ve had and liked. Enough volume for an extra layer, tools, or a light grocery run, along with camera and laptop. Waterproofed with sailcloth, which is light and very durable.&lt;/p&gt;

&lt;p&gt;For the making, too many hand tools to list, so maybe just my favorites? Knipex cutters, which are harder than nails at the business end. Not an expression: I’ve actually used them to cut framing nails. A Pfaff sewing machine that’s as old as I am, with “Made in West Germany” written on the front. A Printrbot simple metal, which I mostly just use to make watch cases. A hot-air reflow station, which makes so much possible when making and fixing circuits. Mitutoyo calipers; don’t skimp on your test equipment, since errors multiply each other.&lt;/p&gt;

&lt;p&gt;Phone is an iPhone 6s+, in one of the thinner Otterbox cases. I go through cases about 1 per 6 months. This one might make it till the Fall. My EDC: phone, keys (with &lt;a href=&quot;https://www.amazon.com/Swiss-Tech-ST66676-Polished-Multitool/dp/B0001EFSTI&quot;&gt;mini multitool&lt;/a&gt;, &lt;a href=&quot;https://www.amazon.com/gp/product/B00KPSHSMA/&quot;&gt;flashlight&lt;/a&gt;, &lt;a href=&quot;https://www.amazon.com/Yubico-Y-158-YubiKey-4/dp/B018Y1Q71M/&quot;&gt;Yubikey&lt;/a&gt;, and thumbdrive), a &lt;a href=&quot;https://www.amazon.com/dp/B00152RXH0/ref=cm_sw_r_cp_dp_T2_RByEzbPV9CTQ5&quot;&gt;yellow benchmade griptilian&lt;/a&gt;, &lt;a href=&quot;https://cwandt.com/products/pen-type-b?variant=30696392260&quot;&gt;Pen Type B&lt;/a&gt;, and my &lt;a href=&quot;https://decadentminimalist.com/products/dm1-aluminum&quot;&gt;wallet&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;and-what-software&quot;&gt;And what software?&lt;/h2&gt;

&lt;p&gt;On the desktop, it’s OSX with a ton of apps. Lightroom and Photoshop for photos, and if I’m working on images from the digital cameras, there’s never a reason to open photoshop. I’m typing this in Atom, the text editor from Github. It’s not the most amazing editor ever, but it works, and there are extensions for most of what I need; that’s for writing and coding. Tweetbot for twitter lists; I use private lists to make sense of the ~400 or so people I follow. I don’t try to get it all, except the friends list. Dropbox, although I don’t use it as much as I used to. Alfred, with the powerpack. Divvy, for fast window resizing. 1Password to keep me a little safer. Fusion 360 for CAD needs, except for electronics; all my circuits happen in KiCad.&lt;/p&gt;

&lt;p&gt;On the phone, it’s Kindle, Signal, Tweetbot, Instagram, Dark Sky, and Google Maps. Other apps as needed (hi Terminus).&lt;/p&gt;

&lt;h2 id=&quot;what-would-be-your-dream-setup&quot;&gt;What would be your dream setup?&lt;/h2&gt;

&lt;p&gt;Something as small and thin as the macbook, with a quad core i7 and ALL THE RAM. A full machine shop, with a big mill and engine lathe and a chest full of bits and cutters, and a pile of stock in various flavors. A pair of Leica M10s, with 21mm and 50mm lenses on the front, and a Leica S for when I wanted medium format.&lt;/p&gt;

&lt;p&gt;Enough money to pay off my student loans, and to give me time to take on freelance clients. I don’t need a fortune, although I wouldn’t say no if one was on offer.&lt;/p&gt;
</description>
        <pubDate>Thu, 27 Jul 2017 05:50:03 +0000</pubDate>
        <link>https://midnight.computer/2017/07/26/the-setup.html</link>
        <guid isPermaLink="true">https://midnight.computer/2017/07/26/the-setup.html</guid>
        
        
      </item>
    
      <item>
        <title>the cost of freelancing (why I don't do it)</title>
        <description>&lt;p&gt;So, I was having a conversation on twitter about the economics of freelancing, and it occurred to me that a lot of my peers had no idea what the overhead of employing someone actually was. The business shorthand is that employing someone usually costs double their salary per annum; a little less for higher salary workers (they don’t use any more toilet paper than other workers, but tend to need specialized tools and environments to do their work, so it evens out). So, here’s a list of basic annual costs for a tech worker, with notes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Laptop ($1500 amortized over a 3 year life) - $500&lt;/li&gt;
  &lt;li&gt;Monitor ($700 over 3 yr) - $233&lt;/li&gt;
  &lt;li&gt;Office space - This is a little thornier; in SF it can be as much as $75/sq ft; in the midwest, more like $5/sq ft. $500/month for the space in a shared office seems reasonable – $6000&lt;/li&gt;
  &lt;li&gt;Advertising, self-promotion, lead generation – $10000/yr (seems like a lot, but isn’t really)&lt;/li&gt;
  &lt;li&gt;Health insurance – $600/mo*12 $7200/yr&lt;/li&gt;
  &lt;li&gt;Internet (home/work) – $1200/yr&lt;/li&gt;
  &lt;li&gt;Office furniture – (again amortized over 3 years; chairs, desk, lamp, etc; has to look good for client meetings): $2000&lt;/li&gt;
  &lt;li&gt;Continuing education – Books, conferences, classes – $5000 (this is a low number; could easily double or triple)&lt;/li&gt;
  &lt;li&gt;Phone (have to keep up with the joneses, and yes this is a business expense) – $1000&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, we’re already at $33,133. And we haven’t eaten anything for the year yet. You could cut some of these corners and maybe lose 20-30%, but just to push this above the poverty line, you have to make at least $60,000 in a year, in a place that’s fairly cheap to live. This is for a salary equivalent of $27k.&lt;/p&gt;

&lt;p&gt;If we want to be a little more comfortable, a salary more in the $70k range would be good for someone in the midwest, in a decent sized city. Not “live in a fancy neighborhood with a family” nice, but suburbs with a family is maybe doable on that (don’t @ me, I know that’s not a lot of money for a family of four, but I know single moms that make a little less than that work). So that’s ~100k gross revenue with 2000 workable hours in a year (that’s 50 40 hour weeks and two for vacation) comes out to $50 per hour, right? Nope, because of &lt;em&gt;utilization&lt;/em&gt;. In order to make $50/hr work, the contractor has to work all 2000 hours that year, which never happens. 50% of the time is a good ballpark number, although there are good years and bad years. Which brings us to $100/hr, which is &lt;em&gt;still&lt;/em&gt; a really low rate, going from what I know people charge; there are a lot of other costs involved, and the market is pretty fierce. I know what I’d have to charge to make my salary and all those costs here in Oakland, and it’s more than double that.&lt;/p&gt;

&lt;p&gt;There are other compounding factors; I haven’t mentioned the accounting and tax preparation overhead, in both time and money spent. Nor have I mentioned the business development aspects that can’t be neglected if you want to stay in business for more than a little bit. There’s also the opportunity cost of doing business in a place that’s not a big market for your skills; you can end up spending a lot on travel and expenses just to land clients that way (which is why the 10k number up there might be wildly low; also none of that is billable). Sometimes, clients just don’t pay after work has been delivered; that’s also a cost of doing business, and going after them costs more.&lt;/p&gt;

&lt;p&gt;That’s not to say that it’s not doable. Many people enjoy the freelance hustle and flow. I’ve considered it myself, sometimes. But then I start to do some accounting like the above, and decide a salary isn’t so bad.&lt;/p&gt;
</description>
        <pubDate>Wed, 26 Jul 2017 23:51:29 +0000</pubDate>
        <link>https://midnight.computer/2017/07/26/the-cost-of-freelancing-why-i-dont-do-it.html</link>
        <guid isPermaLink="true">https://midnight.computer/2017/07/26/the-cost-of-freelancing-why-i-dont-do-it.html</guid>
        
        
      </item>
    
      <item>
        <title>wireless atreus with Adafruit Feather</title>
        <description>&lt;p&gt;This is a project that I’ve been pecking away at, a little at a time, for something like a year and a half. I knew it was possible, from the data sheets and example code. It just took me a long time to take the idea and make it into a reality. For context, I’m typing this on the finished board, and it works just as well as the stock Atreus.&lt;/p&gt;

&lt;p&gt;The first step to making this was to rip out the micro from my wired atreus. If you’re starting this from scratch, you may be able to do it cheaper, since there’s not much to recommend a PCB build over a hand-wired build. I did the kit at first because I didn’t have time to put the effort into figuring out everything I needed to build this by hand, and by the time I decided to make it wireless, I already had all the parts on hand. That said, here’s our bill of materials:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;One &lt;a href=&quot;https://www.adafruit.com/product/2829&quot;&gt;Adafruit Feather 32u, with bluetooth&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;One &lt;a href=&quot;https://www.adafruit.com/product/1609&quot;&gt;Perma-Proto&lt;/a&gt; or generic perfboard&lt;/li&gt;
  &lt;li&gt;one &lt;a href=&quot;https://atreus.technomancy.us/&quot;&gt;Atreus kit&lt;/a&gt; OR the list of keyboard parts&lt;/li&gt;
  &lt;li&gt;wire&lt;/li&gt;
  &lt;li&gt;solder&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keyboard parts (only needed if you don’t already have an atreus):&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;42 cherry key switches, panel mount in your preferred tactility. &lt;a href=&quot;http://www.mouser.com/ProductDetail/CHERRY/MX1A-E1NN/&quot;&gt;I like the blues, myself&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;42 signal diodes, such as &lt;a href=&quot;http://www.mouser.com/Search/ProductDetail.aspx?R=1N4148TRvirtualkey51210000virtualkey512-1N4148TR&quot;&gt;these&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;a mounting plate, which can be made by Ponoko or similar. Or 3d printed, if you have a big enough printer.&lt;/li&gt;
  &lt;li&gt;more wire&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The hand-wiring of a keyboard is beyond the scope of this post, and there are many good tutorials and videos of it.&lt;/p&gt;

&lt;p&gt;With the materials in hand, all that’s left is a bit of creative soldering. The idea is to use the perf board as an adapter. So, first, I soldered in some header at the right places to mate with the atreus’ holes. Luckily everything is on 0.1” headers, we just have to deal with a little offset. There are three pins we can’t use on the Feather, they’re the ones marked SCK, MOSI, and MISO. They’re required for the bluetooth part of the operation.&lt;/p&gt;

&lt;p&gt;You can see in the pictures how I’ve connected the feather to the header, and added some jumper wires to make everything work. It’s simple enough that I didn’t even bother doing a circuit diagram. A0-A5 line up with the shorter side, and the long side gets three jumper wires to pins 1, 2, and 3. If you’re hand wiring, you won’t need the adapter board, just solder each row and column to its own IO pin.&lt;/p&gt;

&lt;p&gt;I had to cut a hole in the top of my atreus’ switch plate, in order to get to the solder holes, but if you’re assembling from scratch with the kit, you should do all this before you put the switches in, and then solder the adapter/feather assembly into the main PCB.&lt;/p&gt;

&lt;p&gt;I also did a little modification to the feather: I switched out the JST connector for a micro-sized one that I had laying around. This allowed me to get away with slightly less height for the overall keyboard.&lt;/p&gt;

&lt;p&gt;Then, I added a toggle switch to the ground line coming from the battery, hooked that and the positive terminal up to another connector, and plugged in the battery. I used some of the exposed pads to anchor the last connector; the mechanical connections are not electrically connected, so it works out. I could have made my life slightly simpler by soldering wires directly to the board, but I hadn’t worked out the entire strategy in advance; originally, I was going to just connect the battery to the micro-connector.&lt;/p&gt;

&lt;p&gt;Once all that is done, and you have key the switches in, the firmware I’m using is &lt;a href=&quot;https://github.com/photomattmills/wireless_atreus&quot;&gt;here&lt;/a&gt;. It depends on the host OS for debounce; I haven’t had any issues yet on macOS, but YMMV, naturally. It’s otherwise kind of sloppy and in need of cleanup, but it works. The other thing is that there’s currently no third layer. Adding one would be pretty simple, but in practice I don’t need more than 84 keys (my ideal might be an atreus 64, actually).&lt;/p&gt;

&lt;p&gt;This project is sort of a starting point from which I’d like to do a couple more keyboards. There’s this, and there’s the wireless ergodox build I’ve had on the back burner for quite a while, and maybe an atreus64 now that I know they exist.&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;display:block;&quot; class=&quot;center&quot;&gt;
&lt;img src=&quot;https://photomattmills.com/images/wireless-atreus/IMG_4609.JPG&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;Illustration of my wiring. 30ga wire wrap wire to the rescue.&lt;/span&gt;
&lt;img src=&quot;https://photomattmills.com/images/wireless-atreus/IMG_4611.JPG&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;Side view of the adapter with the feather. Overall the assembly adds about 1/4” to the keyboard’s height.&lt;/span&gt;
&lt;img src=&quot;https://photomattmills.com/images/wireless-atreus/IMG_4768.JPG&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;Close up of the completed assembly. You can see the switch, which is just glued to the switch plate, and the various connectors.&lt;/span&gt;
&lt;img src=&quot;https://photomattmills.com/images/wireless-atreus/IMG_4767.JPG&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;Wider view of the completed board. I’m using some M3 standoffs to give me the required height.&lt;/span&gt;
&lt;img src=&quot;https://photomattmills.com/images/wireless-atreus/IMG_4765.JPG&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;The top of the completed keyboard. It’s somewhat battered, and I may do another when I get my laser cutter up and running (parts inbound), but that’s yet another post.&lt;/span&gt;
&lt;/span&gt;&lt;/p&gt;
</description>
        <pubDate>Thu, 29 Jun 2017 00:21:24 +0000</pubDate>
        <link>https://midnight.computer/2017/06/28/wireless-atreus.html</link>
        <guid isPermaLink="true">https://midnight.computer/2017/06/28/wireless-atreus.html</guid>
        
        
      </item>
    
      <item>
        <title>notes on disassembling an SLR lens</title>
        <description>&lt;p&gt;So, this isn’t a detailed teardown of this lens; if you want that, maybe hit me up and I’ll give you a blow-by-blow over some beers. This is a general set of guidelines for doing dissassembly of something complex that you need to do something to, but don’t really know how it should be assembled. For anyting other than a lens, just substitute it in; I use the same techniques on laptops or computers or telescopes or whatever.&lt;/p&gt;

&lt;p&gt;Firstly, I’ll pass on a tip I read somewhere when I was about half the age I am now: when disassembling, imagine the machine is a bomb, and if you pull too hard or force something it will go off. The metaphor extends: the bomb will blow a hole in your bank account.&lt;/p&gt;

&lt;p&gt;So: what will you need? First: the right screwdriver, wrench, pin-spanner, or other tool as required. For this job, it was an assortment of 000 and 00 philips head screwdrivers. Disassembly of lenses requires the right tools. You &lt;em&gt;can&lt;/em&gt; make the attempt without the tools, but it most often ends in damaging something; I have a 50mm 1.2 Canon (in Leica thread mount) with a damaged rear element to testify to this fact.&lt;/p&gt;

&lt;p&gt;Second: calm. A person or people designed the lens; you’re also a person, and you’re capable, with a little thought, of understanding the design, at least of the mechanical parts. Further, the assembly of the lens was left to people on an assembly line in a factory, so it shouldn’t be rocket science to take it apart and put it back together. It helps to be able to stop the work when you’re tired, and come back fresh later.&lt;/p&gt;

&lt;p&gt;So, to help facilitate that, I do a couple of things. I take pictures as I go, just on my phone camera, to help me note the orientation of parts and screws, and to remember the order that things came apart in. Sometimes one or two pictures is sufficient; sometimes, like this repair, I’ll take pictures of every part as they come off. (I’m not showing all of them, because that would be pretty boring).&lt;/p&gt;

&lt;p&gt;I have a screw tray, usually just some container that also happened to be on my desk, to put the screws in as they come out. The gray one you see here is concrete, part of a desk set I got and didn’t know what to do with. Small parts also go here, since they are just as easy to lose.&lt;/p&gt;

&lt;p&gt;The large parts just get knolled into rows as they come off, since they’re harder to lose. I actually stopped this repair in the middle, had dinner, watched some TV, and then went back to it, knowing all the things I needed to know to finish it were there.&lt;/p&gt;

&lt;p&gt;Once the lens is apart, you can do whatever repair brought you here in the first place. In my case, the helicoids had gotten dirty over years of use, and I needed to clean them. I used isopropyl alcohol, a toothbrush, and paper towels for cleanup. It’s not the strongest degreaser, but half of the threads were plastic, and I didn’t want to chance melting them. Instead of grease, I wiped on some machine oil, and began reassembly.&lt;/p&gt;

&lt;p&gt;Often the hardest part of lens repair is reassembly. Getting the helicoids mated properly (with the correct rotation) I always find really difficult, and a matter of trial and error. Once that’s done, the rest I find pretty easy, just a matter of getting the right screws in the right places.&lt;/p&gt;

&lt;p&gt;Some other notes: Ribbon cables are especially delicate, and nearly impossible to repair. Do everything in your power to avoid pulling on them or bending them too much. If the optics in the lens aren’t a sealed unit aligned at the factory, make a note of the number of turns you make getting it apart; this may help with alignment (but if you’re trying to align lens elements, you’ve gone beyond the scope of this guide).&lt;/p&gt;

&lt;p&gt;Good luck and happy hacking!&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;display:block;&quot; class=&quot;center&quot;&gt;
  &lt;img src=&quot;//photomattmills.com/images/lens-rebuild-processed/0001.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;&lt;/span&gt;
&lt;img src=&quot;//photomattmills.com/images/lens-rebuild-processed/0002.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;&lt;/span&gt;
&lt;img src=&quot;//photomattmills.com/images/lens-rebuild-processed/0003.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;&lt;/span&gt;
&lt;img src=&quot;//photomattmills.com/images/lens-rebuild-processed/0004.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;&lt;/span&gt;
&lt;img src=&quot;//photomattmills.com/images/lens-rebuild-processed/0005.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;&lt;/span&gt;
&lt;img src=&quot;//photomattmills.com/images/lens-rebuild-processed/0006.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;&lt;/span&gt;
&lt;img src=&quot;//photomattmills.com/images/lens-rebuild-processed/0007.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;&lt;/span&gt;
&lt;img src=&quot;//photomattmills.com/images/lens-rebuild-processed/0008.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;caption&quot;&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/p&gt;
</description>
        <pubDate>Tue, 21 Feb 2017 05:54:11 +0000</pubDate>
        <link>https://midnight.computer/2017/02/20/notes-on-disassembling-an-slr-lens.html</link>
        <guid isPermaLink="true">https://midnight.computer/2017/02/20/notes-on-disassembling-an-slr-lens.html</guid>
        
        
      </item>
    
      <item>
        <title>senoko pt 2 and other notes on higonokami bringup</title>
        <description>&lt;p&gt;So, over the last couple weeks, I’ve been making progress on the new laptop, which I’ve been calling ‘higonokami’, after the Japanese style of pocket knives. I have this thing for naming my laptops after simple machines. Anyway, progress has been steady.&lt;/p&gt;

&lt;p&gt;First, building the senoko. I recieved my boards from OSHpark and they were great. I still have two extras and no idea what to do with them. The stencils I ordered at first were for the wrong version of the board, so I had to re-order them. It was just as well that I was delayed a couple days, until the weekend. I started working on the board at around 9pm saturday and took it out of the oven at 2am sunday. It programmed immediately but there were a few solder bridges I didn’t catch that caused it not to work right away.&lt;/p&gt;

&lt;p&gt;Before I get too far into the bringup, I’d like to diverge into talking about placing all those components by hand, which took most of 4 hours. I was working from the BOM and trying to place all the components of one type at once; all the 100k resistors, all the FETs, etc. About halfway through, I realized it would have been quicker to organize all the parts first, and then go over the board in one pass and place them by reference as I found them. I got it done, anyway.&lt;/p&gt;

&lt;p&gt;So, back to the bringup. I got it programmed, and then had what I thought were issues with the gas gauge. As it turns out, it just takes a little time to settle down. But, I decided I’d replace the one on the board with a spare, and try that. After that had the same issues, I started messing with the battery connector, and ended up shorting it, damaging the gas gauge and a current sense resistor. I thought it was just the gas gauge, since it started showing new worse symptoms, so I ordered a couple more and didn’t work on it for a week while I waited for parts.&lt;/p&gt;

&lt;p&gt;When the new chips came in, I got one installed with my reflow setup (hot air is an essential tool), and saw it having the same issues. So, I went to the schematic, and stared at it for a while. I saw that maybe the current sense resistor had something to do with something, so I tried shorting it, and suddenly the GG came to life. A few minutes and a spare resistor later, it was working fine, and the battery was charging. Shortly after that, I was able to unplug it from the AC adapter, and confirm everything was working.&lt;/p&gt;

&lt;p&gt;So, with that done, I’ve been focusing my efforts in two areas: getting the software setup reasonably squared away, and getting an adapter made for the LCD I’m using. The board I’ve made is just a passthrough to adapt one cable type to another. I’m using a comercial board with the same chip as the eDP adapter that came with the novena kits.&lt;/p&gt;

&lt;p&gt;The software has been a little more complicated. This is an ARM laptop, armhf arch. There are some things precompiled, for example Chromium is available pretty easily, but Atom is not, and some other creature comforts aren’t here. There’s no onepassword port, even to Linux. Most of the debs I’ve been getting from the ubuntu 14.04 repos. Also, there’s no lightroom equivalent, so I may have to get creative.&lt;/p&gt;

&lt;p&gt;In near future: a sheet metal case for this beast, clamshell, just like any other laptop. Friction hinges from McMaster Carr make that possible. Also, the LCD bringup is soon. That’ll pretty much finish this off. I’d like to have it done in time for our trip to oklahoma. We’ll see if that actually happens.&lt;/p&gt;

</description>
        <pubDate>Sun, 27 Nov 2016 08:24:16 +0000</pubDate>
        <link>https://midnight.computer/2016/11/27/senoko-pt-2-and-other-notes-on-higonokami-bringup.html</link>
        <guid isPermaLink="true">https://midnight.computer/2016/11/27/senoko-pt-2-and-other-notes-on-higonokami-bringup.html</guid>
        
        
      </item>
    
      <item>
        <title>building the senoko power board</title>
        <description>&lt;p&gt;TL;DR – board is shared on OSHPark &lt;a href=&quot;https://oshpark.com/shared_projects/x3IpMg2U&quot;&gt;here&lt;/a&gt;, BOM is at mouser &lt;a href=&quot;//www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=6572045792&quot;&gt;here&lt;/a&gt;, and stencils from OSHstencils &lt;strike&gt;(you should be able to export the cream layers from the KiCAD versions of the board [here](//bunniefoo.com/novena/novena-accessories-kicad.zip))&lt;/strike&gt; CORRECTION: get the PVT gerbers &lt;a href=&quot;//bunniefoo.com/novena/pvt2_release/gerbers-senoko_pvt1.zip&quot;&gt;here&lt;/a&gt; and use the &lt;code class=&quot;highlighter-rouge&quot;&gt;.gtp&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;So, my laptop died over the weekend, not permanently, but enough to get me thinking. The failure was in a tiny component that I could probably fix, if I knew what it was and could source it. This got me thinking about the &lt;a href=&quot;https://www.kosagi.com/w/index.php?title=Novena_Main_Page&quot;&gt;Novena&lt;/a&gt;, which is a completely open source laptop, built to be as open as possible. It’s not a fast machine, but for most of my uses I really only need a typewriter with some sort of UNIX-like environment, usually debian or ubuntu. So, somewhat spurred on by the ennui of a broken machine, I ordered a board.&lt;/p&gt;

&lt;p&gt;The first problem with this scenario is that the battery board, Senoko, the thing that handles charging and power management, is not available. Since it’s open source, that’s fixable.&lt;/p&gt;

&lt;p&gt;The board is only four layers, so we can have it made by OSHPark. I downloaded the &lt;a href=&quot;//bunniefoo.com/novena/pvt2_release/gerbers-senoko_pvt1.zip&quot;&gt;gerbers&lt;/a&gt; from the site, and uploaded the file directly. I chose OSHPark because I’ve used them in the past, and DirtyPCBs’ 4-layer non-custom size is 2cm too small in one dimension. There are two plated slot holes, which OSHPark doesn’t support, but they’re mounting tabs that can be cut to fit the round holes. The rest of the board is standard, and doesn’t present any issues.&lt;/p&gt;

&lt;p&gt;The second part, ordering the BOM, is a little trickier. Most of the components are cheap, and so we get enough to get at least the 10 item discount. Some things, I only ordered 1 of; if you want to make two boards, it’ll cost an extra $30 or so at this step (only double the components that aren’t already doubled because of quantity discounts), and double the time at assembly. There are a few substitutions from the original BOM: both of the ferrites were EOL’d, so I found equivalents for them. The barrel jack connector isn’t identical, but the closest mouser had, and should work. One of the fuses wasn’t available, but a close equivalent was. Finally, the supercap was also EOL’d, so it’s replaced with a similar one (slightly more capacitance, but it should work, since it’s a power storage device in this circuit).&lt;/p&gt;

&lt;p&gt;The stencils are another thing. &lt;strike&gt;You'll need to open the board in KiCAD or Altium (if you have altium and know how to use it, you know how this works). Then go to File-&amp;gt;Plot, and select the two cream layers, and then export them.&lt;/strike&gt; Correction: Download the PVT gerbers &lt;a href=&quot;//bunniefoo.com/novena/pvt2_release/gerbers-senoko_pvt1.zip&quot;&gt;here&lt;/a&gt; and use the &lt;code class=&quot;highlighter-rouge&quot;&gt;.gtp&lt;/code&gt; file for the top layer, and the &lt;code class=&quot;highlighter-rouge&quot;&gt;gbp&lt;/code&gt; for the bottom layer, if you want it. I decided I didn’t need it for a dozen passives. Go to &lt;a href=&quot;https://www.oshstencils.com&quot;&gt;OSHstencils&lt;/a&gt;, follow the directions to upload the files, and order them.&lt;/p&gt;

&lt;p&gt;Board assembly is, at this time, an exercise for the reader. There are plenty of good tutorials out there if you haven’t ever done surface mount work before. None of this is too terrible; as long as you get the components roughly on the pads, the surface tension of the molten solder will move them into place. The only real hair-shirt part of this project will be hand-placing 226 components with tweezers; it’s a lot to place by hand. The board is small enough that you can get it in a toaster oven for reflow, and there are few enough components on the bottom that they can be hand soldered. I’ll probably use hot air for the bottom, just to save myself trouble.&lt;/p&gt;

&lt;p&gt;So, that’s it. $220 worth of material and you can put it together, assuming you have access to a reflow oven, solder paste, and the sundry tools needed. Probably the MVP for that is a halogen work light and Chip-quik low temp solder paste. Lovely stuff, but beyond the scope of this post. Go forth and google.&lt;/p&gt;
</description>
        <pubDate>Fri, 07 Oct 2016 19:10:33 +0000</pubDate>
        <link>https://midnight.computer/2016/10/07/building-the-senoko.html</link>
        <guid isPermaLink="true">https://midnight.computer/2016/10/07/building-the-senoko.html</guid>
        
        
      </item>
    
  </channel>
</rss>
