tanks a lot

I decided to build a very cool-looking robotic tank kit which is made by OSEPP. They have a variety of grown-up toys like this in the geekspace.

I guess I’ve been inspired lately by some of the local meetups which involve races with autonomously-driven cars.

To build this, I find that a surprising amount of hardware is going into this project as well as several programming languages all at once. I’ve had to bounce back and forth between Python and C as I interface the Raspberry Pi Zero W computer with the Arduino Mega 2560 R3 Plus board. This Arduino doesn’t come with Bluetooth, wi-fi or even an Ethernet jack so I opted to add in the Pi since it’s inexpensive and comes with a full operative system. The Pi of course includes a webcam for initially allowing the remote control features to be easy. Later, that same camera will be used to generate images to be processed for autonomous driving.

DSC_0072

Repository

Update:

I decided to design some plastic parts for the tank. It’s now looking awesome, has some quick-release pins and I’ve purchased a 12-battery AA charger and batteries for the project since it seems to be hungry for power.

DSC_0073

DSC_0074

Screen Shot 2018-09-12 at 2.00.44 PM

The first three attempts at managing the tracks for steering didn’t seem accurate enough for my own driving-related expectations at least. I finally had to resort to trigonometry in the last set of calculations; this appears to be a more natural steerage interface.

It looks like the first two phases of the project are now complete and I’m well into the third (autonomous) phase now.

Autonomous (Self-Driving) Mode

Next up is the part where a service is taking snapshots from the camera and then using this to make steering decisions. The strategy here is to use data image processing to find the road, so to speak, our position relative to the path ahead as well as any competitors also on the track.

The first interesting piece of the data processing involves some linear algebra and a variety of matrices which perform distinct functions, if you will. You basically multiply a particular matrix for a 3×3 array of pixels to replace the center pixel’s color in each case. The first and most useful matrix is named findEdgesKernel and looks like this:

-1 -1 -1
-1  8 -1
-1 -1 -1

This will allow a new, simpler image which should highlight only the track (masking tape) for the path ahead. This part is working quite well so the next step is to process this resulting path image to determine how the tank should steer both now and in the near future.

Screen Shot 2018-09-12 at 2.03.10 PM

microsoft wants open source extinguished

On June 9th when Microsoft had just purchased github.com, I wrote about how I thought this was something tragic for the world of open source. This morning I awoke to several new security notifications from my repositories there (requiring about an hour of my time to adjust my code):

“We found a potential security vulnerability in a repository for which you have been granted security alert access. Known low severity security vulnerability detected in debug < 2.6.9 defined in package.json.”

On the surface, one might think that Microsoft is trying to make the world a better place. You might think this if you’re an optimist or a friend of them, perhaps. Maybe Microsoft cares about security so much that—having just purchased github—they now want to ratchet up the quality of the collection of software as stored there by most people who don’t like them…?

But if you’re a pessimist or if you’re someone who doesn’t like Microsoft, could there be another reason behind this new diligence they’re trying to bring to code security? It’s not like Microsoft has a great track record in writing bug-free or network-safe code themselves.

“It’s not like Microsoft has a great track record in writing bug-free or network-safe code themselves.”

Strategic sabotage

Richard Nixon was known to do something termed ratfucking in the political world. Wiki even has a page on the subject. It means “political sabotage or dirty tricks”. It would eventually result in his impeachment. In some college circles, a mean-spirited prank is part of the playing field. To me, it feels like many of the players inside Microsoft are the same type of people, those who have no qualms destroying the competition, tripping them up and generally exercising a “whatever it takes” attitude toward their so-called success.

Microsoft’s internal methods:

Steal their air

In a lawsuit, the U.S. Department of Justice turned up an internal tactic used inside Microsoft which describes what they do when they feel that a competitor needs to be removed: “embrace, extend and extinguish”. In other words, 1) embrace open source by buying the main storehouse for its code, 2) create products such as Visual Studio Code which replaces similar free editors and 3) gradually remove the competition by getting rid of it now that you’re in a controlling position.

Appeal to fear

Another tactic they use in the market space is to promote fear with respect to anything the competition could provide. We’re seeing this now in the pseudo-warnings being auto-generated by github.

What this is

What we’re seeing is a direct and strategic beginning to Microsoft’s move to embrace, extend and extinguish github and yet it’s open source itself who is their ultimate target.

The future of gihub and open source

Expect more of the same: dirty politics related to the leading repository site of what Microsoft views as their competition.

and one button to rule them all

The project from yesterday and today is something called a “dash button”, an IFTTT or an IoT button. Push the button and some activity gets invoked (usually, remotely). Amazon’s take on this is for you to be a consumer, press the button and something gets ordered.

dash

My own take on this is to add a big red button (BRB) as a remote panic switch for the 3D printer. Press it, magic happens and the print job is paused. It’s useful when something bad starts to happen and you need to make it stop quickly.

IMG_0034

