Posted by Scott Hughes
Mon, 06 Mar 2006 05:08:00 GMT
It’s usually pretty tough living on the bleeding edge, but Apple has made things a lot easier with their switch to Intel. Thanks to Rosetta, you can still run just about all of your PowerPC applications under emulation. Since the emulation is obviously going to be slower, I’m trying to stay clear of any PowerPC apps if I can, especially if they are meant to run all the time (daemons). Apple created a handy logo to identify apps which are Universal (containing binary code for both Intel and PowerPC architectures), but I’ve found that there are some apps that still aren’t using logo. This means I typically have to visit the changelog of my favorite apps and search for the keyword “universal”. Optionally, you can download the app, select it in the finder, and hit Command-I to get its information screen. From there, you can see if it’s a PowerPC app under the “Kind” heading. It’ll read either “Kind: Application (Universal)” or “Kind: Application (PowerPC)”. If I find that it’s a PowerPC app, the url for it gets dragged into my “Waiting For Universal” folder in my Bookmarks Bar.
I did get bit by an app recently and I didn’t see it coming. I noticed a frustrating amount of slowdown on my MacBook Pro, especially when switching tasks. I searched for a long time to figure out which app I had loaded that was slowing me down by so much. My memory usage was extremely low, so disk swapping wasn’t the problem. CPU usage was next to nothing, so I was stumped as to what it could be. I had a 5-10 second delay when switching apps or when bringing up the dashboard, so something was definitely misbehaving. I checked my Console (Applications/Utiilities/Console.App) and I found that I had several plugins for Quicksilver and Mail.app which were throwing linker errors. The errors came from the fact that they are PowerPC plugins that got moved over via the Migration assistant. Even after removing those, I still had the noticable slowdown.
Finally I tried the Activity Monitor (Applications/Utiilities/ActivityMonitor.App). If you right-click on the column headers, you’ll see a drop-down to select which fields are available. Select the “Kind” field. Now sort on that field and you’ll see all of the PowerPC applications (those running under Rosetta) on your machine. These are the most likely to be causing slowdown, especially the daemon apps who are constantly performing work in the background. I found my culprit easily: The Delicious Library Dashboard Widget. Delicious Library was a Universal app, so I wouldn’t have suspected it. But the handy widget included with it has a separate binary component and that’s built as a PowerPC application (either that or the installer for the latest version failed to overwrite my old widget). After removing it from the Dashboard, I was again cruising at full speed. I sent Delicious Monster some feedback about the widget; seems to be an easy enough fix that I’ll bet it’s corrected before my RSS feed is updated.
If your MacBook Pro (or other Intel Mac) is experiencing slowdown (so early in its life!), I’d suggest you perform the same investigation. As an aside, here are some of the apps in my current waiting list now:
Posted in OSX | Tags MacBook, MacBook_Pro, MacBookPro, MacIntel, MacOSX | 4 comments
Posted by Scott Hughes
Tue, 28 Feb 2006 18:30:00 GMT
Damnit! I waited too long to flip my Mac Mini PPC on eBay… Now that Steve’s announced the Intel Mac Minis, it’s going to be a hard sell. If you were holding out on switching, the new Mac Mini’s look a lot more attractive than they were before. From the Engadget live-blog of the event:
10:09am PT - Introduced the iMac, doing really well out there, MacBook Pro reviews are off the charts, two of the things helping this transition are universal applications. Rosetta turned out to be much stronger than we thought it would be, running most PowerPC apps. Today we’re introducing our third machine, the mac mini based on Intel’s Core Solo processor.
10:11am PT - It’s two and a half to three times faster in the same box. Also, putting a core duo processor in the Mini, it’s 4.8x to 5.5x faster. We have a product that’s over five times faster in the same form factor. We’ve added gigabit ethernet and doubled the number of USB 2 ports to four. Analog and SPDIF input and output. And its really quiet, it’s a pretty great product.
Ooohh.. Audio-input – something that was missing on the previous generations of Mac Minis. But this is nowhere near the point of giving me Buyer’s Remorse (not like those poor folks who bought the iMac G5 a couple of months before they announced the iMac Core Duo).
Posted in OSX | Tags MacMini | no comments
Posted by Scott Hughes
Tue, 28 Feb 2006 17:18:00 GMT
OS X has an annoying (at least, to me) idea about how the Home/End keys should work. For a while, I tolerated it because it was my duty as a switcher. But, going back and forth between my work PC and my home Mac is painful (especially now that my home Mac is sitting next to my work PC). I finally stumbled upon this reference to help over write the default key bindings to come up with something that’s a little more natural for me. Here’s what I used for my new key bindings
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
/* Home Key */
"\UF729" = "moveToBeginningOfLine:";
"^\UF729" = "moveToBeginningOfDocument:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:";
/* End Key */
"\UF72B" = "moveToEndOfLine:";
"^\UF72B" = "moveToEndOfDocument:";
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:";
/* Left Arrow Key */
"^\UF702" = "moveWordBackward:";
"$^\UF702" = "moveWordBackwardAndModifySelection:";
/* Right Arrow Key */
"^\UF703" = "moveWordForward:";
"$^\UF703" = "moveWordForwardAndModifySelection:";
}
I played around with trying to get the Shift+Delete combo to do a forward-delete (like Windows Delete key, instead of like Backspace), but I couldn’t get that to work. My MacBook Pro keyboard only has the one Delete key, but if I use a Windows keyboard the Windows Delete key works as expected. I’d be interested if anyone else had a tip about a good way to get a convenient forward-delete on my MacBook keyboard.
Update 3/11/2006:
Apparently, on all Apple laptops, the mapping for a forward delete is fn + delete. However, it seems I can’t use fn + [cmd|opt|ctrl] + delete to do any fancier forward deleting (like “forward delete word), because once I press any of the modifier buttons it’s as if the fn button is ignored in the combo.
Posted in OSX | Tags MacBook, MacBook_Pro, MackBookPro, osx | no comments
Posted by Scott Hughes
Tue, 21 Feb 2006 15:51:00 GMT

