Pages

Thursday, October 11, 2012

It's thinking....

Ok, I know I've been away for a few weeks, as luck would have it I got some time in the woodshop and put together the first "BrainBox" for my SishFishPi platform.

First, more on the SishFishPi for those just joining us. It's a basic chess computer built using the Raspberry Pi Linux development board, the amazing Stockfish engine, and commodity LCD/electronics. The SFP integrates with a new software build for the "Sish" chess board.

The end result, a small form factor butt kicking chess machine.


Now I'll put together a more detailed post on how it was built and finished, however just a few details to get you started:

The BrainBox itself is made of red oak finished with roughly a dozen coats of "black shellac" which I purchased from shellac.net. The sides each have a "brain" design cut into them with a scroll saw, behind that design I placed cut pieces of translucent plastic to difuse the light. After that I built a small "light board" inside the case that uses the Pi's GPIO PWM pin to slowly pulse light over a sine wave like design. Here's a picture of the inside..


Lastly an LCD has been added (simple Sparkfun or Adafruit HD44780) which outputs the brainbox's moves.

Here's a video to give you an impression of just how cool this ended up.



The end result turned out very cool, and now that the SFP/BrainBox has got a home I'm sure I'll have more time to finish up the code and get something posted up here.

In the meantime enjoy the video!

-hz

Thursday, September 27, 2012

SishFishPiv2

SishFishPiv2

 

This video shows the bulk of it. The SishFishPi is getting much closer, dare I say it's a "2.0" at this point.

It's now capable of playing a game, with fully functional basic clocks, against stockfish, and updates an embedded web server with the game content in realtime!

There's still more to do, I need to get the web server fleshed out so you can use it to set the game parameters, things like:

- Player vs Computer or Player vs Player

- Downloading your pgn files of past games

- Setting clock times, labels for players, etc.

I also need to get the entire code base packaged up in a nice installation package such that it can be installed on any RaspberryPi System.

Lastly I need to get a the new "sishfish" chessboard hex files uploaded and available for the Minimus, Teensy, and Teensy++.

Exciting times ahead.

hz

Wednesday, September 19, 2012

SishFishPi - Getting closer

Thought it was high time to update you on the current status of the SishFishPi project.

For those just joining us, the SishFishPi project involved integrating a version of our hardware usb chessboards specially modified for talking to the Raspberry Pi (Virtual Serial Port). This new setup would allow the Pi to communicate moves from Stockfish to a simple commodity class LCD connected to the Pi's GPIO pins (general purpose i/o).

First order of business was to get the Raspberry Pi into a better case. While I work on building a case out of wood I ordered a very nice acrylic case from built-to-spec.com. Those guys do great work and if you have a Pi it's worth spending the 12$US to get a case from them.

Next I needed to get an LCD working. I purchased a number of LCDs from Sparkfun.com and from Adafruit.com. However in the end I decided to stick with the Adafruit.com LCD. It came with everything necessary to get started and was reasonably priced.

**WARNING**

The Adafruit website contains a great tutorial all about connecting the LCD to the Pi and driving it with python. While the hardware portion is great, I found the software lacking. It appears to have some consistency issues with my LCD (random crashes, garbage, etc). In the end I located the following C/C++ library and built a simple command line tool to update the screen from it.

http://www.ctheroux.com/raspberry-pi/

After I got the LCD functioning it was time to integrate it with a simple Chess engine. For this purpose I chose Stockfish. First and foremost it's open source and easy to get built for the Pi, and secondly because of it's exceptional reputation in the commnunity. Let's be honest, my chess skills are completely dwarfed by my technology skills. Stockfish will have my number for many years to come.

With all this complete, I took a few pictures to better demonstrate where we are today.

 
Using the Built-To-Spec case and wiring up an Adafruit LCD.

 
Jumper wires make life easier.

Playing with Stockfish using one of my custom made chess sets, yes I turn my own pieces.

Here's a blow up of the LCD, nice and easy to read Stockfish's move.
 
 
Lastly I started working with pgn4web. It's an amazing Javascript based web engine for broadcasting pgn games in realtime. After a few modifications to my software I was able to get it outputting moves into a live pgn file on the Pi. Then it was a simple matter of opening up my web browser and I could watch my game in real-time! Very fun stuff.
 

