Archive for the Uncategorized Category

My first Chumby app

Posted in Uncategorized on September 13, 2011 by Mike Szczys

I managed to get my hands on an Insignia Infocast 8 used at a bargain price on eBay. It’s an 8″ touchscreen device that is a clone of the Chumby. They’re designed to be hackable, so you can SSH into it as a feature. The apps are written in Flash, and I managed to get my first one running yesterday. Of course I’m using Linux tools only, but found that Haxe and Geany do a great job. I’ll roll the code and the steps I took into the post after the jump.

Continue reading

What I’ve learned about using the Beautiful Soup Python module

Posted in Uncategorized on December 17, 2010 by Mike Szczys
I like to use Beautiful Soup in combination with urllib2 to parse HTML from Python scripts. The problem is that I spend like 30 minutes relearning how to use it every time I do a new project. So, for my own use (and maybe yours) here's my quick tips for syntax.

I always start off the same way, two lines of code to snag and objectify the HTML:

html = urllib2.urlopen("http://hackaday.com/comments/feed").read()
soup = BeautifulSoup(html)

From there it's a matter of working with the 'soup' data object. This one gets an RSS feed of comments. They have are partitioned into <item> tags which you can traverse like this:

soup('item')[0]

Which is an array with an index (this is item 0). But you can also iterate through the list using:

for item in soup('item'):

From there just walk through the tree hierarchy. Here's how you can get the publish date (string surrounded by <pubdate> tags) for the item. Notice that you need to index the pubdate in order to access its string data:

soup('item')[0]('pubdate')[0].string

The part that always confuses me is the need for the index. It identifies which tag you're accessing in case there are multiples in this part of the tree. You can get the number of tags found by wrapping your tag term in the length funtion:

len(soup('item'))

Should always return 15 because that's the number of comments WordPress is set to publish in the RSS feed.

There are other ways to do this using soup.findAll, but I find this one usually works the best.

Sneak a peek at the LED Lighbulb schematics

Posted in Uncategorized on December 8, 2010 by Mike Szczys

Stream music from Linux to iPad – no app needed

Posted in Uncategorized on November 25, 2010 by Mike Szczys
I'm a Linux guy but I've also got this iPad. I don't run iTunes so there's no music on it. I have a collection on my home server that feeds the computers and XBMC boxes in the house. But what about the iPad? I had looked all over, and managed to patch together a working system using gnump3d but it was a pretty gruesome hack.

Well, I've got some functionality working now. I installed mod_musicindex for my Apache server. It's just an added layer on top of the indexing feature that Apache has. I like it, and it works somewhat acceptably. I can even password protect the directory, but I can't seem to get anything to stream outside of the LAN. I also have one album that I can't play but I have no idea why.

Is this crippled functionality really necessary? Why can't the iPod app have built-in web address browsing? Nice hardware, but I detest crippled software. Grr!

Light bulb microcontroller salvaged with HVSP

Posted in Uncategorized on November 15, 2010 by Mike Szczys
The ATtiny13 microcontroller from that LED light bulb is now waiting for new firmware. I used High Voltage Serial Programming to erase the chip, which clears the lock bits. I then reset the high fuse back to 0xFF. It was 0xFA before which disables the reset pin (and enables brownout detection) making In System Programming impossible.

I finished mapping out the PCB and it does use the example circuit from the buck converter's datasheet. Looks like it was outputting 12V and using a 7V zener diode to step down to the 5V source the tiny13 needed. I'm going to depopulate the PSU and patch in a 12V feed for further testing. I'm thinking my first project will be a red/green flasher for a Christmas porch light.

LED lightbulb schematic

Posted in Uncategorized on November 15, 2010 by Mike Szczys

I had a bit of time to test out the PCB from that LED light bulb. I've just been using continuity tester and ohm-meter for this. Here's the LED logic. High-side transistors but I haven't quite figured out how the resistors are wired. I've also established the A/C side of the switching regulator but I'm having trouble figuring out the output. Similar to the example in the datasheet but not quite the same.

WordPress on non-standard port (not Port 80)

Posted in Uncategorized with tags , on January 9, 2009 by Mike Szczys

I have a copy of wordpress running on my home server as well as on wordpress.com. At home my ISP blocks several common ports (Port 80, Port 21, etc). Because of this I have to use port forwarding with my router in order to serve webpages.

I use www.dyndns.com to give my dynamic IP address a more easy to remember name (ie: yourmadeupword.homelinux.org). This works well except that I have to add the non-standard port at the end: http://yourmadeupword.homelinux.org:3333

This is all fine and good except when it comes to wordpress. After installation I could not figure out why I wasn’t getting to my blog from outside the house. When I try I keep getting redirected to the url without the port number at the end.

Well, after much searching, I found you need to make sure you have wordpress set up for that specific port.

Log in as administrator, go to settings and click general. Change both urls listed there to include the port number you will be using.

Version Control using Subversion (SVN)

Posted in Uncategorized on November 21, 2008 by Mike Szczys

The code for my projects has been getting ever more complex. Add to that the fact that I’m now using multiple computers for development and I find I have a need for a version control system.

I have had experience checking out projects on both CVS and SVN control systems but have never made commits or maintained the system myself. Luckily there are some good guides out there and Ubuntu has everything I need in the repositories to get my chosen package system, Subversion, up and running.

Tutorials
I used parts from both of these tutorials:

Installation

I did not install or setup the web interface system. Right now I’m trying everything out using my local network so installing the subversion ubuntu package is all I really needed.

I followed the Community Documentation’s guidelines to create a directory at /home/svn and to add the group “subversion” making myself and www-data members of that group.

Commands
Create the project:

sudo svnadmin create /home/svn/myproject

Import the first version of the code you have written. This will import all files in the DIR_TO_IMPORT:

svn --username YOUR_USERNAME import DIR_TO_IMPORT file://YOUR_LAN_ADDRESS/home/svn/myproject -m "First file import"

Check Out the first revision of the code. You want to make sure to check out from SVN now instead of working from what you just imported. This will make committing your changes easy.

svn co file://YOUR_LAN_ADDRESS/home/svn/myproject

note: these command should be run from the working directory.
Commit changes you have made to the repository:

svn commit

Show the changes you have made since checking out the latest version:

svn diff

Update to the most current version from the repository:

svn update

Breakout Board for 3595 LCD

Posted in Uncategorized on November 20, 2008 by Mike Szczys

2008-11-20-lcd-breakout-boardI have manufactured a breakout board for the nokia 3595 lcd screen. As you can see this facilitates both interface with the screen itself as well as a backlight.

For the backlight I salvaged two LEDs from the phone board itself. I carefully measured and laid out the location for the copper to interface with the “spring” connection for the screen as well as the holes for the LEDs. The LEDs are SMD devices that are soldered to the bottom of the board and stick through a hole to the top of the board. I then cut the keypad area off of the plastic housing for the LCD and used that in conjunction with the metal frame from the phone to mount the unit to my home built PCB.

This is my first double-sided PCB. It doesn’t have the cleanest lines but it works and that’s good enough for me. I found it a bit more difficult to iron on the toner to both sides without smearing it (due to too much heat or from moving the paper while I worked).