Damn, they are shipping my MacBook Pro direct from Shanghai! If I’d known that at the time of shipping, I would’ve upgraded to something faster. Those 2-day air prices are a pretty good deal if we’re talking about international shipping.
Posted in OSX | Tags MacBookPro | 1 comment
Posted by Scott Hughes
Tue, 10 Jan 2006 17:48:00 GMT
… Your keynote brings the entire internet to a grinding halt. All the tech news sites are at full stop as Mac geeks sit constantly refreshing the page, to see which rumors are true. Full disclosure: I’ve been refreshing TUAW’s live chatcast, so I’m contributing to the problem. So far, looks like iPhoto has added Photocasting.. But only for .Mac users. Nothing else has caught my eye yet, but I’m hoping for affordable Intel-based laptops to be announced.
Posted in OSX | Tags Apple, MacOSX | no comments
Posted by Scott Hughes
Fri, 04 Nov 2005 14:28:00 GMT
I had my first frightening Mac crash last night. I was using CocoaMySQL to set up the latest Typo and Rails on a test server, when the app locked up by taking up 100% of the cpu. This is something CocoaMySQL does for me frequently, but I tolerate it because it is a nice interface and I can usually just restart it (and I haven’t found a better GUI alternative).
Read more...
Posted in OSX | Tags crash, mac, MacOSX, mini, osx | 6 comments
Posted by shughes
Fri, 05 Aug 2005 15:33:00 GMT
In my previous post (TiVo and Mac OSX: Remux Redux), I discussed a GUI and command-line option for re-muxing video from a TiVo on OSX. Well, the command-line option was based on a perl script called TivoTool. The developer of that perl script has gone on to create a very slick GUI around it.
I got an email from the developer a few weeks ago about the new GUI, and I’ve been meaning to write about it, but I had a few problems with earlier revisions. For example, I couldn’t get it to save my video on an external volume… The new file would simply disappear. That said, I’m very excited to see that the tool is being very actively developed, with a new release today that adds some slick features.
I have to say that with this tool, I no longer regret leaving behind the win32-only TyTool.
Technorati Tags: MacOSX, TiVo
Posted in OSX, TiVo | Tags MacOSX, TiVo | no comments
Posted by shughes
Fri, 05 Aug 2005 01:52:00 GMT
I had a few people post in the comments about getting a copy of the OneWireViewer update I did… A few email me privately. I’ve been emailing it out to people as it’s requested, but now that I have a good web hosting service, I may as well put it out on the intarweb proper-like.
For now, this is a binary-only distribution. I want to do some more testing with it and make a similar binary distribution for Linux before I make this official. Once I’m convinced that it’s as robust as the PC solution, we’ll move it over to the official Dallas Semiconductor ftp site. Although most of the source is available online (1-Wire API for Java and 1-Wire Public Domain Kit on maxim-ic.com, libusb on libusb.sourceforget.net, rxtx on rxtx.org), some of the glue I used to make this work isn’t. I’ll try to make that available soon to people who want to dig around in that part of it.
Don’t blame me if this application sets your pretty Macintosh computer on fire.
OWV-Beta-2.dmg (2.4mb)
If you have any success with this at all, please leave a comment and let me know.
Technorati Tags: 1-Wire, iButton, MacOSX
Posted in OSX, 1-Wire | Tags 1-Wire, MacOSX | 29 comments
Posted by shughes
Tue, 05 Jul 2005 03:10:00 GMT
Take a look at this screen capture to see how I spent my 4th of July vacation weekend.
I ended up taking the libusb build of the 1-Wire Public Domain Kit and creating a JNI-wrapper around it. Now I’ve got a nice USB Adapter driver for the Java API (and hence for OneWireViewer). I’m going to look into modifying the WebStart download so that it will deliver the new USB adapter and the binary (JNI) portion of it. Possibly, I can sneak the libusb drivers along with that as well, without causing too much confusion. Maybe make 2 builds, one that includes libusb for people who aren’t cmd-line savvy enough to build their own and one that doesn’t.
The good news is that this should work on Linux, Mac OSX, and Windows. Windows users will have to install a .inf file first, but it will be a single-click application for Linux and Mac.
Update (7/10/2005): I used JarBundler to create a nice .App bundle of this for Mac OS X users. It’s pretty nice to have a installable .App of OneWireViewer that supports both the USB Adapter (DS9490) and the Serial Adapter (DS9097U) on Mac OS X. Unfortunately, I don’t have a good place to host it.. I’m not sure in it’s current form if it’s suitable for an official release to go up on the dalsemi ftp servers. So, if you’d like to try it, just leave a comment and include your email address (not in the comment, but in the regular email address field, where I will be able to see it but noone else will) and I can email you a copy of the app. It’s 2.3mb compressed.
Posted in 1-Wire, OSX, Code | Tags 1-Wire, iButton, MacOSX | 9 comments
Posted by shughes
Tue, 28 Jun 2005 03:00:00 GMT
A couple of weeks ago, I made a comment in Chris’ blog post about how he tried to ruin his laptop with a bottle of water. For your convenience, here’s my relevant addition to his story where I tried to ruin my delicate Apple hardware…
Last weekend, Nicole was using my brand new Mac Mini. Of course, that also means she was using my almost brand new Dell 2005fpw 20” lcd… Not to mention my mostly new wireless keyboard. And, she was drinking coffee while doing this. So, I’m playing fetch with the dog downstairs. The way our apt is laid out, we have a second floor with a sort of balcony over the living room which is where my mac mini lives. I decide to give the dog a good challenge by tossing his toy over the balcony edge to where Nicole is sitting. Nothing but net… The toy went straight into the coffeee, splashing coffee everywhere. Keyboard was the worst hit, but I did actually get a big splash on the Mac Mini. It looks like it’s going to survive, but I have a nice brown stain on the felt in the slot loader to remind me of what an idiot I am. I think I got the keyboard back to a good state, though if the N sticks on me again, I’ll have to buy a new one. Can’t tolerate sticky keys, you know…
Today, thanks to a remnant of that mess, I learned a couple of things about my Mac Mini…
- Dried coffee is like hardened cement when placed between my computer desk and the rubber bottom of the Mac Mini and will, in most circumstances, require an actual chisel to separate the two.
- That little power cord in the back slips out of the Mac Mini like a frightened, greased pig at the county fair.
- Mac OSX does not berate you for improper shutdown of your system, unlike Windows XP.
That third point is an interesting one to me. I’m very familiar with recovery on Windows, given that prior to WinXP crashes were quite frequent… I’m sure Mac OSX must have some sort of method for recovering orphaned files and, perhaps, booting into a safe mode if I installed something which hosed the boot process…
I need to add that to my “to research” list…
Technorati Tags: MacMini, MacOSX
Posted in Humor, Personal, OSX | Tags MacMini, MacOSX | no comments
Posted by shughes
Wed, 22 Jun 2005 20:03:20 GMT
I booted up my Windows XP machine to try out FlyakiteOSX. It’s a suite of tools to help skin your XP desktop to look a lot like OSX. If nothing else, you should check out the website. It’s a very slick Javascript implementation of an OSX desktop. It’s kind of a painful way to navigate a website, but it’s really amazing how well it’s put together. I hope the idea does not catch on though… I think one or two desktops is enough. I don’t need another one in my web browser.
In any case, the FlyakiteOSX suite works remarkably well. It doesn’t change many of the tiny user interface issues that I was hoping for (i.e. double-click on title bar still maximizes, unlike OSX which minimizes.) But it does add transparency to pop-up menus and a pretty drop shadow to every window. I have a reasonably speedy AMD box, so I didn’t notice if this was a severe drain on resources. It might stay on my home machine (which rarely gets any power-on time since I got the Mac Mini), but I probably won’t propagate it to my work PC.
Experimenting with that got me curious about getting widgets on my Windows XP machine, so I also tried out Konfabulator. This is actually a bit different from the Dashboard included with OSX Tiger. It allows widgets to run floating on your desktop, above your normal apps… Versus Dashboard which only runs on an invisible layer which must be summoned to the foreground. Konfabulator does have a layer which isolates just the widgets, so it ends up looking a lot like Dashboard. I haven’t experimented with many widgets, but the default ones are useful enough to convince me I’ll like it. This will be propagated to all of my machines. I may even use the OSX version of Konfabulator instead of Dashboard, just so I can be assured that any widget I grow to love will work everywhere I go.
Technorati Tags: Apple, MacOSX
Posted in Technology, OSX | no comments
Posted by shughes
Tue, 14 Jun 2005 06:34:00 GMT
I finally found a workable set of tools for extracting and re-encoding video from my TiVo using Mac OSX Tiger. For reference, I’m pulling video off of a Series 2 DirecTiVo (HDVR2). If you have a Series 1, you have many more options, including TyStudio, which I mentioned in my previous post. AFAIK, both of the excellent options I’m using now should work for all Series 1 and Series 2 streams.
I have found workable solutions for both GUI and Command-line interfaces. Both tools have their advantages, but the tools I’ll be using the most are the command-line tools. Here’s the procedure I use for each tool.
Technorati Tags: Apple, MacOSX, TiVo
Command-Line Option
The set of tools I’m using now are a combination of vsplit, vstream, and mencoder (from MPlayer). My previous post mentioned that mencoder doesn’t seem to handle the audio-sync very well when re-muxing a .ty file. However, I’ve found that that if I re-mux the .ty file with vsplit into an ordinary MPEGII, mencoder does a much better job when converting that MPEGII into a DivX movie.
Install and start vserver on your TiVo. Obviously you must have your TiVo hacked to do this… And I’m not covering that here. Then, use vstream to fetch a list of all shows on the tivo, so we can get the “fsid” of the show we want:
vstream tivo://myTiVoIP_or_Hostname/llist
Use vstream to fetch the show using the “fsid”:
vstream tivo://myTiVoIP_or_Hostname/myFSID -o 'temp.ty' 2>&1
Use vsplit to re-mux the show into a standard MPEGII stream (keeping that ‘unused’ string on the end, since the cmd-line arg processor seems to require the extra argument):
vsplit -m 'temp.ty' 'ShowName' 'unused'
Now you have a good clean MPEGII file, ready for transcoding. You can play around with mencoder to see what works best for you. For good quality, I recommend doing a multi-pass transcode. See the mplayer/mencoder documentation for more info on that, but here is an example of a 1-pass audio, 2-pass video transcode to DivX:
mencoder ShowName.mpg -ovc frameno -oac mp3lame
-lameopts br=128:vbr=4:q=0 -o frameno.avi
mencoder ShowName.mpg -vop pp=lb -ovc lavc
-lavcopts vcodec=mpeg4:vhq:vpass=1 -oac copy -sws 2 -o output.avi
mencoder ShowName.mpg -vop pp=lb -ovc lavc
-lavcopts vcodec=mpeg4:vhq:vpass=2 -oac copy -sws 2 -o output.avi
mv output.avi ShowName.divx
Most of those tools can be found on the DealDatabase forum. I recommend the
tivotool.pl package which contains vserver (for both Series 1 and Series 2 TiVo), vsplit (for Mac OSX and Linux), and vstreamer (for Mac OSX and Linux). Also included is a nice perl script which automates the process of getting the MPEGII file as I described above. The easiest place to grab “mencoder” is from the
command-line binaries package for OSX.
GUI Option
The VideoLan Client for Mac OSX (VLC) is an excellent movie player application which duplicates most (if not all) of the functionality of mplayer/mencoder. Though I have had trouble using it’s command-line interface, it’s GUI is useful enough for transcoding TiVo files after you’ve modded it with 2 simple plugins.
Start by installing vserver on your TiVo, just as above. If necessary, grab vserver from the same tivotool.pl package. Now, download the 2 plugins from the TiVo-VLC project page. The two files you’re looking for are vlc-ty-mac-r42.tar.bz2 and vlc-vstream-mac-r37.tar.bz2. Note that both of these plugins were built for version 0.8.1 of VLC and won’t work with any other version. Pay attention to the TiVo-VLC status page to see if these binaries were updated for a new version of VLC.
After extracting the two files (with extension .dylib), you’ll need to install these into the VLC.App. Find VLC in your applications folder, right-click (or option-click, whatever you one-butan people call it), and select ‘Show Package Contents’. Copy the two files into “Contents/MacOS/modules” and you are finished with the setup procedure.
Now, fire up VNC and select “Open Network..” and enter “tivo/ty://myTivoIP/plist”. Now open your playlist and select a file for streaming. Pretty easy, huh? You can transcode a file from your playlist by getting the properties of a file and copying the url (including the fsid). Now, use the “Open Network..” menu option to open that file, except use the “Advanced Output” checkbox on the bottom of that dialog. Under settings (right next to that check box), notice the transcode options for Video and Audio. I suggest “mp4v” for video, with a 512kbps bit rate, and “mp3a” for audio with a 192kbps rate.
Read more...
Posted in TiVo, OSX | 2 comments
Posted by shughes
Tue, 07 Jun 2005 03:13:45 GMT
Of course, right when I decide to switch, Apple announces that they are going to be moving to Intel chips next year! That could mean that I would’ve been able to get Mac OSX running on hardware that I already own. The likeliest outcome is that Apple will require high-end hardware and, possibly, only support a proprietary hardware set (thereby blocking out self-built or other 3rd party PC’s).
I think it’s pretty cool though that Apple has had a team for the past 5 years dedicated to making sure that each build of OSX runs on Intel’s chips… Just in case… I wonder if MS has a team trying to get WinXP running on Power PC?
In any event, I don’t think it’s a coincidence that Intel recently announced their hardware DRM solution in their upcoming Pentium D. Also, iTunes recently added Video support… You can download a music video along with a song purchase now. Perhaps the next step for iTunes is purchasing movies for download at home. Before they could pull that off, they’d have to convince the big studio execs that their films will be safe from pirates. Intel’s Pentium D sounds like a good package deal for them. Not only do they get their performance/watts number down a bit from the Power PC offerings, but they get an extra layer of security for a next-gen iTunes offering.
Technorati Tags: Apple, MacOSX
Posted in OSX | no comments
Posted by shughes
Mon, 06 Jun 2005 15:56:00 GMT
I’ve finally hit a pretty big roadblock in my switch over to the Mac. I am having trouble getting a good set of tools to help me offload video from my TiVo. I’ve been back and forth on this since I bought the TiVo, where I’d go from constantly downloading video for archiving to not really thinking about it at all. Since I picked up the PSP, one of my goals has been to get a nice workflow going to grab episodes of shows that Nicole won’t watch with me (X-Play, Smallville, and Deep Space 9) and take them along with me. Unfortunately, Dell has been delaying my order for a 1GB memory stick pro duo, so using the PSP as my mobile video player is still bottlenecked by the storage problem. I’d like to cancel my order from Dell and just grab it from Amazon (1 GB Memory Stick Pro Duo) for a few dollars more, but why bother if I can’t get the tools in place to make it convenient on the Mac? This makes me a very sad man…
Here’s what I’ve tried so far…
TiVo-mplayer Had pretty good success with this on the PC, though I had a lot of audio-sync problems. Given that it’s at 1 version number greater than what I last tried on the PC, they may have fixed it (though I’m not too hopeful). In any case, I always had to correct an error in one of the .c files (variable declared in the middle of a function, rather than at the top of a scope) just to get it to compile on Windows. On the Mac, I gave up after correctly nearly a dozen compile errors. If anyone would like to provide a binary of this for Mac OSX 10.4.1, I’d sure like to give it a shot.
MPlayer / MPlayerOSX / ffmpegX Unfortunately, none of these incorporated the above changes to support TiVo’s .ty files. So, they are mostly useless for my purposes. However, if I could get my hands on a TiVo-mplayer binary, ffmpegX would still function as a front-end for that command-line tool. (Update 6/9/2005) I discovered that the mencoder portion of the ffmegX binaries does include the demux code for ty files. I also discovered that, just like the last time I used mencoder on the PC to transcode, I still get major audio sync problems. I assume if I just demux the video and use another tool to remux it (with some manual adjustments to audio sync) it will work fine… But that’s too much work. I’m spoiled by the easy TyTool for Windows. Unfortunately for me, he won’t share the source for it so we can try to port it to OSX.
TyStudio These guys have built, what looks like, a fantastic tool. Unfortunately, it has never worked for me. They have an OSX version (requires X11 be installed) and it seems to function nicely once you get ”dlcompat” installed. I couldn’t get Fink or DarwinPorts to install dlcompat for me, so I ended up just checking it out of CVS and building from source. Seems the easiest way to get the libs in the right folder so that TyStudio can see them anyways. Once I got this tool running, I selected a local “.ty” file I had sitting around. Amazingly, this tool performs on Mac OSX exactly as it performed on the PC… That is to say, it got exactly halfway through indexing the .ty file before crashing heinously. I believe it might be because my .ty files came from a series 2 TiVo, because their website only has info about a series 1 server component.
From here, I’m kind of at a loss. I guess my options are: 1) forget about getting video on the PSP memory stick and just buy UMD movies to keep myself entertained, 2) use the PC for video extraction/editing since I already have a good toolset to use, 3) “get cracking” on porting the other PC tools over to the Mac.
Aside: Whenever I have to code up my own solution instead of waiting on someone else to provide me with one, I love using the phrase “get cracking.” It comes from an email conversation a buddy of mine had at Ga Tech. He was using a system tray CD-player app, but he felt it was missing a feature or two. He emailed the author of the app to let him know what was missing, and the author gave him the succint reply: “Get cracking!” :)
Technorati Tags: Apple, MacOSX, TiVo
Posted in TiVo, OSX, Code | no comments
Posted by shughes
Sun, 29 May 2005 23:51:58 GMT
For my own benefit (and maybe yours), I’d like to try an collect all the info available for getting 1-Wire apps running on Mac OSX Tiger (10.4). Eventually, I’d like to see a Cocoa application that functions much like OneWireViewer. That’ll be my next fun project, after I complete my “Learning Cocoa and Objective-C” project.
Technorati Tags: 1-Wire, Apple, iButton, MacOSX
Public Domain Kit Applications
The public domain kit includes 2 relevant builds: ulinuxgnu and libusblinux. Though both of these builds have “linux” in the title, ulinuxgnu should really be called uPosixSerial. Libusblinux should just be called the libusb build, as it will work on any libusb platform. I tested with version 3.00 of the Public Domain Kit and got both builds to work perfectly on a near clean installation of Mac OSX 10.4. Both of these builds required the optional XCode install that came with Mac OSX, so that your system will have the GNU C Compiler (gcc) available.
For serial port access, I used a Keyspan serial-to-USB adapter, part number USA-19HS. The drivers included with the adapter worked fine, though you might check Keyspan’s website for the latest drivers. After installing the drivers, I plugged in the serial adapter and used Keyspan’s installed Serial Assistant application to find out the device name of the adapter. In my case, it was USA19H5b14P1. The next step is to connect a DS9097U serial adapter to the Kespan serial-to-USB adapter. Now you can optionally attach a probe or Blue-Dot receptor to the DS9097U and attach any 1-Wire or iButton devices you may have. Otherwise, the only 1-Wire device we are going to see is the 64-bit ID chip embedded in the DS9097U.
For USB access, I used the DS9490R USB adapter and a Blue-Dot receptor. To allow the Public Domain Kit to have access to a USB device, we need a user-land (as opposed to kernel-land) USB driver. That is what libusb provides for us. The easiest way to get libusb is to first install Fink. Fink is a smart package management app that makes it easy to install open-source software on Mac OSX. Soon, a binary installation of Fink will be available for OSX 10.4 users. For now though, follow the “bootstrap” instructions on Fink’s homepage. After fink is installed, type: “fink install libusb” in the terminal. You now have the libUSB drivers installed.
The Public Domain Kit serial and USB builds worked almost “out-of-the-box”. In version 3.00, the ownet.h file optionally defines some types based on platform. Mac OSX isn’t one of the platforms that ownet.h knows how to handle. The next release of the Public Domain Kit will fix this, but for now, I modified the block around “#define OW_UCHAR” to look like the following:
#ifndef OW_UCHAR
#define OW_UCHAR
typedef unsigned char uchar;
typedef unsigned long ulong;
#include <sys/types.h>
#endif
Now, running “make linux” will build all of the Public Domain Kit serial apps. We have to make one more adjustment for the USB build to work. Essentially, Fink “sandboxes” all of the apps and libs that it installs, to keep it from conflicting with other apps that the user may have installed without Fink’s help. So, you’ll need to point the makefile to Fink’s copy of the libusb library files. At the top of the makefile, you’ll find a definition for compiler flags and linker flags, labeled CFLAGS and LFLAGS respectively. Modify them to look like the following:
CFLAGS = -DDEBUG -c -I/sw/include
LFLAGS = -DDEBUG -g -o $@ -L/sw/lib
You are now ready to run “make linux” to build both the serial build and the USB build. In the directory where you built the serial build, type “./tstfind /dev/tty.USA19H5b14P1.1” with you’re serial adapter device name (not mine, USA19H5b14P1). This should give you a scrolling list of all the 1-Wire devices connected to your adapter. To run the same app in the USB build, in the directory where you build the usb build, type “./tstfind DS2490-1” where the number after the dash simply selects which DS9490R or DS9490B adapter you wish to select if you have more than one. To exit both of these applications, type “Ctrl-C”.
1-Wire API for Java Applications
The 1-Wire API for Java is currently waiting for a good RXTX build, version 2.1.7pre19 or later. After installing the RXTX_Jag.pkg included in the current snapshot, I had to edit /etc/groups file to manually add my username to the “uucp” group. I believe the install script should have handled this, but it appears that it didn’t. This got me past a “PortInUseExcpetion”, but now I’m stuck with a “Bus Error”. I believe this is due to a memory management issue in the native layer that is fixed in 2.1-7pre19.
Web-based 1-Wire Applications
A part of the owfs project, owhttpd is a webserver application which allows one to interact with 1-Wire devices. Unfortunately, the owfs app does not itself work on Mac OSX because of the lack of FUSE support. However, owhttpd should work. To set up owhttpd, I first downloaded the “Source only” package for owfs 2.1.0. Then ran, “./configure” and “make”. Configure failed for me when it starting configuring the swig module. I tried to ignore this and cd’ed into the module/owhttpd folder and ran “make” from there. No dice. Looks like the configure script is broken. Hopefully it gets fixed soon as owhttpd looks like a handy application.
Posted in Code, OSX, 1-Wire | 1 comment