pgn4web showing my game in realtime!
 
Hopefully this is enough to give you an idea where I'm headed. Up next I need to get a simple web/cgi setup to handle further controlling the chess game software (restarting a game, changing settings, etc).
 
I also plan on trying my hand at a wooden case for the Pi, more on that later!
-hz

Friday, September 14, 2012

New hardware from a friend in need

Exciting news today for those of you interested in using something other than the Teensy for your Sish board, we've now got another option, the Minimus AVR board.

How did this come about? It's an interesting story. Seems one of my readers from the UK was very interested in trying out a Sish board of his own, however it was very difficult to get a Teensy in the UK for a reasonable price (having ordered Raspberry Pi's from the UK I understand the frustration).

Simply put he asked if the Minimus AVR board would be a suitable replacement. Seeing as it was another ATMEL chip I figured it would work fine, but would have to make a few adjustments to get a good build working.

Unbelievably he offered to send me two test boards (one backup just in case of emergency) in exchange for building a functional hex file for the Minimus. He packed up the devices and shipped them to me Royal Air Mail and we waited...a very long time! Almost a month later the postman dropped off two shiny Minimus AVR units and it was time for me to hold up my end of the bargin.

So I set to work this evening getting the code adjusted and tested. In the end it took a few tweaks and updates, but here's a link to the Wiring Diagram for a minimus Sish board, as well as the hex file for the minimus-sish (see the side panel).

Thanks again for sharing those boards with me, I really appreciate it.

Lastly, before I forget, the ATMEL/Minimus needs a FLIP program to install the hex file.

http://www.atmel.com/tools/FLIP.aspx -> Download the first FLIP program from the list of options, you will need the Java Runtime if you don't already have it installed.

Follow the instructions in this PDF to install a hex file and put the Minimus in "programming" mode.

http://www.minimususb.com/minimus_v14.pdf

