Archive for the ‘Rich’ Category

We didn’t start the fire: Add MOSFET’s to your 3D printer

I’ve gotten bitten by the 3D printer bug recently, and picked up an Anet A8  around Christmas.

It’s your typical corner-cutting Chinese kit printer, but it’s one of the nicer ones as far as features and electronics components.  Unfortunately, like many cheap 3D  printers, the wire and electronics for delivering power to the bed and hot end is inadequate.  Let’s take a step back for a moment, and understand the basic electronics.

The key components are the power supply, the steppers, the LCD, control board, heated bed, and hot end.  Most of these use very little power.  Even the steppers all working at once use less than a few amps.  The bed and hot end though are power hungry.  I found the bed on my Anet A8 draws ~11 amps, and the hot end ~3 amps (@12v) .  This a lot of current to push through the otherwise low power mainboard, especially for the bed.  This will ultimately lead to failure, and you’ll be hunting for  a whole new mainboard, or worse, putting out a fire.

The solution: get that high current off the mainboard!  Adding larger and separate mosfets to handle power deliver to the bed and nozzle takes all that strain off the mainboard, and will extend it’s life dramatically (and reduce the chance of overheating which could lead to fire).  You could probably get away with just adding a mosfet for the bed, but I would suggest adding one for the hot end too.  You’re re-wiring anyway, and they’re cheap, so may as well get as much current off the mainboard as possible.  I used two of these mosfets.

The second problem is the wiring itself.  The wire supplied in most kits suffers two key problems:

1) It’s bare copper, which over time loosens under the screw terminals, leading to resistance, which in turns causes the terminal to overheat and burn.

2) It’s often undersized (I’ve seen kits with 18ga wire that’s carrying close to 20 amps).

The wiring is an easy fix.   When adding the mosfets (wiring diagram further down), use 14ga wire for the run to the bed mosfet, and a minimum of 16ga for all other DC power runs.   Here is the link to the good silicone 16ga wire I used, and here is the link to the good 14ga wire.  MAKE SURE YOU TIN ALL THE ENDS, OR USE QUALITY CRIMPED ENDS.  I’m personally a fan of tinning all the ends. I’ve never had an issue with a properly tinned wire under a screw terminal.  Come back and snug up the screws in a few days of use.  They will stay tight, have VERY low resistance, and the solder ensures an even connection across all the wire strands.  If you don’t have a good soldering iron, this is a good time to get one.  I use the Hakko FX888D, and it’s exceptional.  You’ll never buy another iron.  If the Hakko is out of your price range, this one would be my choice for a basic iron.

Here’s the wiring diagram that brings it all together (click to view larger):

If you happen to also have Anet A8, I designed a mount to hold both of these mosfets, just above your mainboard:

Thanks for reading!

Shell Script To Control Belkin WeMo’s

It’s no surprise I’m a huge fan of home automation and tech toys, and I recently picked up a pair of Belkin WeMo’s.

You **have** to set them up with the app they supply for smartphones, but after that I hoped I could find a way to control them directly. Belkin has collected quite a few negative reviews for these devices, and it’s a shame, because the hardware seems real solid.  It’s their current apps that leave a LOT to be desired.  Clearly the issues they’re having getting the app side right are driving down the reviews.  Fortunately, I could care less how the app experience is, since I only needed it to initially deploy the devices, and planned from the get-go to write my own code to control them.

Numerous folks have written tools to control some of the functions of these, but everything I came across was dependent on other libraries, was incomplete, or didn’t work when I tested it.  I like plain-old vanilla shell scripts that I can just run from any local machine, and I’ve hacked up various XML snippets I’ve found and just rely on curl for the following script that I put together:

#!/bin/sh
#
# WeMo Control Script
#
# Usage: ./wemo_control IP_ADDRESS ON/OFF/GETSTATE/GETSIGNALSTRENGTH/GETFRIENDLYNAME
#
#

IP=$1
COMMAND=$2