There’s not a lot of room inside the printed plastic for this. Whatever electronics it uses, it will need to be small enough to be self-contained.

IMG_0049

I’m currently accomplishing this with a nifty Adafruit Huzzah ESP8266 board, a charging module and a 3.7V battery. I’m using the Arduino software to “flash” (upload) code to the tiny processor as well as a full directory of files to support the webserver which runs when it’s in configuration mode.

By strapping a pair of header pin connections and pushing the reset button, it now boots up in wi-fi hotspot mode and serves up a configuration website. Submitting to the form then re-configures the device and resets it again.

Booting up now in the standard mode, it then connects to the local wi-fi and attempts to then connect to the URL that you’ve given it. Once it does all this (perhaps ten seconds’  worth of activity), it promptly goes to sleep. Press the BRB again, it wakes up and goes through its routine again.

If you think about it, it’s now a reconfigurable dash button and much more useful than those one-trick-ponies as provided by Amazon.

Repository

glacier

Earlier today, I created a Raspberry Pi Trezor (cold wallet) for cryptocurrency using that cool Adafruit 1.3″ OLED bonnet.

PiTrezor

It seems to reasonably work from a fork of the original code. It presents itself to the Trezor Bridge software and to your workstation as a slave USB device. I suppose you could think of the entire thing as a smart USB thumb drive, if you will.

The code image is smaller than you’d normally expect (50MB). I’ll get in there and take it apart later from a software standpoint.

Notes:

  • The interface is beautiful on the small screen with attractive fonts and functional animations.
  • I don’t love websites which only work with a single browser. In this case, it’s Google Chrome of course and it was necessary to install that for Trezor to work at all.
  • The standard screen assumes that the buttons are positioned below it, not so for the Adafruit hat. So you just have to guess that the furthest button equals the right-most button and it all works out.
  • The GPIO pin layout of the OLED bonnet is different from the native Trezor device so of course, the bootloader upgrade routine doesn’t work as expected. It will be necessary to recompile and reload the image in order for this to work. I’ll have to review all that to see how it affects me to I don’t love anything in the cryptospace which can’t keep up to the current state of the art.
  • Having the micro USB cable sticking out of the side of the Pi just seems awkward so I’ll work up a serial connection to the GPIO pins with a USB plug tail and incorporate all this into a slick-looking case.
  • I don’t think I enjoy the website interface for selecting other cryptocurrencies. I think I like the KeepKey version of this better, to be honest.
  • Although Trezor suggests they’re compatible with other currencies, they seem to only be able to do Ethereum via a third-party. The hand-off to that third-party provider was about as ugly as it gets and I aborted. You shouldn’t have to create multiple accounts to simple store a wallet.
  • Unless I gain more confidence with all this, I won’t be putting any money in the wallet but it’s an interesting exercise.

what’s up, dox?

Earlier yesterday, I visited the Amazon Bookstore and saw one of these DOX things.

DOX

So, of course I thought, “I can do something like that”. Returning home, I immediately designed a base for the Echo Dot and sent it to the printer.

I’d initially decided to use the new GP3D FLEX filament I’d bought earlier but it’s so amazingly flexible that it adds challenges to the process:  1) it really adheres to the print bed so well that it refuses to pop off from it, it must be peeled off instead; 2) when the bowden pulls on the main filament roll, the material is stretchy rather than delivering like you’d expect; 3) the diameter of the filament is too inconsistent and gets caught up in the PTFE tubing.

That said, I turned back to my standard PLA filament and proceeded. The part finished last evening and it fits perfectly. It wants some light sanding where the supports were but it’s very functional, directing the downward-facing speaker toward the consumer and lifting it from the table by 25mm.

IMG_0040

IMG_0039

 

the braille project

Yesterday, I designed a Node-based program to generate a 3D mesh file programmatically from the input text to create a braille message.

Screen Shot 2018-07-03 at 5.22.55 PM

The concept is easy enough to grasp. Braille is a simple combination of raised dots. If we can know that combination, then it should be easy enough to design a 3D CAD object which uses tiny spheres to render the scene.

But I didn’t want to laboriously design this in Autodesk Fusion 360 and I’m sure few people would. Everything has to be precisely placed and that’s just too much manual work. Even if you did, it’s not very easy to maintain. If you did catch an omission, just think of all the work you’d have to do to move things around! I’m relatively certain that this is currently how people create braille-based printouts as seen on an ATM machine, for example.

3d-braille

So yesterday, I designed and created a program for doing this. Generating the STL file was then painless and took less than a second. Printing it then took five hours so I got to see it as a finished part this morning.

IMG_0038

saving the day for thirsty students

The place where I work has a refrigerator in the kitchen. The water dispenser in the door is wonky and before yesterday, it wouldn’t turn off automatically. Perhaps at one time, there was a spring which makes that tab want to stay forward but it was broken a long time ago. Most new students were initiated to this when they accidentally spilled at least a cup of water on the floor.

dispenser