Lastly, your computer (if it's Windows 7) most likely won't have the drivers for the device, so you'll want to install these drivers following the instructions in the prior pdf.

http://www.minimususb.com/files/minimus_x64_drivers.rar

If you have a different board you'd like to see about getting a Sish built for let me know, perhaps we can work the same deal again!

-hz

Friday, September 7, 2012

Success!

I now have a functional SishFishPi!

It's still pretty simple today, however it can talk to the sish board (using a new hex file) and send the Stockfish moves to the LCD.

It's not the most visually appealing setup at this point, but now that I've got it working the breadboard will come out and I'll start working on wiring up this LCD cleaner. For now I can't begin to tell you how fun this was to play with this evening.

Still exploring options for displaying the game on an embedded web server on the Pi, and looking at how I can possibly modify the software further to show the clock, handle promotions, and start a new game cleanly.

As always lots to do, but it's high time I posted some pictures.

 
The above photo shows the breadboard and Raspberry Pi setup. The Pi is in a sweet case from Built to Spec. It rocks. 

 
There's stockfish's move from the Pi, it's on the LCD screen, I'm sorry but that's just so cool.

 
This should give you an idea of the commandline output on the sishfishpi, think of this as the debug information, when I'm done you won't have to connect to this interface unless you want to.
 
 
Lots to think about still, in order of preference here's what I'm working on right now.
 
1. Signaling start of a new game, I'm trying to avoid wiring another button up to the Teensy, but I at this point I haven't come up with a better plan than that.
 
2. Coding in promotions, I'm thinking you'll have to promote by moving the pawn to the 8th rank, then the SishFishPi will prompt you with "Promotion to?", then you'll press the square of what you are promoting to (d1,c1,b1,a1 -> Queen,Bishop,Knight,Rook) opposite if you are black of course.
 
3. Game Saving. The SishFishPi needs to save your game in pgn format and make in available on an embedded web server.
 
4. Game Display (in realtime) The SishFishPi also needs to show the game in realtime as we progress through it via an embedded web server.
 
That's about all I've got at present. I'll explore Git and look at making a repository for this stuff in the near term, or at least posting an SD card image for the Pi and the hex file for the Sish board once I get further along.
 
Thanks!
 
hz

Monday, September 3, 2012

Back at it, working with Raspberry Pi and LCDs

Sorry it's taken so long to get back to this, however as you can expect building electronic chess boards is not my full time occupation! :)

I can tell you however that I've carved out a little time over the last few weeks and have a couple of additional builds in process, there's no new hex files to share yet, but let me tell you what's in the works.

Sishnovag


After working closely with Bryan @ USB Chessboards I started reviewing the Novag Citrine protocol, especially how it interacts with the Arena Windows Chess application. As such I now have a "sishnovag" build that speaks serial commands to Arena and receives move responses. The goal here is to next wire up an LCD to the Sish and get it to output the moves provided by Arena on that LCD. If this works we'd never have to look at the computer screen! So far I've got the hex file sending moves to Arena just fine, however I'll have to wait until later in the week when I get my LCDs from Sparkfun.com.

Sishfish


I've got a Raspberry Pi! Yes I was one of those crazies that ordered the extremely cheap development board earlier this year and now have it sitting on my desk. I was able to put together a new sish build that speaks raw HID to the Raspberry Pi. This build which I'm calling "sishfish" is being designed to talk to Stockfish on the Pi. Again it's my hope that I can readily wire an LCD to the Raspberry Pi and get move output from Stockfish straight to the LCD. In a perfect world I'd get a mini-webserver up on the Raspberry Pi that would show the game in realtime, but that's a project for another day.

Just wanted to share that with you all, also if you have built a sish board please tell me, I'd like to get a gallery going here for Sish boards and their makers. :)

Thanks all!

-hz

Monday, April 16, 2012

Next step, a brain?

Word on the street is the RaspberryPI ARM based development boards are shippping. Now I'll believe that when I see it, but if the news outlets are right I should be seeing mine in the next week or so.

What is the Raspberry PI? It's an ARM based single board computer capable to running an ARM compiled version of Debian Linux.

There's way more on the Raspberry PI on their website here.

My plan, should the one I order arrive in a reasonable period of time, is to build a simple interface between it and my DIY USB Chessboard. The end result being I would be able to play a game against different open source engines, without powering up my computer. In fact, since the RaspberryPI is so small I might be able to attach it directly to a future board.

We'll see how that goes, in the meantime enjoy the link and watch the videos, it's interesting stuff for sure.

-hz

Saturday, March 24, 2012

Sish Chess Video

Ok, I had a little too much fun with the camera last night, however I now give you the first Sish Chess video.


Enjoy!

-hz

Thursday, March 15, 2012

Generosity

The other day I received a FedEx package from a fellow USB Chessboard enthusiast. James "Jimmy" Patterson sent me one of his vinyl boards with wire leads ready to plug into my Teensy.


Wow Jimmy! Thanks for taking the time, effort, and expense to send this to me, it's very much appreciated. I'll get my hands on a new Teensy and wire it up in the near term.

Next, I'd like to get a listing of engines and interfaces people have used either the Sish or the Dream Cheeky with?

So far I've tried:

Fritz 12

Chessbase 11

Arena

Winboard

Chessmaster

Now while all of them have been interesting, I've found Chessmaster the most helpful as it has the gradually increasing opponent skill level options. Let's just say I'm much better at building Chessboards and Chess pieces than I am at actual Chess (But I'm learning!).

Any other good packages for building up your skills gradually?

Thanks!

-hz

Wednesday, March 14, 2012

Flip switch!

Tonight I added a new "flip" switch to my Sish board.

This switch is wired from GND and the "Flip" pin (see wiring diagrams).

The end result is I can switch to playing black by simply toggling the switch. Here's a picture of the wiring on the underside of my board.
and here's a close up of the toggle switch (it's attached with simple hot glue).
The end result is a board that allows me to play as black or as white readily with no manual flipping of the board.

Next up?

I've got a number of ideas, including potentially incorporating the DGT protocol, which would allow for usage of a Sish board natively with clocks and high end chess software.

Also looking at LCD screens..

-hz

Friday, March 9, 2012

My first Sish Board!

I couldn't resist.

After getting my new jumper wires I hooked up my first Sish board this evening.

I also used my chess pieces I cut last year.