PORTTEST=$(curl -s $IP:49152 | grep “404″)

if [ "$PORTTEST" = "" ]
then
PORT=49153
else
PORT=49152
fi

if [ "$1" = "" ]
then
echo “Usage: ./wemo_control IP_ADDRESS ON/OFF/GETSTATE/GETSIGNALSTRENGTH/GETFRIENDLYNAME”
else

if [ "$2" = "GETSTATE" ]

then

curl -0 -A ” -X POST -H ‘Accept: ‘ -H ‘Content-type: text/xml; charset=”utf-8″‘ -H “SOAPACTION: \”urn:Belkin:service:basicevent:1#GetBinaryState\”" –data ‘<?xml version=”1.0″ encoding=”utf-8″?><s:Envelope xmlns:s=”http://schemas.xmlsoap.org/soap/envelope/” s:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/”><s:Body><u:GetBinaryState xmlns:u=”urn:Belkin:service:basicevent:1″><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>’ -s http://$IP:$PORT/upnp/control/basicevent1 |
grep “<BinaryState”  | cut -d”>” -f2 | cut -d “<” -f1 | sed ’s/0/OFF/g’ | sed ’s/1/ON/g’

elif [ "$2" = "ON" ]

then

curl -0 -A ” -X POST -H ‘Accept: ‘ -H ‘Content-type: text/xml; charset=”utf-8″‘ -H “SOAPACTION: \”urn:Belkin:service:basicevent:1#SetBinaryState\”" –data ‘<?xml version=”1.0″ encoding=”utf-8″?><s:Envelope xmlns:s=”http://schemas.xmlsoap.org/soap/envelope/” s:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/”><s:Body><u:SetBinaryState xmlns:u=”urn:Belkin:service:basicevent:1″><BinaryState>1</BinaryState></u:SetBinaryState></s:Body></s:Envelope>’ -s http://$IP:$PORT/upnp/control/basicevent1 |
grep “<BinaryState”  | cut -d”>” -f2 | cut -d “<” -f1

elif [ "$2" = "OFF" ]

then

curl -0 -A ” -X POST -H ‘Accept: ‘ -H ‘Content-type: text/xml; charset=”utf-8″‘ -H “SOAPACTION: \”urn:Belkin:service:basicevent:1#SetBinaryState\”" –data ‘<?xml version=”1.0″ encoding=”utf-8″?><s:Envelope xmlns:s=”http://schemas.xmlsoap.org/soap/envelope/” s:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/”><s:Body><u:SetBinaryState xmlns:u=”urn:Belkin:service:basicevent:1″><BinaryState>0</BinaryState></u:SetBinaryState></s:Body></s:Envelope>’ -s http://$IP:$PORT/upnp/control/basicevent1 |
grep “<BinaryState”  | cut -d”>” -f2 | cut -d “<” -f1

elif [ "$2" = "GETSIGNALSTRENGTH" ]

then

curl -0 -A ” -X POST -H ‘Accept: ‘ -H ‘Content-type: text/xml; charset=”utf-8″‘ -H “SOAPACTION: \”urn:Belkin:service:basicevent:1#GetSignalStrength\”" –data ‘<?xml version=”1.0″ encoding=”utf-8″?><s:Envelope xmlns:s=”http://schemas.xmlsoap.org/soap/envelope/” s:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/”><s:Body><u:GetSignalStrength xmlns:u=”urn:Belkin:service:basicevent:1″><GetSignalStrength>0</GetSignalStrength></u:GetSignalStrength></s:Body></s:Envelope>’ -s http://$IP:$PORT/upnp/control/basicevent1 |
grep “<SignalStrength”  | cut -d”>” -f2 | cut -d “<” -f1

elif [ "$2" = "GETFRIENDLYNAME" ]

then

