Sunday, November 24, 2013

Belkin F7D7301 DD-WRT & OPTWARE

I've been using a Buffalo wzr-hp-g300nh as my wireless router for about a year and a half, before that I was using it as one end on a 900ft link with a bi-quad antenna attached to a small satellite dish. It provided internet to my sisters house. All in all it's been a good router, but it's had a rough life and it was starting to show. The 2nd Ethernet port intermittently stopped working and it started dropping the wifi randomly. I'd mess with it, upgrade the firmware and it seemed to do OK for a while (on the WiFi, port 2 was completely dead at this point). Then it would start in on the same old problems. I knew it was failing so when I saw the F7D7301 for $25 shipped I bought one to have on hand. I paid $80 for the buffalo, and I like it better, but it needs to work. As far as specs go they are very similar.

Belkin F7D7301

Belkin F7D7301 Specs:

  • Broadcom BCM4716 CPU @ 450mhz
  • 64MB Ram
  • 8MB Flash
  • 32K NVRAM
  • Wireless N 2.4GHZ radio (up to 300mbps), 2 internal antennas
  • 5 Gigabit Ethernet ports (1 WAN, 4 LAN)
  • 2x usb ports
  • Supports DD-WRT and OPTWARE

DD-WRT

DD-WRT is easy to install, I tried to follow the instructions from trythistv.com, but I couldn't get to the CFE page, probably needed a hub, so I just uploaded the mini version from the Belkin firmware upgrade page. It worked just fine. After it rebooted I put a Kong build on it (r22200/usb-ftp-samba3-dlna-nv32k-broadcom.bin). That worked too. I did my normal config run through.

Config

Note: I recommend you investigate and test each option for yourself, I may be doing something stupid in here and not know it. YMMV

Basic Setup Page:
I use a slightly different ip range on my internal network, so I set that up

I use DD-WRT to cache DNS requests, so I turn on local-dns and add my router IP to the first static DNS (I don't know if it's needed or not). I check "Use DNSMasq for DHCP", "Use DNSMasq for DNS" and "DHCP Authoritative".

I set up the NTP for my timezone and use "0.north-america.pool.ntp.org" as the server.

Wireless Basic Page:
In Wireless it defaults to channel 6 (my neighbor is on 6), I use 40mhz width, upper extension channel and 11 as the channel. NOTE: You need to do it in that order and press save each time you change one of these settings, it will reset and / or not show options if you don't. (that really aggravated me until i figured it out)

Wireless Security Page:
WPA2 Personal, TKIP+AES

Wireless Advanced:
I'm using the defaults at the moment, I've barely started tweaking these yet.


Services Page:
I enable "DNSMasq", "Local DNS", and "No DNS Rebind".
I add:
cache-size=2000
no-negcache
to Additional DNSMasq Options

USB Page:
I Enable "Core USB", "USB Storage", "Automatic Drive Mount"

OPTWARE

Disk:
I used a 4gb thumbdrive with a ~3GB and a ~500MB partition.
The 3GB is ext2 and the Label is "Optware"
The 500MB is Linux-Swap and the label is "Swap"
DD-WRT detects and mounts them properly to /opt and as swap.

Install:
First I used "Optware The Right Way", got it all going and realized it was outdated and there is now "Optware The Right Way , Take 2". So I re-did it with that. It went smoothly, I enabled the services I wanted (with the "service" command). Disabled the one that oddly comes enabled that I don't think should: "Transmission", the bittorrent client. 

Well I tried to anyway, I stopped it, turned it off, and rebooted. It seemed fine, but something was using 100% of the cpu. It was "gunzip" trying to extract "level1.gz", the bittorent block list. I tried to stop it, but it refused, it kept coming back whenever I rebooted. So I figured I'd just let it run. 5hrs later the CPU was still pegged at 100% with "gunzip level1.gz" at the top of "top". I don't need bittorrent at all, I don't use it, and if I did I'd use it on my little server that runs 24/7 anyway. I figured I'd uninstall it. "ipkg" complained it needed jffs, nope wrong command. "opkg" claimed there were no packages installed. It was opkg on atheros, I thought it was ipkg on broadcom. So a bit of hunting and I found it was "ipkg-opt". I removed Transmission, rebooted and now it's apparently enabled as a service again, but at least it's not hogging the cpu anymore. Why won't it go away?

Services I am trying at the moment:
Asiablock
Stophammer
Fixtables
pixelserv

I tried mypage, which is cool, but seems to be a bit of a resource hog so I disabled it, I can turn it on if I need info from it.

Wall Mount

One other issue I had with the Belkin is it only has a stand on the bottom. The buffalo would mount neatly to the wall. I removed the stand, bent a little piece of metal I had lying around to attach the Belkin to the wall. It's not pretty, but it works (and the bracket's out of sight).


Notes:

  • I think the Kong stuff is now in the main DD-WRT source, so I don't know what the best place to get a build is anymore. (probably not a kong build anymore, Arhhh)
  • I'm sure there are some errors in here, I don't mess with routers much (as long as they work right?).

Links


Thanks! DD-WRT and OPTWARE folks! Thanks to you we can turn a crappy router into an awesome router, basically a miniature, full featured, headless server!

Friday, October 18, 2013

Electric Fence Charger Repair