Turned out pretty nice, I'll take some pictures of the wiring tomorrow and work on getting the Sish code files for Teensy and Teensy++ uploaded this weekend.



Going toe to "toe" against the computer is much more fun when there's a physical board.

More details tomorrow.

-hz

Thursday, March 8, 2012

Improved wiring, inspired by USB Chessboards

What can I say?

I hope Bryan Whitby @ USB Chessboards understands imitation is the sincerest form of flattery.

I spent last night wiring up a couple of nice termination strips and easier to bend stranded wire to my switch arrays.

The end result is below, much cleaner, much less likely to be stressed.

Thanks for the idea Bryan!

-hz

Wednesday, March 7, 2012

More Sish boards being built

Looks like I'm already the last one out of the gate.

Bryan Whitby, the accomplished computer chess board hobbyist from the UK sent me photos of his portable Sish unit.



Bryan's wiring always evokes great "wiring envy" from me. Look at how clean that looks!

Bryan has elected to wire his board and connect it to this side portable unit using two Ethernet jacks. Ethernet provides a convenience connection mechanism for chess board interfaces as each jack interfaces 8 wires.

Great work Bryan!

Hopefully I won't stay behind the 8-ball much longer as FedEx promises my hook-up wires should arrive on Friday. I expect I'll setup a nice terminal row like Bryan has done. In fact after looking at his design I'm thinking I have a little bit of work ahead of me tonight.

More pics as I progress.

-hz

Sunday, March 4, 2012

Sish boards being built

Wow, build it and they will come.

I've got a You Tube video below from Jimmy Patterson. Jimmy and I worked together to build the first Dream Cheeky based USB interface board a year or so ago. Well Jimmy was very excited to build his first "Sish" board and put together a quick video of the board which I've posted below.




In addition, I have a couple of pictures of my board in progress. For the initial stock board I chose a 1.75 inch square board from House of Staunton. Why 1.75? well late last year I started making Chess pieces in my wood shop, in fact my first post on this site has a shot of them. Anyway, those pieces are designed for 1.75 inch square boards..who wouldn't want to play with their own custom made pieces?

Gallery of Hazmat's pieces at Chess.com

Ok, so here's a few of the build process, I started with a fresh House of Staunton board.






Then I used a ruler and piece of chalk to make the holes.



Afterwhich I used my dremel hand attachment to get the pilot holes started. If you don't have a Dremel you are missing out, I have one with lots of attachments and a drill press mount. Sure, I have a full set of woodworking tools but..the dremel is just damn handy.



Now the board is drilled and ready for tactile switches.



And here are the switches. I glued them down with a hot glue gun. On some this worked great, a handful required extra persuasion. The jury is still out on whether this will hold for the duration however.



Lastly I started wiring things up. I used simple 26 AWG uninsulated wire to connect all the switches, it was easy to work with, this is such low voltage it doesn't matter.



Now that's where I'm at now. I am sourcing some simple jumper wires to make connecting the rows of swiches to the Sish/Teensy easier, I've also built a small poplar "shelf" that will sit drilled into the bottom of this board and hold the Sish/Teeny. I want it to be tighly held, but also easily removable should I decide I want to remove it later. (For a future 2.0 board :) )

More pics next week when the rest of the parts arrive.

-hz

Teensy and Teensy++ (Sish and Sish++) Pin Assignments

Started work on my board this weekend, hmm, what I know in software is counterbalanced by my lack of soldering skills. :)

Ahh well, I have a few adjustments to make today, a couple of trips to the store planned, and a decent chance at a completed board by the end of the day. On the whole it looks beautiful, but it is a House of Staunton board, so I'd have to really screw it up to make it look bad.

In the meantime, here's the pin assignments for the Sish and Sish++, depends on if you but a Teensy or Teensy++.

Sish++


Sish


Let me know if you have any questions. I'll be posting a few more pictures of my board build later today/this week. Then once I'm happy with everything I'll post the .hex files to make your own board.

-hz

Friday, March 2, 2012

Basic Wiring Diagram for the Sish

Here's the basic wiring diagram for the Sish Chessboard. Bryan Whitby @ USB Chessboard was kind enough to put this together and allow me to post it here.