curl -0 -A ” -X POST -H ‘Accept: ‘ -H ‘Content-type: text/xml; charset=”utf-8″‘ -H “SOAPACTION: \”urn:Belkin:service:basicevent:1#ChangeFriendlyName\”" –data ‘<?xml version=”1.0″ encoding=”utf-8″?><s:Envelope xmlns:s=”http://schemas.xmlsoap.org/soap/envelope/” s:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/”><s:Body><u:ChangeFriendlyName xmlns:u=”urn:Belkin:service:basicevent:1″><FriendlyName>Pool Filter</FriendlyName></u:ChangeFriendlyName></s:Body></s:Envelope>’ -s http://$IP:$PORT/upnp/control/basicevent1 |
grep “<FriendlyName”  | cut -d”>” -f2 | cut -d “<” -f1

else

echo “COMMAND NOT RECOGNIZED”
echo “”
echo “Usage: ./wemo_control IP_ADDRESS ON/OFF/GETSTATE/GETSIGNALSTRENGTH/GETFRIENDLYNAME”
echo “”

fi

fi

Copy/Paste or download here: wemo_control.sh

Usage is:   ./wemo_control IP_ADDRESS ON/OFF/GETSTATE/GETSIGNALSTRENGTH/GETFRIENDLYNAME and the functions are pretty self-explanatory.

The usual disclaimer applies.  I don’t write code for a living and there’s probably gross inefficiencies and poor syntax, but it WORKS.

Enjoy :P

Quick script to add a rule to spamassassin

My spam volume has been ‘up’ lately, probably due to the holidays.

I find myself adding rules to match simple phrases that I seem to get a lot of  to my local.cf, and I figured I’d write a quick dirty script to make the process easier.

Feel free to copy/paste this into a new file in the same directory as your local.cf and don’t forget to chmod 755.  Execute with ./yourfilename (I used rule_creator).  There’s some comments in there to pay attention to, but as long as you place this into the same dir as your local.cf, and use ’service’ for spamd (typical for a qmailtoaster), there’s nothing to do.

Enjoy!

#$/bin/bash
#
# This script must be run from *INSIDE* the directory where your local.cf lives.
#

clear
echo “What should we name this rule? (ex. ‘RICH_DIRECTBUY’)”
echo “”
read RULENAME
echo “”
echo “Should the rule apply to the header or body? (enter: ‘header’ or ‘body’)”
echo “”
read RULETYPE
echo “”
echo “What phrase should the rule match? (ex. ‘get your free credit score’)”
echo “”
read PHRASE
echo “”
echo “How many points should I assign for this rule? (ex. ‘5.0′)”
echo “”
read SCORE
echo “”
echo “”

if [ $RULETYPE = body ]

then
RULELINE=$(echo “body $RULENAME /$PHRASE/i”)

elif [ $RULETYPE = header ]

then
RULELINE=$(echo “header $RULENAME ALL =~ /$PHRASE/i”)

else

echo “Ruletype entered wrong, exiting”
echo “”
exit

fi

SCORELINE=$(echo “score $RULENAME $SCORE”)

clear
echo “”
echo “Ok, I’ll add the following rule to ‘local.cf’:”
echo “”
echo “—————————————————-”
echo $RULELINE
echo $SCORELINE
echo “—————————————————-”
echo “”
echo “”
echo “** Press any key to add the rule, or CTRL+C to exit **”
echo “”
read
echo “” >> local.cf
echo $RULELINE >> local.cf
echo $SCORELINE >> local.cf
echo “”

# This section will restart spamd if you use ’service’ to control it.  If you don’t, you’ll probably just want to comment the whole below section out and restart spamassassin manually

echo “OK – rule added, restarting spamd”
echo “”
cd /service
echo “Stopping spamd”
svc -d spamd
echo “”
echo “Starting spamd”
svc -u spamd
echo “”
echo “Checking spamd status”
sleep 3
echo “”
svstat spamd
echo “”

Thanks for visiting.  Tom and I each maintain our own blogs now to better target our own audiences, but fear not, here’s links!

Rich’s Blog:

Tom’s Blog:

