3d Printer Switch with Octoprint & SmartThings

Pinter Power On/Off

My MakerGear M2 doesn't have a power switch, and it isn't convenient to turn off its power strip, so I connected it to an Iris Smart Plug with a little power switch on it. That solved the problem, and also let me turn the printer on and off with Alfred, but tempted me to intergrate with Octoprint. Octoprint has a plugin, System Command Editor, that lets you execute shell commands from Octoprint's Power menu. That makes the Octoprint part easy - now it's just a matter of controlling a SmartThings device from Linux.

That part turned out to be a bigger hassle than I anticipated. I ended up using David Janes' iotdb-smartthings. His tutorial is really excellent. I did have to make two small changes to smartthings.py, to get it working with my configuration.

On line 46, I changed "smartthings.json" to the absolute file path.

On line 81, I changed the url to https://graph-na02-useast1.api.smartthings.com. I believe whether or not you need to make this change depends on which smartthigns server you're using.

I also had to install pip, and then requests:

sudo apt-get install python-pip

sudo pip install requests

Then to turn the printer on, I use the command:

python path_to/smartthings.py --type switch --id MySwitchName --request switch=1

switch=0 turns the printer back off. At this point, all you need to do is load the commands into Octoprint's System Command Editor.

Edit Command

Raspberry Pi & Nexdock: Bluetooth via the command line

I received my Nexdock today and have begun configuring a Raspberry Pi 3 to work with it. I wasn't able to find current instructions for getting the Nexdock keyboard and trackpad to work with the Pi using the command line, so I've documented the procedure that I used.

Raspberry Pi 3 with Nexdock

Run:

bluetoothctl

Then, from the bluetooth prompt:

power on
agent on
scan on

You should see a line to the effect of:

[NEW] Device 20:16:07:05:95:EB NexDock Keyboard

Replacing the MAC address shown with your own, type:

pair 20:16:07:05:95:EB
connect 20:16:07:05:95:EB
trust 20:16:07:05:95:EB
exit

Typically, this would be enough, but it seems the Nexdock doesn't remember bluetooth connections, so you need to reconnect at each boot. Nex says you can do this by adding the following line to your crontab:

@reboot echo "connect 20:16:07:05:95:EB" | bluetoothctl

I found that didn't work for me, although the command did work after the computer was fully booted. Adding a delay solved the issue:

@reboot sleep 5 && echo "connect 20:16:07:05:95:EB" | bluetoothctl

I'm experiencing a lot of key repeats. The problem is at its worst when I type quickly and with force. If I try to moderate my force on the keys, the problem seems to go away. Turning off key repeat does not eliminate the bounce.

Uses for fishpaper

Fishpaper is an insulative paper that used to be common in antique radios. It's often used to insulate transformers.

The history of the name is pretty interesting. According to Alvin G. Sydor:

In 1729 Stephen Gray made the discovery of the conducting and non-conducting power of different substances. Gray found that by using woven silk served as an excellent insulator. Some years later it was found that the paper industry could provide what was equivalent to woven silk. Later it was discovered that if the paper was saturated with fish oil its ability as an insulator was much improved particularly when used in harsh environments and high voltages.

Recently, I've been using it for fast and cheap electronics cases. This is one of my backup servers:

Fishpaper case

It's an NTC C.H.I.P. attached to a USB hard drive. My computers back up to it using Arq on the client side to connect via SFTP.

The backup system just sits in a corner where it never gets seen or bumped, so rather than fooling around with a case, I just stapled some fishpaper around it.

Fishpaper is also useful for insulating inside metal computer cases. I built a Zoneminder system recently, using an old PC and a Conexant 878A PCI card. The card didn't fit in my case, so I cut out a notch and wrapped the card in fishpaper:

Fishpaper insulation

I've also used it to mount circuit boards, when there isn't room for standoffs. Any time there's a chance of a circuit board coming into contact with anything else, I like to stick a sheet of fishpaper in between.

Cleaning handles with a brass wire wheel brush

I bought a Remline tool chest at an auction on Saturday. I've been wanting to get something a bit larger than my current chest, and I couldn't pass up these handles:

Remline logo

The handles were pretty rusty. I wanted to clean them up without scratching, so I tried a dremel brass wire wheel brush. It worked really well. You can see the difference in this photo:

Remline Toolchest

Once the rust was off, I stopped short of polishing them any further, as I didn't want to make the contrast with the rest of the chest too great.

The wire wheel brush turned out to be a lot more dangerous than I expected. Half way into the second handle, it started to fly apart, and I ended up with a tiny brass wire embedded in my cheek. Definitely wear safety glasses while using one of these.

The wheel that flew apart came out of a Blue Hawk (Lowe's low end brand) kit. Thinking that real Dremel wheels might last longer and be safer, I bought a two-pack of Dremel brushes for $6. Surprisingly, these barely lasted any longer. By the time I had finished the remaining 4 1/2 handles, the brushes were in shreds.

I suspect I may have been two aggressive with them, but Amazon's reviews show a lot of similar complaints.

Sonar trumps eTape

I’ve given up on the Milone eTape entirely. I just couldn’t get it to work reliably. Instead, I decided to go with a RadioShack Ultrasonic Range Sensor as my backup method for detecting water. It’s mounted on the basement ceiling and will alarm when it detects an inch of water on the floor. The floor is sloped, so an inch isn’t nearly as bad as it sounds. It’s been working well. I’m leaning towards a pressure transducer for the main sensor.