So of course, I decided to fix it using the 3D printer at work. This was made more difficult since I hadn’t brought a digital caliper with me nor a ruler. I used earlier-printed parts to measure the tab (since I did know their dimensions) and then went to work.

Autodesk Fusion 360

The first step was to design the part in a CAD program. Imagine this then fitting over the tab with the extended “spring” resting against the back panel of the refrigerator. I had to plan in the amount of force required as well as that necessary to keep the part from sliding off as well as the internal play required to fit this over the tab.

Screen Shot 2018-06-30 at 8.35.33 AM

FlashPrint

Next, it was necessary to “slice” the model file into a toolpath file for the printer, a set of instructions which it needs to create the part. I used PLA filament since it’s easy to work with and decided to orient the part sideways on the bed so that the spring part wouldn’t be an overhang (which sometimes causes problems). This meant that the printer at the end would need to bridge the two walls it had created with a 5mm gap between them.

Flashforge Creator Pro

I transferred the toolpath file to the printer and got it going, noting the time. I made some guesstimates about when it would finish and it was done about five minutes after my shift completed. It bridged that 5mm gap without a problem, finishing the “roof” at the top.

While it was still hot, I put the part in place on the refrigerator and it fit, working perfectly and solving the problem. Use a glass to push against the tab, water dispenses. Release and the water stops. No more huge spills on the floor as a result.

Refrigerator

logistics for the black pearl lcd theme

I decided to add more to the earlier Black Pearl Conky theme for my 3D printer’s TFT screen. It turned out to be a lot easier to do since I’d just finished a new module for OctoPrint.

octo-client:  A node-based module for directly talking to OctoPrint to gather raw information.

octo-conky:  A Conky script for returning that information in a pleasing way.

The new information is there after the “Black Pearl v1.0.1” line where it pulls the version and temperature from the printer.

IMG_0037

on the mad exodus from github.com

If you don’t code for a living, you probably didn’t hear about the US7.5B deal in which Microsoft is now purchasing github.com. For the rest of us, this is big news.

GitHub Inc. is a web-based hosting service for version control of software using git. They offer both private repositories and free accounts (which are commonly used to host open-source software projects). With its 28 million public repositories, it’s the largest host of source code in the world.

Github’s competitors are reporting record numbers of customers moving their repositories away from the now Microsoft-owned provider.

What Microsoft now controls

Presumably, Microsoft now controls both Atom and Electron, two extremely powerful platforms in the coding space. The former is a great code editor and the latter is the underlying executable program which allows others to code in JavaScript to create a very usable desktop/GUI application.

Microsoft also now control the revenue stream. Each private repository costs $7/month or $9/month, depending upon whether its personal- or business-related.

Microsoft now apparently has access to the code in those private repositories. Just imagine what their competitors must be thinking, now that Microsoft has a copy of their internal project code to include any secret ideas those competitors have been working on.

Alternatives

We’ve all been lulled by github’s ease-of-use, it’s free nature and such. We haven’t even considered alternatives before now, to be honest. The specter of this new playing field means that we must look at our options.

Gogs.io is an open-source option for hosting your own github-like service.

Gogs

Over the last three days, I’ve now setup my own private, internal Gogs service called gitjs.io. Since I own the domain name I may later push this into the cloud but for now, it’s running on one of my computers here at home.

After the initial hurdles to get OSX to startup the Gogs service on a privileged port (http/80) and to automatically start upon bootup, I must say that I love it.

It’s a full-featured github-like experience throughout with all the screens you’d expect. You can create users, organizational levels and do the things you did over on github.

The command line git program interacts with the service as expected. The underlying code creates a global repository folder to stores everything much the same way that github might.

Screen Shot 2018-06-09 at 6.38.00 PM

The Future of Source Control

I don’t need a crystal ball to suggest that Microsoft’s purchase is going to be a game-changer for open source. The world of open source is the very antonym of what Microsoft stands for.

I would suggest that anyone and everyone with a github account highly consider the immediate need to move your code elsewhere. Microsoft has a long history of buying up competitive technologies only to starve them of air over time. In fact, internally Microsoft used the term “starve them of air” to describe how they would ruin a competitor’s advantage in the market.

It’s time to take your code and run.

beehive varroa barrier

This is a second post of two, hoping to address the needs of beekeepers in preventing the Varroa mite from entering the beehive’s brood chamber, devastating the pupae inside.

bee-with-varroa-mite

The mite jumps onto the adult bee’s back while it’s foraging for pollen and then rides back to the hive. Once inside, it lurks near the brood cells after the queen has laid a round of pupae. While those cells are being capped off by the bees, the mite jumps into one of the cells and feeds off the young.

This design involves a means of brushing off the mites as the bee enters the hive. Mylar door gates differentiate entrances from exits; the longer entrances incorporate the brushes which will remove the mites which fall through a mesh into a tray of oxalic acid where they may be counted.

Screen Shot 2018-05-22 at 10.00.21 AM

Repository