Garmin nuvi 660 Bluetooth Fix

Kind of off the topic here, but I own a Garmin nuvi 660 GPS that I absolutely LOVE, but the bluetooth functionality just quits working all by itself every few months.

There’s an endless amount of horror stories online about this with various suggestions for a fix, but most people just end up living without the bluetooth or sending the unit back to Garmin each time the bluetooth fails until the warranty expires.

Through my own trial and error, I put together what’s needed to fix the problem yourself.

The bluetooth problem usually manifests itself as such that bluetooth becomes disabled on the nuvi, and enabling it causes the GPS to lock up or freeze.  Holding down the power button will reset it, but bluetooth is still disabled and re-enabling just causes it to freeze again.

I’ve put together a fix that contains steps to follow and a file you’ll need to replace on the nuvi 660 while it’s connected to your PC.

I hope this reaches other fellow Garmin owners that just want their bluetooth to work.  And Garmin, if you’re reading this, would you please consider providing a PERMANENT FIX TO THIS ISSUE!!??

Link to download fix:

Garmin_nuvi_660_Bluetooth_Fix.zip

Classmates.com Can Suck My Firewall.

So. . . every couple months I get spammed for days straight from classmates.com because someone has looked at my page, signed the guestbook, or maybe even THOUGHT about looking at something for all I know.

Every couple months I attempt to CANCEL receiving email from them, since I could really care less about it.  I -might- care if you didn’t go there only to find out you can’t see anything without first paying them money.  I’m sure those of you that have been to the site know what I’m talking about.  The best part is, you can’t even cancel or change your email settings without first signing in and walking through 15 ads.

I don’t even KNOW what my damn password is.  I signed up 5+ years ago, and that’s the only time I was ever “logged in”.  So, since I don’t know my password, I can’t even login to unsubscribe.  Imagine a scenario where you have an email address, let’s say spongebob788@happydomain.com and you sign up at classmates.com with it.   2 years tick by and you no longer have that email address, but someone else signs up with happydomain.com, picks the address “spongebob788″, and now they’re getting your classmates.com spam, and they can’t cancel it!

Since I can’t unsubscribe, and they have NO other means to contact them other than through the website once you’ve signed in, I’m left with one choice.

-BLOCK THE BASTARDS-

That’s right, I run my own network and email infrastructure, so I looked up their CIDR range at ARIN, which happens to be:

65.243.133.0/24

Add that to your firewall, block port 25, and you’ll never receive crap from them ever again (unless they change providers, then you’d just have to add their new CIDR)

So, classmates.com – “SUCK MY FIREWALL”

Updates to photo site

Just went live with the new version of my photo site.  Check it out by clicking below:

http://rnhphoto.com

What’s changed?

1) Better navigation

2) Flash slideshow on the front page

3) Portfolio’s are all flash-based now and easily updateable

4) More pics in most of the portfolios

Keep an eye here as well since now that the site is more update-friendly I’ll be adding content regularly and expanding the features.

Humans generating energy – BEST IDEA EVER!

http://dvice.com/archives/2008/12/revolving_door.php

Check out this article at DVICE.  Immediately I’m thinking of other ways we can harness energy from human movement.  Think of *ALL* those people at the gym on stairclimbers, friction weight machines, etc.  The friction on all those machines could be created by electricity generating systems.

Imagine a model where your gym membership was free because the gym’s could “sell” the electricy you generated while exercising to the grid.

No, No, Relax. . . Really

Styrofoam Dome Home

Tom, I thought of you instantly when I saw this.

Interconnectable, fairly cheap, and easy to assemble.  Similar concepts have been around for a while, but this looks to improve on existing cheap, fast, alternative housing offerings.

The article does touch on things like high-resistance to earthquakes, etc.  Given the lightweight, solid construction, I imagine this is quite true and could be a heck of a selling point for at least this “type” of housing in highly volatile areas as either temporary or semi-permanent housing.

DVICE is running the full article.