DIY projects of woodworking, home automation, electronics and software development for the Macintosh.
Tuesday, June 12, 2012
RFID for XTension
It’s remarkably easy to setup an RFID access control system with XTension even though the parts dont always come with a fancy plastic case and a DB9 plug.
Sunday, June 10, 2012
Wiznet Configurator for Mac v2
Update 12/21/2020: The home of the Wiznet Configurator for Mac has moved to the Mac Home Automation site. There is a new version hosted there which is fully notarized for Catalina and newer as well as having native code for Apple Silicon.
This version also adds the ability to save and restore configurations to disk.
previous entries with more information here and before that here. XTension is my day job and is Home Automation and Security software for the Macintosh.
new download links:
Wiznet Configurator MacOS Universal
Wiznet Configurator Linux
Saturday, May 19, 2012
Tivo Expander Drive Internals
Everybody wants more space in their DVR right? And if you have TiVO you can purchase one of the ludicrously overpriced hard drives with the custom partitioning scheme called a “tivo expander” that western digital sells to pair with the drive in the TiVO. When I first decided to do this I was appalled that they should cost so much more than the cheapest drive from WD that I could find. They can’t be any different can they? It didn’t seem like online at the time people were having very good luck creating one for themselves with a regular disk and it turns out the plug on the TiVO is not a standard SATA plug but something slightly different, or at least the plastics are keyed differently meaning you can’t plug in the same cable you got with that el-cheapo drive.
So I gave in and bought one. It ran happily for years and then died. It’s been in the bottom of a drawer with dozens of other dead or now unneeded pieces of kit that I’ve been unable to part with. Recently I’ve been cleaning out my flotsam but rather than throwing them out I’ve been pulling them apart and hanging the boards up on my bathroom wall as a kind of geek wallpaper. So I tore into this drive to get the board out and the platters to hang up on the wall and was surprised to see that it actually is considerably overbuilt compared to other disk drives I’ve torn apart. The first thing that clued me in was the thickness of the platters themselves. They are twice as thick as a non-TiVO platter from WD.
So I gave in and bought one. It ran happily for years and then died. It’s been in the bottom of a drawer with dozens of other dead or now unneeded pieces of kit that I’ve been unable to part with. Recently I’ve been cleaning out my flotsam but rather than throwing them out I’ve been pulling them apart and hanging the boards up on my bathroom wall as a kind of geek wallpaper. So I tore into this drive to get the board out and the platters to hang up on the wall and was surprised to see that it actually is considerably overbuilt compared to other disk drives I’ve torn apart. The first thing that clued me in was the thickness of the platters themselves. They are twice as thick as a non-TiVO platter from WD.
when I picked it up I knew I should be taking a picture of this for posterity. Here it is compared to a disk from a more recent WD disk that failed:
By caliper measurement it’s actually twice as thick at 1.75mm!
the other WD platter at .82mm
and the TiVO expander at 1.75mm.
Additionally there were these odd spacers between each platter, just machined pieces of aluminum:
What purpose they could serve I don’t know but I’ve never seen them in any other drive I’ve torn open, though I’m far from an expert on disk drives.
So it seems to me that these drives are actually built to a higher spec than the cheaper drives we get for most other things. I dont know if that helps, this one still didn’t last as long as it should have, but it does explain why they are more expensive, it’s not just a branding issue with TiVO.
Wednesday, May 2, 2012
Metering The Smart Meter: part, the 4th
I’ve made some significant progress in measuring those pulses from the smart meter that I talked about in previous blog entries. The IR remote receiver was a total fail in reliably receiving them as they weren’t modulated that way, or in any way to make their reception reliable or easy to manage. It’s just on/off once for each watt hour used.
So i built a new sensor to velcro over the LED on the meter. This one has just a phototransistor and some resisters, the values of which I failed to record and cannot remember. So i’ll have to sort that back out again before I can make more of them. I did some math to decide what they should be but have cleaned up the lab since then and the notes are gone... Need a notebook rather than scratch paper I think.
I’ll post the software when it’s all working. The problem with a phototransistor is that you have to measure the output on an analog pin. You can’t just get a nice pulse of digital on/off. So that means sampling in a loop and comparing the values. Though that phototransistor is in a black casing which reduces it’s sensitivity to regular light it still changes it’s values significantly when the sun is shining on the meter.
This makes it difficult to just pick 2 readings and call one the ON threshold and the other the OFF threshold for the LED. What I finally did was to save each loops reading into a buffer of an arbitrary size calculated that even for the lowest power use it will always contain samples from on and off. Then I walk that array and take the min/max of the values. Finally I create an ON threshold at a quarter of that difference above the min, and the OFF at a quarter below the max. These numbers adjust during the day as the light levels change and make sure that it can always tell the difference between an on and an off.
I still get the rare oddball pulse. It’s so reliable in it’s timing that it’s either real coming from the meter or that is the shortest time frame that can be calculated with the arduino that I’m using. I’ve added code to ignore a pulse if the calculated power usage is more than 150 amps. It is possible that this might actually ignore a real peak power usage starting up a large AC unit with a hard start kit on it or something like that, but thats probably an unlikely occurrence that wont change the overall calculations that much.
Once doing that I am now reporting to XTension a value for the last reporting period, at least 5 seconds between reports, the number of pulses counted for a more accurate overall usage than adding the calculated values together and lastly the average power usage for the period and the peak usage for the period. All together making a very nice graph inside XTension.
thats just the AC cycling on and off the other morning. Interesting the compressor profile there where it uses a lot of power initially (though no big startup spike) which drops off and then as it comes up to full operating pressure returns almost to the starting load. Does it every time too.
So i built a new sensor to velcro over the LED on the meter. This one has just a phototransistor and some resisters, the values of which I failed to record and cannot remember. So i’ll have to sort that back out again before I can make more of them. I did some math to decide what they should be but have cleaned up the lab since then and the notes are gone... Need a notebook rather than scratch paper I think.
I’ll post the software when it’s all working. The problem with a phototransistor is that you have to measure the output on an analog pin. You can’t just get a nice pulse of digital on/off. So that means sampling in a loop and comparing the values. Though that phototransistor is in a black casing which reduces it’s sensitivity to regular light it still changes it’s values significantly when the sun is shining on the meter.
This makes it difficult to just pick 2 readings and call one the ON threshold and the other the OFF threshold for the LED. What I finally did was to save each loops reading into a buffer of an arbitrary size calculated that even for the lowest power use it will always contain samples from on and off. Then I walk that array and take the min/max of the values. Finally I create an ON threshold at a quarter of that difference above the min, and the OFF at a quarter below the max. These numbers adjust during the day as the light levels change and make sure that it can always tell the difference between an on and an off.
I still get the rare oddball pulse. It’s so reliable in it’s timing that it’s either real coming from the meter or that is the shortest time frame that can be calculated with the arduino that I’m using. I’ve added code to ignore a pulse if the calculated power usage is more than 150 amps. It is possible that this might actually ignore a real peak power usage starting up a large AC unit with a hard start kit on it or something like that, but thats probably an unlikely occurrence that wont change the overall calculations that much.
Once doing that I am now reporting to XTension a value for the last reporting period, at least 5 seconds between reports, the number of pulses counted for a more accurate overall usage than adding the calculated values together and lastly the average power usage for the period and the peak usage for the period. All together making a very nice graph inside XTension.
thats just the AC cycling on and off the other morning. Interesting the compressor profile there where it uses a lot of power initially (though no big startup spike) which drops off and then as it comes up to full operating pressure returns almost to the starting load. Does it every time too.
This one is me cooking dinner the other day and you can see the electric stove elements cycling on and off and the spikes they generated when they first turned on. The graphing software needs some help there calculating the x axis lines ;) Dont know why that is so bad looking, but I never tested it with such a wide range of values.
This reports up to XTension through the serial port of an xBee, the next project will be to get it working with the wifi version of the xBee which I just received a couple of from Digi and will start messing around with shortly. Adding support for those and the traditional xbee radios to XTension really opens up a lot of possibilities. Here’s the Wifi one:
Monday, April 23, 2012
Steampunk Photo Cube Lamp
A little over a year ago a friend of mine saw This Instructable for the “Architectonic Photo Cube” and I offered to build it for her if she ordered the pictures printed to glass. That was not long after we had moved and what with life in general the pictures sat here for a year before I got around to putting them together. I decided to use brass fittings rather than the standard zinc plated and build a nice oak/brass base for the lamp. Since she had waited so long I spent some extra effort on the switch putting in a little knife switch to control the lamp and since it had a second position that would have been boring as just “still off” I put a Candle Flicker LED on the second position so that the lamp can be operated in either lamp mode, or candle mode.
Assembling the photo plates I did pretty much according to the instructable. They look really nice in brass. The corner braces that I got in brass were larger 2” than the ones called for in the instructable so my angle brackers are closer together in the middle a bit, but it wasn’t a problem and looks just as good.
Assembling the photo plates I did pretty much according to the instructable. They look really nice in brass. The corner braces that I got in brass were larger 2” than the ones called for in the instructable so my angle brackers are closer together in the middle a bit, but it wasn’t a problem and looks just as good.
The springs are completely decorative and serve no purpose other than decoration. I was thinking I’d have to wind some copper coils to make them look good against the brass, but I just bought a couple of packs of assorted springs at HD and they were enough to fit. I might have gotten shorter screws than these too as the whole thing is rather more spiky than it technically needs to be but it’s still a stylistic approach.
The base is cut from a piece of 3/4 oak with oak molding around the bottom piece and the top piece has a small routed ogee at the top. The bottom has a cutout under the top part to fit the electronics.
This is a 7 watt Phillips LEd bulb, but we ultimately went with a 3 watt one to just illuminate the photos without trying to actually cast light, it was a better look. The 10mm candle flicker LED is also visible in this picture as well as the brass shelf brackets that I used to hold the top in place. Since the angle brackets I used were 2” ones the tab from those brackets fits perfectly between the nuts on the bottom 2 screws and do an excellent job of holding it to the base but still allowing you to easily lift it off to turn around to show the other pictures.
The corners I used these brass corner brackets that are also just available at HD, they are supposed to go on the top of a box, but I thought they looked cool on the bottom of this where they sort of overhang the curve of the molding. Underneath them is just a regular stick on plastic non-slip foot thing to raise it up enough for the cord to get out.
The control system required some extra parts to make the knife switch safe, obviously you can’t put the 120v for the light through the knife switch. That black box there is a little 6v power supply that I just soldered to the power plug directly. That is that runs to the knife switch and powers the candle flicker LED. When the switch is in the other position it turns on a Solid State Relay that isolates the knife switch from the mains power needed for the LED bulb. I considered building a custom LED array to light it all from low voltage, but this offers more options for lighting and was actually much simpler. The 6v power supply there is just slightly too tall to fit glued in there with a cover over the entire assembly so I made a cutout for it. I could have dremeled or notched the bottom of the plate to cover it completely but I had made enough sawdust at this point and needed to finish the product ;) There are no exposed high voltage wires inside there even if little fingers should turn the lamp over and poke around.
See how well the brass shelf supports fit between the angle bracket screws. Measuring for where to drill the holes was tricky as the offset of the shelf supports was 3/8” and my table saw has come out of alignment a bit so that piece wasn’t quite square and the routed profile meant getting a measurement to the actual edge was a pain. But it’s close enough to centered that it looks fine unless you attack it with a ruler.
The cord completes the steampunk/vintage feel of the thing. Ordered a spool of absolutely beautiful fabric woven wire from Sundial Wire.
In the dark my camera made it look more like a steampunk nuclear reactor ;)
Wednesday, April 18, 2012
Resurrecting a Dead MacBook Pro
Seeing as how I collect all expired things Apple I came into possession of a “dead” MacBook pro of the generation prior to the new unibody construction. It had suffered the all too common malady that befalls that model of a dead video system on the motherboard. Being so completely out of warranty the owner opted to buy a new one rather than get it fixed. It gathered dust on my shelf here till I decided that I really wanted another machine here to run some monitoring software in the background for things.
The way the problem manifests is that the screen turns on at reboot and you see the grey apple display that usually precedes loading. The aspect ratio is off though, the apple is stretched side to side. If you see that then you know that as soon as the OS is loaded the screen will go dark. You cannot make the internal display nor the external DVI port support a monitor after that.
Being very clever, I thought, I purchased one of the USB/DVI adaptors that advertise Mac driver support. The one I’ve got is as “HIS MultiView II” that I purchased from newegg for just over $50. A small price to pay if it got this machine working again. The display driver worked great on my main machine in testing. Now all I had to do was get the old Mac booted again, which is patently refused to do.
I had discarded the battery for it at some point, most macbooks will boot without a battery but I read other accounts that said it sometimes just wont come to life without a battery. I ordered it a $27 replacement one from eBay.
In the meantime it occurred to me that the motherboard battery might be dead too and that might be while it refused to boot. Removing the motherboard battery on this model isn’t that hard, just have to remove the DVD drive and it’s right under there. I tested it at 2.8v which is low, but not dead. It was old though so I ordered a replacement (not an apple replacement, but just the 2032 liion coin cell with solder tabs. so it only cost $5 not $35 with the apple connector, I will salvage the connector from the old one when it arrives) but being impatient I connected my bench supply to the battery connections to try to power up the macbook with that and see if it would wake up, it refused to boot that way either.
The new main battery arrived and the machine booted right up. Even without the motherboard battery installed. Firstly I booted it into target disk mode, and then setup my wifes older generation unibody mac to boot from it’s drive. that way I could run updates on it, install the drivers for the USB video device and make sure that screen sharing was on so that if it was totally dark and nothing working I could still connect to it and control it.
When that was done I connected the USB device and rebooted it as itself and it all came up fine. And it ALL came up fine, even the internal video. The USb video worked fine too, but the internal was working. Run more updates, reboot, video still working. Install OS update, run all updates, reboot half a dozen times and each time the internal video kept working.
It’s possible it’s just messing with me and at the next reboot the internal video will die again, or it’s possible that not having a motherboard battery does something to it, or it’s possible that the install of the USB video drivers did something to it. But for the moment it’s working and that makes me happy. When the replacement mother board battery arrives I’ll install it and see if things change.
update: half a dozen more restarts later and the internal video continues to work. I’ve updated it to lion and run all the other updates since and it just keeps working.
update again (5/2/12) alas, good things cannot last forever and this morning it refused to wake from sleep. Upon restart it was dark again. However, I plugged in the USB adaptor and that is working fine. It does really work the processor pretty hard though so the fan is blasting at high speed while I watch the stock charts, I’ll need to get it a fan to sit on.
The way the problem manifests is that the screen turns on at reboot and you see the grey apple display that usually precedes loading. The aspect ratio is off though, the apple is stretched side to side. If you see that then you know that as soon as the OS is loaded the screen will go dark. You cannot make the internal display nor the external DVI port support a monitor after that.
Being very clever, I thought, I purchased one of the USB/DVI adaptors that advertise Mac driver support. The one I’ve got is as “HIS MultiView II” that I purchased from newegg for just over $50. A small price to pay if it got this machine working again. The display driver worked great on my main machine in testing. Now all I had to do was get the old Mac booted again, which is patently refused to do.
I had discarded the battery for it at some point, most macbooks will boot without a battery but I read other accounts that said it sometimes just wont come to life without a battery. I ordered it a $27 replacement one from eBay.
In the meantime it occurred to me that the motherboard battery might be dead too and that might be while it refused to boot. Removing the motherboard battery on this model isn’t that hard, just have to remove the DVD drive and it’s right under there. I tested it at 2.8v which is low, but not dead. It was old though so I ordered a replacement (not an apple replacement, but just the 2032 liion coin cell with solder tabs. so it only cost $5 not $35 with the apple connector, I will salvage the connector from the old one when it arrives) but being impatient I connected my bench supply to the battery connections to try to power up the macbook with that and see if it would wake up, it refused to boot that way either.
The new main battery arrived and the machine booted right up. Even without the motherboard battery installed. Firstly I booted it into target disk mode, and then setup my wifes older generation unibody mac to boot from it’s drive. that way I could run updates on it, install the drivers for the USB video device and make sure that screen sharing was on so that if it was totally dark and nothing working I could still connect to it and control it.
When that was done I connected the USB device and rebooted it as itself and it all came up fine. And it ALL came up fine, even the internal video. The USb video worked fine too, but the internal was working. Run more updates, reboot, video still working. Install OS update, run all updates, reboot half a dozen times and each time the internal video kept working.
It’s possible it’s just messing with me and at the next reboot the internal video will die again, or it’s possible that not having a motherboard battery does something to it, or it’s possible that the install of the USB video drivers did something to it. But for the moment it’s working and that makes me happy. When the replacement mother board battery arrives I’ll install it and see if things change.
update: half a dozen more restarts later and the internal video continues to work. I’ve updated it to lion and run all the other updates since and it just keeps working.
update again (5/2/12) alas, good things cannot last forever and this morning it refused to wake from sleep. Upon restart it was dark again. However, I plugged in the USB adaptor and that is working fine. It does really work the processor pretty hard though so the fan is blasting at high speed while I watch the stock charts, I’ll need to get it a fan to sit on.
Tuesday, April 17, 2012
IRS regulation scandal clearly demonstrates the problem
This is a blog about things that I make, but I’ve recently become aware of an example of how governmental regulation leads to monopolies that harm the public so perfect that I feel the need to write about it.
This is a truism:
“If you give the government the power to regulate a thing, that regulation is then for sale to the highest bidder, always and without exception.”
The current action at the IRS shows how this works. The only reason that you and I even know about it is that there is a real legal problem with their writing their own regulation. They aren’t granted the power to regulate themselves so it opens the possibility of their actions being stopped by lawsuit. We might also see congress grant them that right and then all bets are off. It’s going to be very interesting to watch.
Here’s whats happened as best as I understand it: H&R Block went to the IRS and “helped” them to come up with the idea that tax preparers need more education and oversight. Well.. nothing obviously wrong with that, our tax system is the most complicated part of our entire government and it’s actually impossible to file your taxes properly, any 2 auditors will come up with 2 different amounts that you actually owe. So the more training the better.
The consequences of this are that the independent tax preparer, of which there are around 100k in the US give or take, needs to take classes regularly and take tests to prove they are able to actually do your taxes. The cost of doing this, of course, is passed on to you when you hire them. Well thats OK you think, it is protecting me from people that don’t know how to do my taxes! The cost of preparing your taxes will more than double because of this.
Here’s the interesting bit though, H&R Block suggests to the IRS that well... if you’re supervised by a CPA then you don’t need to do this. This is the kicker, the dreaded “Grandfather clause” that exempts the monopolistic company that sponsored the legislation from it’s effects. This will eliminate the competitiveness of virtually every independent tax preparer without costing the big corporate ones another dime. Their prices can stay the same while they have effectively doubled the overhead for everyone not affiliated with one of the corporations.
This is truly a classic example of how this is done in every other agency. We begin with the idea that we need to regulate something to protect us and instead it gives the government the power to sell monopolies to the highest bidder. There is not a single agency, no matter how sacred to you, that is immune to this. The Coal and Oil magnates supported the EPA and the NRC in order that nuclear power could be regulated to the point where it cannot compete with them, all the while getting their own emissions of radiation up their smoke stacks classified as “naturally occurring” and therefore not subject to regulation. BRILLIANT! (factoid for another post: the amount of uranium that goes into the air as particulate emissions from coal plants in the US is greater than the total amount of uranium mined for use in our powerplants each year, but nobody is scared to death of dying from that, even though they actually DO)
Three letter agencies began because we wanted to do good are now used for evil. This happens ALL the time. If you see abuse by a monopoly or enormous corporation that there is no competition for (hello health care insurance) it’s because that company has been allowed to draft it’s own regulation and exempt itself so that nobody can challenge it. Why would ANYBODY buy health care insurance with the power they have over you if you didn’t have to? No, you’d search around until you found one that covered you for the amounts and the things that concern you. The reason you can’t do this is because the government doesn’t allow just any insurance company to go into this business. The health insurance problem in this country was caused by government regulation in the first place, adding thousands more pages of it in the form of price fixing will not solve it. (while our government seems to have failed jr high school civics class I remember the chapter on governmental price fixing and how it’s always a failure leading to higher prices or lack of availability hurting the very people it was supposed to protect.)
When someone calls for the downsizing of the EPA or the FDA they are not trying to leave you out in the cold to be victimized by hugely powerful corporations. They are trying to save you from that, that is where you already are because of the actions of those groups. The solution is to scale back, or remove entirely the governments power to regulate some things.
Or my personal favorite, a constitutional amendment that says “NO GRANDFATHER CLAUSES” if a law is important enough to pass it is important enough to apply to everyone equally. Nobody gets a pass.
And now back to making stuff, there will be no comments on this post, teh intertubes are full of angry people.
This is a truism:
“If you give the government the power to regulate a thing, that regulation is then for sale to the highest bidder, always and without exception.”
The current action at the IRS shows how this works. The only reason that you and I even know about it is that there is a real legal problem with their writing their own regulation. They aren’t granted the power to regulate themselves so it opens the possibility of their actions being stopped by lawsuit. We might also see congress grant them that right and then all bets are off. It’s going to be very interesting to watch.
Here’s whats happened as best as I understand it: H&R Block went to the IRS and “helped” them to come up with the idea that tax preparers need more education and oversight. Well.. nothing obviously wrong with that, our tax system is the most complicated part of our entire government and it’s actually impossible to file your taxes properly, any 2 auditors will come up with 2 different amounts that you actually owe. So the more training the better.
The consequences of this are that the independent tax preparer, of which there are around 100k in the US give or take, needs to take classes regularly and take tests to prove they are able to actually do your taxes. The cost of doing this, of course, is passed on to you when you hire them. Well thats OK you think, it is protecting me from people that don’t know how to do my taxes! The cost of preparing your taxes will more than double because of this.
Here’s the interesting bit though, H&R Block suggests to the IRS that well... if you’re supervised by a CPA then you don’t need to do this. This is the kicker, the dreaded “Grandfather clause” that exempts the monopolistic company that sponsored the legislation from it’s effects. This will eliminate the competitiveness of virtually every independent tax preparer without costing the big corporate ones another dime. Their prices can stay the same while they have effectively doubled the overhead for everyone not affiliated with one of the corporations.
This is truly a classic example of how this is done in every other agency. We begin with the idea that we need to regulate something to protect us and instead it gives the government the power to sell monopolies to the highest bidder. There is not a single agency, no matter how sacred to you, that is immune to this. The Coal and Oil magnates supported the EPA and the NRC in order that nuclear power could be regulated to the point where it cannot compete with them, all the while getting their own emissions of radiation up their smoke stacks classified as “naturally occurring” and therefore not subject to regulation. BRILLIANT! (factoid for another post: the amount of uranium that goes into the air as particulate emissions from coal plants in the US is greater than the total amount of uranium mined for use in our powerplants each year, but nobody is scared to death of dying from that, even though they actually DO)
Three letter agencies began because we wanted to do good are now used for evil. This happens ALL the time. If you see abuse by a monopoly or enormous corporation that there is no competition for (hello health care insurance) it’s because that company has been allowed to draft it’s own regulation and exempt itself so that nobody can challenge it. Why would ANYBODY buy health care insurance with the power they have over you if you didn’t have to? No, you’d search around until you found one that covered you for the amounts and the things that concern you. The reason you can’t do this is because the government doesn’t allow just any insurance company to go into this business. The health insurance problem in this country was caused by government regulation in the first place, adding thousands more pages of it in the form of price fixing will not solve it. (while our government seems to have failed jr high school civics class I remember the chapter on governmental price fixing and how it’s always a failure leading to higher prices or lack of availability hurting the very people it was supposed to protect.)
When someone calls for the downsizing of the EPA or the FDA they are not trying to leave you out in the cold to be victimized by hugely powerful corporations. They are trying to save you from that, that is where you already are because of the actions of those groups. The solution is to scale back, or remove entirely the governments power to regulate some things.
Or my personal favorite, a constitutional amendment that says “NO GRANDFATHER CLAUSES” if a law is important enough to pass it is important enough to apply to everyone equally. Nobody gets a pass.
And now back to making stuff, there will be no comments on this post, teh intertubes are full of angry people.
Subscribe to:
Posts (Atom)