Electric Fencer
My parents keep some goats. An electric fence is the best way they've found to contain them. Basically you run multiple strands of metal wire around the field supported by insulators, then hook it up to a "fencer" that pulses a high voltage, pulse through it once or twice a second.

Never Do This (rant)

I've heard of people just hooking the (fence) wire up to a 110/220 volt line. That's a dangerously bad idea! Grab a line hooked up to a fencer and you'll get a jolt, but it's intermittent, and it won't kill you (pacemakers / various health conditions excluded). Grab a 110VAC line in wet boots and you're going to have a very bad day, you could DIE! or your kids, or whoever, it's a really really bad idea! DON"T DO IT!

Back to the topic

Lightning is a potential problem with these as they have electronics in them and they are hooked to (potentially) several miles of wire. A strike within a few miles may well induce a serious spike in it. They are pretty rugged though, as they expect to have thousands of volts present during normal operation (20KV insulation is specified for the hookup wires).

Anyway, we've been using this one for years (10+?) before it just stopped working. We've had to replace the fuses several times, and they were blown, but replacing them didn't fix it this time, so I took it apart. We swapped in a new unit while this one was broken, as we had no way to tell when or if I could fix it.

Operation (seems to go like this, I could be wrong)

  • 120VAC is run through a transformer that (I think) both steps up and down the voltage (I didn't test this, and couldn't see any markings) There are fuses and MOV's on the a/c input for protection / filtering. 
  • The high voltage feed is rectified and charges the big capacitor. (there could be some flyback or something going on here too, idk) The low voltage is rectified and powers most of the circuit board. (probably some regulation in here)
  • The large cap is discharged by the SCR through a second transformer that steps the capacitor voltage from hundreds to thousands of volts. The output is connected directly to the case (ground) and a heavily insulated terminal (fence). The case is grounded by multiple grounding rods with the first no more than 20ft away.
  • The whole unit is built into a grounded metal box (Faraday cage?), there should be no arcing inside it (or anywhere actually), but there is a very audible "Tick" when it's working. A wire, grounded to the case, placed near the insulated output will jump a bright blue spark over 3/4 of an inch!

Diagnosis

  • This isn't something I want to test on my bench, as the voltages / EM pulses could easily damage my test equipment. 
  • Fortunately it's a pretty simple circuit, so it's not that hard to figure out. 
  • A visual inspection didn't turn up anything obvious. 
  • A few minutes tracing circuits indicated that the TO-220 SCR (2n6509GOS) would be the place to start (this would take the brunt of a surge on the fence loop). 
  • I tried to test the SCR in-circuit. It failed, but I couldn't be sure the other components weren't interfering so I removed and tested it. It still failed. So for ~$1.50 I ordered a new one and now it works!

If you mess around in one of these be very, very careful! High voltages all over the place! That cap looks like it could kill a horse!

Top PCB
The main (active) components were the 2n6509, a 2n6028, and a LM324. I ordered all of these, but only needed the SCR.
Bottom PCB
The SCR is a 2n6509GOS 800V 25A
Failed SCR, Doesn't look damaged, but it tested as failed, and replacing it restored the unit to operation.

Links

http://www.circuitstoday.com/how-to-test-an-scr

Friday, September 27, 2013

Underground Leak Location (Failed, but interesting)

My brother has a water leak in the plastic line between his house and the street. We don't know where the pipe runs and haven't been able to find a wet spot. It's not a huge leak, so he can just shut it off at the meter most of the time.

Cool Little Amplifier

The first problem is locating the pipe, we know where it is on both ends, but there's 400ft and a concrete driveway in between.

Options

  • I found ground penetrating radar first, but it would cost way more than just running a new pipe to buy and it's well out of my capabilities to build. Maybe in a few years, but we don't have that kind of time.
  • Metal detectors don't work on plastic pipe unless you put something metal in them (steel cable), which requires disconnecting the pipe. If we had a metal detector this would be a reasonable starting point. It's still on the table, but we have other options to try.
  • A smaller wire could be pushed down the pipe and connected to a small transmitter. Then a receiver would locate the signal and pinpoint the pipe.
  • With a ground microphone and an amplifier it's possible to listen to sounds under ground. A wrench or solenoid can be used to tap on the pipe, which will transfer down the pipe a ways and (hopefully) be audible near the pipes location. The leak may also be audible within a few feet.
Schematic - Pretty much exactly as in the source link

I've build a amplifier based on a circuit for an amplified ear I found on the internet. It seems to work good, but I'm having a real problem with the microphone. It will pick up sounds from all over, but nothing from the ground. I've tried several different ideas to transfer the sound, but so far I've come up dry. I think a piezo buzzer element is the key, and I managed to break the only one I had. I've got several more on the way, but it will be at least Saturday, probably Monday before I have them. We can't start digging before Monday (call-before-you-dig), so I'm hoping for Sat.

Prototype and RevA001 PCB