As you can see it's pretty straight forward, using simple tactile switches (Normally Open) you wire each row and column (rank and file) in sequence. These sequences will in turn be attached to the Teensy on specific pins to form the Sish.



Pin diagram for the Teensy and Teensy++ to follow.

Enjoy!

-hz

Quick update

I have the core programming for the first Sish and Sish++ (Teensy and Teensy++ based) modules ready to upload tonight.

The following capabilities exist in this version:

1. The Sish works as a USB Keyboard, it sends keystrokes for the corresponding moves into the computer "a1e2", etc.

2. The Sish has the following toggle switch options:

a. Toggle Enter -> Sends the [Enter] command to the computer after every move pair, "e2e4", etc.

b. Toggle Flip -> "Flips" the board, ie what was "a1" is now "h8".

3. The Sish also has a "backspace" switch for erasing moves as entered. Use this to avoid needing a keyboard if you make a mistake during a move.

I'll upload the wiring diagrams and in process pics as I convert a House of Staunton board into the first Sish Chessboard this weekend.

-hz

Sunday, February 26, 2012

Where it all started....

Years ago I started blogging as "WhiteCollar BJJ". It was a fun blog dedicated to my experiences as a whitecollar professional, with a wife and child, trying to learn the ins and outs of Brazilian JiuJitsu without getting myself killed.

This blog continued for a few years until a very challenging inguinal hernia injury sidelined me. The recovery turned out to be slow going and complications abounded. In the end my days as "WhiteCollar BJJ" were cut short and I had to put that part of my life behind me.

Competitive sports such as BJJ quickly become almost all consuming, and of course the vacuum left when I stopped competing was monstrous. I tried a number of different activities, and while I still exercise with roughly the same intensity, I struggled to find a competitive activity that matched the intensive thought and tactics of BJJ. Well, at least until I "re"- discovered Chess.


I know to an outsider going from BJJ, a violent ground fighting sport, to Chess, a "sport" played over a 64 square checkered board seems very odd, however trust me, it was amazingly easy to transition. Chess and BJJ have very similar Tactics and Strategy, move and counter move, layers upon layers of positional thinking.

So as I began to learn Chess I quickly discovered (much like my early BJJ days) I was in way out of my depth. Computers and people could mop the floor with me in minutes, I didn't know even the basic mating patterns, openings, endgames, etc. However, just like BJJ I wasted no time building a plan for improvement. The first of which centered on incremental challenges against a consistent yet better opponent.

For example, in BJJ I would often spar with an opponent better than myself, but not so much better as to give me no hope of success. In Chess I was looking to do the same thing, much easier said than done initially. While there are a number of online Chess sites that can pair you up with opponents, I wanted to play over a board, with real pieces, and a clock. This just didn't seem to work living where I do, after weeks of looking for other Chess players I decided to build my own!

I discovered an inexpensive usb chessboard from a company called "Dream Cheeky" out of Hong Kong. The board could be connected to the computer and would work with the Dream Cheeky Chess software allowing you to play a game against the computer using real pieces and a real board. The problems were many (as you can imagine with a $10 board).

The pieces were too small, the board was inconsistent in operation, the software was poor, games could not be saved, etc. So it was time to build an interface to the Dream Cheeky, one that would allow me to interface the board with the more capable products available today, things like Fritz, Chessbase, Arena, Winboard, etc.

So I developed the "USB Chessboard Interface" application and made it available via Chess.com. This lead to a remarkable set of friendships with fellow electronic chessboard enthusiasts around the world and spawned a number of very interesting websites (check out the USB Chessboard here.).

However, we've reached the end of our options with the Dream Cheeky boards. The first problem is supply, Dream Cheeky is no longer producing them, and it appears you can no longer find them on ebay or in overstock sites.

So, we had to start over with something new, for this I chose the "Teensy" a remarkable little USB based DIY hardware board with basic "C" programming options.

Here we are today. I have a Teensy in hand and have worked out the initial wiring and code. I plan on naming this project "SishChess". Why Sish? Well it sounds fun and simple, almost Dr. Suess like, and in a house with a young child I think not a day goes by without reading a dozen or so books that make your mind rhyme.

Check back here soon for more details, including code, wiring diagrams, and updates.

Enjoy!

-hz