-
Notifications
You must be signed in to change notification settings - Fork 3
Sanity Check, Early Design
So I have this development board, I have a potential Chess engine, now what?
Before I go any further, I need to check a few things:
- Can I even run an engine on the Raspberry PI
- What kind of hardware needs to be used with the PI
- Battery and power management options
- Programming work flow
- Size restrictions
- Performance
- Cost
- Suppliers
- Fabrication
- Staying within my comfort zone (Important, I'm not Wozniak)
- Reference designs
In short, Yes. The Raspberry PI runs a custom Debian distribution for ARM, apt-get is your friend. After Booting the PI for the first time I installed GNU-Chess, this ran fine. In fact I almost based the project on GNU-Chess, more on that later. Good, were building momentum "apt-get install stockfish", this worked too! Now were talking! Next, "apt-get install polyglot" YES! This worked! So after "playing" around with software on the PI, I felt confident I made the right decision about the hardware. The Raspberry PI zero can run a chess engine.
More research! apparently there are some things to consider when designing a portable PI. Do I lug around a USB battery brick? How do I prevent the PI from shiting the bed on sudden power loss? Do I need to include a power button? Should I use a LIPO or AA's? should there be an integrated charger?
After much deliberation, this is what I concluded. The PI is going to be LIPO powered. I'm integrating a charger and boost circuit for completeness. No fumbling around with battery packs and chargers, everything is going to be self contained. Power loss will not be an issue if the file system is read only. This means I can cut power when ever I want with no repercussions. No graceful shutdown, this means I don't have to include a voltage monitor. I need to find a "boost converter" IC with an enable pin. I need to find a LIPO charger IC, preferably one with a low battery indicator. I also need to find a LIPO battery with a small size but high capacity. BAM! My first design criteria.
How do I program the PI? Answer, on the PI itself. For this I ran into two problems:
1.) How do I physically connect to the PI?
2.) Is it easy?
WiFi! Yeah, that's right. The PI Zero W has built in Wifi and Bluetooth, no need for extras. This means two things, I can run the PI headless, and I can program it easily, more on that in a second. The Second less appealing option would be to set the PI up like a computer, complete with keyboard and monitor. There's also a third option, program it over serial. I'm sure there are at least two more ways, but I'm getting tired of typing. I went with WiFi.
While testing the PI I learned two things, I love the command line, and I need to find a better IDE. The following is a run through of how I programmed the PI:
- Wrote all the source code in Windows, with notepad++.
- Transferred the source code to the PI over WiFi with WINSCP.
- Compiled the code on the PI from the console.
- Ran the code on the PI from the console.
- Repeated the above until I had working software. Yay! Infinite loops.
This may not be the best way to develop software for the PI, but I had no problems with it. No, I was not able to step through my code. No, I had to rely on GCC to tell me if something was wrong. Yes, it sucked.
At this point, I didn't really have any. As small as possible? I knew before I even started that I wanted to use 14-segment displays. I'll grapple with this later.
The PI Zero W has a limited clock speed and available ram, I can't change this. What I can do is use them well. The operating system that ran the lightest was Raspbian Stretch Lite, its a minimal operating system for the PI. That's really all the thought I gave to the subject of performance, well sort of.
I had an "unlimited" budget for this build, but I tried really hard to keep costs down.
I like Digikey, I get everything from Digikey. There are other parts suppliers out there, but I like this one. The website is set up nice and they offer 3D models and datasheets. When I designed Chess Challenger 2018 I tried to source all the parts from Digikey. One supplier makes everything easy and shipping cheap. I ended up ordering some things from Adafruit, (PI without headers). It's worth noting that Digikey stocks many items from Adafruit, one supplier to rule them all!
I knew I wanted a board, I knew I needed a case, The hunt was on.... JLC ships direct from china, they are now my preferred board fabricators. Why? Because they are super cheap for small batch runs. oshpark also does a really great job but they are a tad bit more expensive. Now case fabrication, I like the services offered by Ponoko, they do good work at a fair price. The turn around time is quick too. They offer laser cutting for a wide range of materials and 3D printing. I based all later design decisions on the fabricators production abilities.
To keep the project on track I tried to stay within my "comfort zone". Why? Isn't learning fun? Yes, but not when you need to keep ordering new boards from china because you mucked something up. So in an effort to reduce cost, I played it safe. No ball grid arrays, no brand new IOT thing. I stuck with packages I knew I could successfully solder, development boards I knew I could successfully program. I picked materials I knew would hold up, suppliers that I knew could deliver. All of this made for a pretty painless build, and I'm quite pleased with the results.
-
Hey, the HT16K33 has a python library for the PI.
- Too bad you don't know python...
-
Hey! PyChess, This solves all my problems.
- Slash/Byte!, you don't know python!
-
They ported Stockfish to python.... WTF...
Slash/Byte turns around and looks at his dusty python book on the shelf behind him
-
Guess I'm making a library for the HT16K33.
Slash/Byte puts his book back
-
Maybe I should sell kits.
- Hey yeah! Maybe you should win the lottery and marry a model, because all of those things are easy too.