Results So Far

  • It's a really cool little amplifier, Q3 varies the gain of Q1 so that faint noises are highly amplified and loud noises have little amplification. If I can sort out the microphone problem it should work really well. It would also work great as an electronic stethoscope.
  • It doesn't seem to work as I intended to use it. I really need the digikey parts before passing judgement, but I think it should have a variable bandpass filter in it to isolate the desired noises. I can hear all kinds of stuff, but not what I'm listening for.
  • I ended up connecting a piece of wire to a fish tape, shoving it down the pipe and hooking a arduino clicking a relay that shorts a (low output) battery charger across the wire to transmit a clicking noise. I only had a 50ft tape so I couldn't trace much of the line, but it looks like a bee line. I used 30 turns around a cool-whip container (approx 15cm diameter) connected to the microphone input to listen for the clicks. It (barely) picks up the clicks, but AC lines are VERY obvious (loud buzz). I think I found the pipe and the end of the tape, but gave up as I didn't feel I was accomplishing anything. I could divide the pipe into (up to) 8 pieces and find the leak, but that would mean 8 potential future leak points (and 8+ holes to dig of unknown depth).
  • Unless the digikey parts are here tomorrow and I locate and fix the leak (unlikely) we're digging in a new line with a trencher on Monday. It's not looking good. I'm not shelving this project yet though, it would be very useful for locating noises in various equipment and it should work for finding pipes, if I can come up with a working mic. Perhaps I'll modify it for a bandpass filter too. 

Notes

  • R1 is specified as 10K, but my mic element specified 2.2K and worked much better with that. For the piezo transducer and the wire coil I disconnected the resistor.
  • The audio jack is connected with wires, I didn't have time to make a footprint for the one I had.
  • I did the PCB in a hurry, and I really should redo it, I make no promises as to it's performance.
Underside of PCB

Links


Saturday, September 14, 2013

Intel Hardware Video Decoding on Linux! VDPAU, VA-API, and Flash!

My laptop has a Core 2 Duo 2.4ghz CPU with an integrated Intel video chipset (GM45). It plays flash fine, but I wondered if I could get some HW decoding like the ATI. Here goes:

Intel supports va-api, not vdpau (required by flash) I'm running Arch on my laptop, so it may require some modifications to use on other distros (or it may not work at all).

Requirements

  • xf86-video-intel
  • libva
  • libvdpau
  • libva-intel-driver (only does mpeg2)
  • libvdpau-va-gl

Optional

  • libva-driver-intel-g45-h264 - replaces libva-intel-driver (in the AUR, it does h.264 on specific chipsets, but may be worse than software decoding)
  • vainfo
  • vdpauinfo

Setup

After the required software is installed "vainfo" should return the supported decoders. vdpauinfo will return an error. Create a file (as root) /etc/profile.d/vdpau_vaapi.sh containing:

#!/bin/sh
export VDPAU_DRIVER=va_gl

Save and add execute permissions (chmod +x vdpau_vaapi.sh). Log off and back on or execute the export command above and vdpauinfo should return the supported codecs. Then modify /etc/adobe/mms.cfg and uncomment or add 

EnableLinuxHWVideoDecode=1

Next in chrome://flags enable 

Override software rendering list

Now it should work!

Notes:

  1. This works with flashplugin (11.2). I haven't played with it much, but it doesn't seem to work with pepper-flash (11.8). It has lower cpu usage than 11.2 with EnableLinuxHWVideoDecode commented out in /etc/adobe/mms.cfg, but uncommenting it has no effect. Either it's looking somewhere else for that config or it doesn't support it. 11.2 drops way below 11.8 with it enabled.
  2. Obviously different chipsets support different codecs, some may not support any at all. The VA-API Wiki page linked below has some info to that end.
  3. The Chrome flag may improve overall performance or it may break things / slow things down. you'll have to try it and see.
  4. You can check chrome://flash and chrome://gpu before and after to see what changes.

Links

My PCB Fabrication Process

Desulfator

My last desulfator design was Rev B. I decided it should be Rev A (even though Rev B is etched on the board), as it was the first desulfator board I actually built. For future reference I'm doing major revisions A, B, C, but minor (and or pre release) tweaks 001, 002, etc. So this should be Rev A 003, I think.

For more information on the desulfator see my previous post here.

Specs / Limitations


  • When I do the layout I've found I can etch down to about 0.010"(50% success), but 0.020" is much more forgiving (80+% success). So I do most of my traces as 0.020". but they won't fit between some pins, so I run a 0.020" trace as close as I can, end it, put a 0.010-0.012 trace in the tight spot, end it, and continue with a 0.020 trace.
  • I try to maintain 0.025" clearance around traces, since I don't use a solder mask it helps me avoid bridging traces.
  • I flood-fill everything I can, the more copper I leave on the board the quicker it etches.
  • So far I only do single-sided boards. Hasn't been a huge issue yet. I'd be tempted to just order 2 sided boards when I need them.

I use the toner transfer method for both the etch resist and the silkscreen. As far as prep it goes like this:
Copper Side First
  1. Sand board with 400grit (wet sandpaper) wet with just a drop of dish soap
  2. Dry board with a paper towel
  3. Apply rubbing alcohol and dry with a paper towel.
  4. Print resist on a piece of shiny paper, I have varing results with this, seems to depend on the paper I find. I read that the (glossy) whites of newspaper / magazine ads worked the best, but I find that some heavily colored ads have more of the wax / clay stuff on them and work better for me, with the exception of the silk screen side (more on that later)
  5. Align board and paper, either fold the ends over to keep it in place or use a tiny piece of tape. Then run through laminator 5+ times.
  6. Soak in cold water until paper starts to dissolve. Some times it peels off, other times I have to rub it until just the toner remains. sometimes I loose traces and stuff, if it's not too tight I continue, otherwise back to step 1.
  7. Gently dry and examine carefully, touch up little holes in the flood fills and broken traces with a permanent sharpe(3 coats).
Etching
For etching I use cupric chloride, it works really good above 60F, somewhere around 40-50F and below it's really slow. It needs to work fairly fast, the majority of the problems I've had with it were when it's cold out and instead of 20-40 minutes it took 2-3 hours.

I keep it out in the garage, as I prefer not to risk spilling stuff like that in the house. (I don't want to spill it out there either, but I have better ventilation and access to a garden hose for emergency clean-up)

    8. Etch until traces are isolated.
    9. Rinse thoroughly, then Sand with 400 grit to remove toner, should look
        like this: (note the 2 is missing from the 2013? yep, didn't transfer perfect)
Bottom
Then the Front (silkscreen)
    10. Dry then drill two holes (for through-hole parts) as far apart as possible
          (either corner would be good) and use them to align your silk screen (do
          steps 3-6). I poke a wire right through the board and paper for alignment.
          (remove wire before running through laminator) Note: I try to use mostly
          white paper for this as the colors tend to stick.
Top
When it's all assembled and tested I spray the copper side with several thick coats of Rust-Oleum clear coat.

Thursday, September 12, 2013

ATI Hardware Video Decoding on Linux! VDPAU, VA-API, and Flash!

XKCD - Supported Features
I love that XKCD. Anyway, I built a HTPC / home server around a Biostar Deluxe A681-350. It is powered by a AMD E-350 APU that combines a dual core 1.6ghz cpu and an ATI Radeon HD 6310 gpu on one chip. It's a low end system, but I don't need a lot of power here. It handles full screen 1080i video from an ATSC tuner beautifully. It won't play 360p flash smooth at 1/2 screen, and it's a slide show at full screen (1920x1200). It just doesn't have the CPU to decode and scale video. Mythtv uses hardware scaling, so it only has to decode on the cpu, and ffmpeg's software decoders are well optimized.

Today I installed Arch Linux on it. This post was going to cover that, but I discovered hardware acceleration for flash on ATI chipsets works!

Comparison

  • With software decoding and rendering flash takes 60-75% of my total cpu time (windowed, scaled as large as smooth playback allows).
  • With hardware decoding and (possibly?) rendering it takes 10-25% and plays smoothly full-screen.

 Requirements

  • A very up-to date system. (Arch hasn't supported it long, most distro's will probably take some time to, but you may find a ppa or can always compile from source)
  • kernel 3.10+
  • mesa 9.2+
  • libvdpau
  • ati-dri
  • xf86-video-ati
  • flashplugin

Optional

  • vdpauinfo (print info about VDPAU (and show's it's working)
  • vainfo (same as above, but for VA-API)
  • libva-vdpau-driver (allows va-api enabled apps to be accelerated)
  • libva

Setup

Assuming you have installed all these packages vdpauinfo should spit out a bunch of information on what's supported. If it doesn't you may need to specify the driver. I didn't need to, but you might (shouldn't) need to add something like this to your environment variables:

VDPAU_DRIVER=

Flash probably won't work until you edit /etc/adobe/mms.cfg and uncomment the line:

EnableLinuxHWVideoDecode=1

I haven't tried it in anything but chromium, so I'll stick to that for now. In chrome://flags I had to enable

Override software rendering list

Now Flash should have hardware decoding! MythTV can be configured to use vdpau decoding and it works nicely too.

VA-API

(I haven't messed with VA-API much, so this may or may not work.) For VA-API it may be necessary to add the following to your environment variables setup. (you don't need this for flash, it only supports vdpau)

LIBVA_DRIVER_NAME=vdpau

One way to do this is create a file (as root) /etc/profile.d/vaapi_vdpau.sh containing:

#!/bin/sh
export LIBVA_DRIVER_NAME=vdpau

Save and add execute permissions (chmod +x vaapi_vdpau.sh . Log off and back on or execute the export command above and vainfo should return the supported codecs.

Notes

  1. It only works with the open source driver, though there is a way to get it in fglrx. (see https://bbs.archlinux.org/viewtopic.php?id=166593&p=1)
  2. Before "top" shows flash using 120-150% cpu. After "top" shows  20-50% (dual core = 200% max)
  3. This works with flashplugin (11.2). I haven't played with it much, but it doesn't seem to work with pepper-flash (11.8). It has lower cpu usage than 11.2 with EnableLinuxHWVideoDecode commented out in /etc/adobe/mms.cfg, but uncommenting it has no effect. Either it's looking somewhere else for that config or it doesn't support it. CPU usage under 11.2 drops way below 11.8 with it enabled.
  4. Obviously different chipsets support different codecs, some may not support any at all. The VA-API Wiki page linked below has some info to that end.
  5. The Chrome flag may improve overall performance or it may break things / slow things down. you'll have to try it and see.
  6. You can check chrome://flash and chrome://gpu before and after to see what changes.

        Links:



        Tuesday, September 10, 2013

        Arch Linux Fun

        I just installed Arch Linux on my laptop, because I apparently have nothing better to do. OK, that's not true, there are lots of things I "Should" be doing, but today I'm messing with Linux instead.

        Arch Linux with Cinnamon and an Awesome Wolf Background

        Live USB Boot 

        I hit a snags right off the bat. I installed the arch iso to a thumbdrive with unetbootin and it seemed unable to locate the media. Just sat there saying "Mounting '/dev/disk/by-label' to '/run/archiso/bootmnt'" and "Waiting 30 seconds for device /dev/disk/bylabel". After a brief search I discovered this was a common problem and the simple solution was to "dd" the image over your thumbdrive. Uh, what about the other files on there? Arch needs to work on this. I know Ubuntu and Parted Magic both fine from a unetbooting usb. So I hunted a bit more and found you can specify the right device as "archisodevice=/dev/sdb1" for example. Ha! too easy, if I specified it as sdb1 it would detect the usb drive as sda. Change it to sda and it's detected as sdb. WTF! Finally I set it to sdb1 and pulled the drive as soon as the kernel had loaded, plugged it back in and it booted right up. Whew, what a PITA just to boot a live USB!

        Installation

        The installation was complicated compared to Ubuntu or Mint, but I just followed the beginners guide and it went smoothly. Wifi worked and everything. I highly recommend a second computer / tablet / etc. on hand if you decide to install Arch. One reason I wanted Arch was the lack of junk cluttering up my system, things updating in the background, etc.I admit I install a bunch of junk myself, but at least I have some control. It took a couple hours, but I have a usable OS on my laptop. Lots more tweaking to do yet. Seriously, it took longer to get the usb to boot than install the system.

        Things I Like

        There are a lot of really nice features that appeal to me.
        • Boots unbelievably fast.
        • I'd eventually like to have a single distro on all my computers. With Arch you can do a headless server, a media center, a desktop workstation or a portable laptop. The base is the same, just install the packages you need for your application.
        • A local package cache / repository on my HTPC / Server would be cool. Most distro's can do that, so I don't know that this is a major plus, but it's availible.
        • I don't mind the pacman / apt-get / emerge command line tools, but synaptic is slow, and the "linux app store" doesn't appeal to me. So far I love yaourt when used with yaourt-gui, a bash gui for yaourt. It take a little fiddling to get installed, but it will manage pacman, AUR, etc. quickly and beautifully.
        • The AUR, it's huge! if you can't get an official package, it's probably in the AUR.
        • Arch doesn't hold your hand with tons of helper scripts to make everything "just work". While that can be good or bad, I'm counting it a good, as you get a better understanding of what's going on right from the start. That (hopefully) makes problems easier to solve later.
        • It's more up to date. I loved this about Gentoo, that you had recent packages. I installed MyPaint, because it works nicely with my laptop's Wacom penabled screen, and there are all kinds of buttons and options that weren't there on Ubuntu! Ubuntu has 1.0.0-1, Arch has 1.1.0-2.
        • Rolling release. In theory once installed I should never need to re-install. just update the system when I feel like it.
        • No "Update Manager" nagging me to update all the time. I hate windows for it's constant updates (always at inconvenient times) and some Linux distros seems to want that "functionality" too. It's running in the background without my knowledge too, I don't like that.
        • No "error reporting" pop-ups I get too many of these for a supposedly stable system, I understand the need for error reports, but I'm watching a movie and have to get up to get that dumb window out of the way.

        Things I Don't Like

        • Arch is MUCH more complicated to install as opposed to Mint or Ubuntu. It didn't take me that long to have a working system, but I wouldn't recommend it to a beginner or at least not as an introduction to Linux. I used to use Gentoo, which I feel is even more complicated, but just didn't have the ambition to keep it working.
        • The installation ISO really sucked for me, YMMV.
        • I have a working system, but it's not nearly as pretty or complete as Mint 15 yet (I installed Cinnamon). I foresee a lot of tweak time to get it just the way I want. This may lead to frustration, like Gentoo years ago. I dropped Gentoo because, at the time, it took a ~3 days of compiling to install the base system and get X running with the basics (Firefox, Fluxbox, file manger, etc.) and the better part of a week for a full desktop environment (KDE at the time).

        Conclusion

        So far I like what I see. The install was a bit aggravating, but I shouldn’t have to do that too often. I love yaourt-gui, it really makes package management quick and easy.
        I think I'm going to swap my HTPC / Server over to Arch eventually. I have some performance issues with Mint 15 and haven't been able to track them down. I don't know if it's Mint or just the my hardware. Either way I hope I can squeeze a little more out of Arch.
        If you have an excess of free time try it, it's easier than Gentoo and you end up with a distro that's tailored to you. All the stuff you want with none of the stuff you don't.

        Links:

        Arch Linux - https://www.archlinux.org/
        Yaourt - https://wiki.archlinux.org/index.php/Yaourt
        Awesome Wolf Art Source - http://www.deviantart.com/art/wolf-324819837

        Monday, August 26, 2013

        Briggs and Stratton 21HP Won't Crank Over

        My Grandparents new lawnmower refused to start, it would crank part way over and the compression stroke would stop it. It was under warranty, so Sears sent a guy out, it wasn't the valve adjustment, starter, or anything simple, so he came back and put a new engine on it. We've got a broken cub cadet, also my grandparents, that had a Kohler Courage which cracked the engine case after 2-3 years! I told them not to buy another one of those! But the Briggs didn't survive 6 months! The repairman didn't need the old engine, so he didn't mind leaving it for me to try to fix.

        Specs


        • 21HP Briggs and Stratton
        • MFG in 2012
        • 331877 - 2371 - G5

        Pictures!

        Top
        Insides
        Here's the problem, the compression release weight has failed.

        Camshaft and compression release weight
        It's made of some sort of cast metal! The hole for the shaft is 1/2 the thickness of the actual weight! What are you thinking Briggs? At least machine it from mild steel, then it wouldn't snap!
        Broken compression release weight
        Well that's the problem, a new camshaft will cost ~$80, but if it has the same cast weight on it I don't know that I want it! I'm not sure how to proceed at this point. I could try grinding one out of steel, but that's going to be a job.

        UPDATE: We decided to go ahead with the new camshaft. It's installed on the Cub Cadet and still working as of April 2015.

        Wednesday, June 5, 2013

        Linux Mint 15 and Amazon Video (This also affects other video sites)

        I just bought a new drive for my HTPC, A 3tb WD Red, but that's for another post. I had Amazon video working on Mythbuntu (just had to install HAL) but installing HAL on my (fairly) fresh new Linux Mint 15 install didn't work. I finally figured it out, with some help of course

        What I've found:
        1. Amazon's error is completely useless. It makes you think that you have the wrong version of flash.
        2. If you haven't already, you need to install hal and libhal1 "sudo apt-get install hal libhal1"
        3. Adobe has a guide for sorting out these problems once you figure out it's DRM related. Here the test page was the most helpful.
        4. The test page gave me the cryptic error 3322 - device binding failed. 
        5. I tried the solution found here, "rm -r ~.adobe/Flash_Player" it didn't work, but was needed later, after I actually fixed the problem
        6. It turns out HAL wasn't starting, I ran "sudo hald --daemon=no --verbose=yes" it spat out a bunch of errors and died. I found the solution here, I'm not sure it's a perfect solution, but I ran "sudo rm -r /etc/hal" then "sudo ln -sn /usr/share/hal /etc/hal" and HAL runs! I think I will copy rather than link it at some point, but that's what I did.
        7. I rebooted and the test page still doesn't work, I had to do step 5 again, now it works.
        Whew, only took me half the night to figure that one out.

        Notes:
        I tried this on Linux Mint 14.1 and just installing HAL worked, I couldn't reproduce the problem on 15 by removing the /etc/hal directory. It's possible I corrupted something at some point, I'll try on a clean Mint 15 install sometime and report back.

        I also got a 3323 error while HAL was broke, also fixed with #5.


        Update: Only steps 2, 5, and 6 are necessary to solve the problem, the others are either diagnostics or irrelevant. (Thanks Douglas Roberts!)

        Update 2: This affects other sites (Thanks NikAmi!), I don't really have the time to determine which ones myself, so I'll do a list and update it if anyone finds one that needs it (Post it in the comments). It may help someone else.
        Known Sites Also Affected:
        NBC Sports

        Update 3: There is a package available (at least in Arch Linux's AUR) called HAL-Flash that lets you play DRM Flash content without needing the HAL package / daemon. I'm using it on both my laptop and HTPC and it seems to work fine.

        Update 4: Chromium no longer supports NPAPI (netscape plugin API), pepper-flash doesn't work with protected files. Firefox still uses NPAPI and works with Amazon Prime Video. HD doesn't seem to work for me, but SD works fine. I'm not sure why.

        Friday, April 26, 2013

        RobertShaw HS780 Teardown

        I recently replaced a old furnace with a 90+ for my father, I don't recall the make or model of the old furnace, but I salvaged some parts from it to look at. Today we have a Robertshaw HS780 Hot Surface ignition control. The furnace was working, so there wasn't a failure to fix, but it may be of some interest.
        RobertShaw HS780
        If you watch the video be warned, It's my first attempt at an ad-lib teardown. I kept talking as I figured out the board and was a bit off. It's not bad, hope to do better next time. I think the left small relay is the gas valve, the right one powers up this board when the thermostat closes.

        Top
        Bottom
        By far the most common failure on HSI ignition systems is the ignitor (not this control). They are fairly fragile. Never touch the heating part, it could cause early failure.

        Diagnosis would go like this:
        • 120VAC present at terminals labeled 120 and NEUT?
        • 24VAC present at TH and TR? (thermostat calling for heat?)
        • When calling for heat is 120V present at  IGN terminals AND HSI not glowing? (if yes replace HSI, if no suspect large relay)
        • HSI Glows and 24VAC present between VALVE and GND? (if yes, suspect gas valve / safety switches/wiring, if no suspect outer small relay)
        • Failing all that test the inner small relay, inspect all solder joints for failure and caps for leakage. (if you can't find anything at this point consider replacing the control.)
        Sometimes a relay will actually fail (shorted coil, open coil, or bad contacts) and they can often be sourced for $5-10 from digikey or a similar company.

        video
        Video Notes:
        1. The fan/limit control won't come apart easily.
        2. Typical setting are ~100 fan off, ~120 fan on, ~180 high limit.
        3. You shouldn't be bouncing off the high limit, if you are you have an airflow problem, oversized furnace, etc.
        4. Flame sense is through the ignitor.

        Thursday, February 21, 2013

        Lead Acid Battery Desulfator

        UPDATE 2:
        My parts have arrived, I've got the schematic sorted out (I think). I think I'm going to do a start to finish post on my current PCB fab procedure and make a new board, even though the other one seems to work. I've got the correct parts and the other pcb is together and working. I'd like to see if they work differently.

        Desulfator-RevB - KiCAD 3D Render

        The Theory:
        When a lead acid battery sets discharged sulfate crystals form on the  plates, reducing the surface area and thus potential capacity of the battery. A desulfator pulses a high voltage / current spike into the battery that causes vibrations that knock the sulfate crystals off the plates.
        The usual frequency is around 1khz, though the vibrations are usually in the mhz range. It's described as ringing a bell. The desulfator rings it a thousand times a second and the harmonic vibrations actually do all the work. Therefore the actual frequency doesn't seem to be particularly important.
        It would probably be best to remove the battery from the vehicle so we don't pulse high voltage through computers, regulators, etc. It may take a week to several months to restore a battery anyway, so doing it out of vehicle is preferable anyway.

        Desulfator Rev. B - Top
        The Specs:
        • Unit is controlled by the venerable 555 timer, although an attiny would work and allow more control / monitoring of progress.  (Possible future design)
        • Should work on many voltages
        • May work on nicad's too.
        • This is basically a reference design. I want to see if (and how well) it works before spending a lot of time designing my own system (if I even need too, let's not go reinventing the wheel right?)
        • I'm trying for a compact design, altoids tin or smaller. preferably 50mm x 50mm, as if it works well I may get a batch made and try to sell them.

        Desulfator Rev B - Bottom
        Limitations:
        • As the battery size increases the amperage needs to increase. Two resistors can be replaced with pots to adjust the frequency and duty cycle of the 555, but this results in increased heat on the inductors. (we'll try the default settings to start)
        • Increased amperage requires bigger, more expensive inductors.
        • It's not self-powered, so a trickle charge is needed for operation.
        • No reverse - polarity protection, hook it up backwards and you will probably destroy it. (I'm going to look into this, doesn't seem it would be too hard to prevent this, definitely looking into this before selling any)
        Notes:
        I'm basing this on Ron Ingraham's design, I don't think he followed the component numbering of the original, so if they say you can substitute something for R1, it may not be R1 in the schematic.

        Update 1:
        My parts haven't arrived and I've run out of patience. So I scrounged some inductors (about 600uh and 180uh) substituted some other parts and it seems to work.

        Only found two problems:
        1. I  missed a trace (somehow missed it in the schematic) and that prevented the duty cycle from dropping below 25% and caused the frequency to change with it. it was really frustrating. I eventually found it and added a bodge wire. Now RV2 adjusts frequency and RV4 adjusts duty cycle. I also added a 180K resistor to RV2, but that's just because I only had 100K pots (should have been at least 300K+. I highly recommend using pots for these. Then you can just dial it right in. (with a power supply and scope or by ear and watching that nothing gets hot)
        2. Stupid (me) used non-polarised caps (C) instead of polarised caps (CP) in the schematic, so 3 caps were backwards.

        I've corrected all these things in the schematic. I need to clean up the schematic and get it uploaded. I'm not sure if I'm going to roll all this into Rev B or go to Rev C. I have made a number of minor changes, but it's not a redesign by any means.





        Rev. B Changes:
        1. Replaced R2 & R4 with Pot's for adjustment. Resistors should fit instead, so it's optional
        2. Added C41, C43 for more options on the low esr cap.
        3. Noted in schematic different options for assembly.
        4. Has component locations for several variations on the circuit. Board shouldn't be completely populated.
        5. Might have placed the power connector on backwards. Oops.
        6. PCB layout is Copyright for now. Free for Personal Use. I may release it to public domain eventually. I just don't want anyone selling these untested boards yet.

        Links:
        KiCAD + PDF Files

        Make sure you add the cache library at the very top of the KiCAD libraries for the schematic. It's a PITA it doesn't do this automatically. The PDF's may or may not work, they gave me a fit. Make sure you print at 100%, no scaling.
        Pictures of latest board in my PCB Fab post

        Desulfator Information (mine is based on the low power - Ron Ingraham design)

        Saturday, January 12, 2013

        Drill Press Chuck Repair

        I've been thinking about starting on another 3d printer, I have some spare time and I gave the one I started last year away. I have some angle iron and a bunch of 608ZZ bearings, so what's stopping me?
        The chuck on my drill press broke. At first it just wouldn't tighten up, then it fell apart (some time ago, I hadn't gotten around to replacing it yet).

        Note: Picture taken after I started on the repair.
        From what I can tell the ring shaped piece is supposed to be one piece and the outer piece is held to it by a tight fit. I tried heating the outer piece and shrinking it onto the broken ring without success, undoubtedly it's worn and there is just too much force from the chuck key. At this point I priced a new (cheap) one at $25. Not bad, but I have one more last ditch effort before I buy it.

        Plan B

        I took an angle grinder and ground a hole on each side through the outer piece aligned where the ring sets (with it disassembled). I aligned my hole with the crack in the ring and touched it with the grinder to clean for welding.
        Prepped
        I heated it with a propane torch prior to welding, I've found this helpful when welding heavy steel with a small MIG.
        Welded

        Ground Smooth(ish)
        It seems to work, tightens and loosens freely, doesn't slip when reefing on it with the key either. It's a quick, cheap fix, so if it fails I haven't lost anything and I'll have to buy a new one.
        Now I have to find my drill bits and make some slides.





        Friday, January 11, 2013

        My Failed Fan Controller Design

        I've spent all the time and resources I'm willing to on this project for now. I may complete it at a later date. It all works except the input voltage from the furnace transformer is too high after rectification (38-40v).  The 78M05 I'm using is 35v max and it doesn't tolerate any more. It doesn't seem to damage it, as even after testing as bad on the furnace it works fine on 18v (max on my lab PS) I tried to build a SMPS replacement based on Roman Black's design, that also worked fine on 18v and blew at least a zener diode when on the furnace. I used parts I had on hand, so sometime I will get precise values and try again. For now I'm ordering a snap-disk. Perhaps some of this design may be useful to someone for other purposes. It really sucks, as the controller works fine, I just can't get the voltage regulated to 5v. If you have any ideas feel free to comment. It's probably easy and I'm just not seeing it :)

        My Dad's woodstove is ducted into his furnace. It works OK, but he has to manually turn the blower fan on to circulate the air through the house. This is OK when they're up and keep the fire going, but if they don't get up during the night the fire burns down and it circulates cold basement air. Brrrr



        I realize I could just use a therm-o-disk, but what fun is that?

        Plus I get a bit more practice making boards. NOTE: I bumped the zone fill clearance from .020 to .025, that definitely helped me not bridge pins to ground. It's a simple board and I used mostly .025 traces with a few .012 and .080 ones as needed. I can etch .012 very consistently, even .008 fairly well, but I keep tearing pads off drilling. The extra copper seems to help considerably. Extra copper around pad make things much easier drilling and mounting. Essential for wire connections. My first board's traces got torn up where wires mounted (all .012 traces). Notice the pads across the top of the following image compared with the bottom of the board above:



         Requirements:
        • Run off furnace power (28VAC)
        • Switch fan on at approx 120F, off at 90f
        • Make sure fan runs at least 10 minutes when turned on.
        • Cheap, hopefully less than a $15 T-O-D
        Specs:
        • Controlled by a attiny85
        • PCB was done for a full-bridge rectifier, but we may use a half-bridge to keep the voltage under control. (use 2 diodes instead of 4) (Note: Didn't Work)
        • Used Salvaged Components where possible
        Parts List:
        • Attiny85 ($1.30) 
        • lm335a Sensor ($1.00) (I had some of these, I would use a mcp9700-e/to($0.25) in the future. the board supports it, just omit the 2k resistor)
        • lm7805 Regulator ($0.50)
        • 2n7000 mosfet ($0.60)
        • 2x 1n4007 diodes ($0.50x2)
        • 330u 50v cap (salvage)
        • 10u cap(salvage)
        • 0.1u cap
        • 10K resistor
        • 2K Resistor (omit for mcp9700)
        • RY5W-K Relay (salvage)(you can get ones with ~30ma coils for less than $2.50 and drop the mosfet, though a mosfet does make it more robust IMO) You could also try a solid state relay
        Schematic

        The 7805 was a bit close to the cap, that will be fixed in the linked files. I intended to use a to-92 regulator, but the one I had was rated for 100MA. I thought my relay was 150MA. It was a last minute change. As it turns out it uses about 9MA idle and 54MA with relay powered. I could have used the to-92 after all.Total cost was under $5, though to buy all the parts would be more like $10, the cheapest T-O-D I found was $8. If I have the wrong temp with this I just reflash the chip, with a T-O-D I buy a different one.



        Code is in Arduino, you will need the attiny85 hardware files, a programmer or an arduino, some wires and bits. See this guide for more information. I may redo it in AVR C sometime, I just wanted it up and running. I didn't need to do anything special.

         /*  
          Fan Controller intended for a attiny85, but takes ~3k, change pins below for arduino and uncomment the serial for debugging on the arduino.  
          it's intended for a furnace, so no fancy pwm or anything, thought it wouldn't be hard to add.  
          Stephen Evans - stevesfixitshop.blogspot.com  
          */  
            
         #define INPIN 3  
         #define OUTPIN 2  
         #define ONTEMP 48  
         #define OFFTEMP 32  
         #define DEL 600000  
           
         unsigned long wait = 0;  
         int avread = 0;  
         int ain[10];  
         int i = 0;  
         void setup() {  
         // Serial.begin(9600);  
          pinMode(OUTPIN, OUTPUT);  
         }  
           
         void loop() {  
          //make 10 readings  
          while(i<=9){  
           ain[i] = analogRead(INPIN);  
           delay(10); // wait for adc to stabilise  
           i++;  
          }  
          i=0;  
            
          //average the readings  
          avread = 0;  
          while(i<=9){  
           avread = avread + ain[i];  
           i++;  
          }  
          i=0;  
          avread = avread / 10;  
            
          //Convert reading to degrees C  
          float sensorValue = ((avread*4.8)/10)-284.15;  
         // Serial.println(sensorValue);  
            
          // turn fan on  
          if(sensorValue >= ONTEMP){  
           digitalWrite(OUTPIN, HIGH);  
           wait = millis() + DEL;  
          }  
            
          // turn fan off if below set temp and delay has passed.  
          else if (sensorValue <= OFFTEMP && millis() >= wait){  
           digitalWrite(OUTPIN,LOW);  
          }  
          // every 50 days millis rolls over to 0, this makes sure it doesn't mess things up  
          else if (millis() <= (wait-DEL-50)){  
           wait = millis();  
          }  
            
         }