I love my little Pi Zero W’s, and I love Kali. So why not combine the two? So here’s a post about Installing Kali Linux on a Raspberry Pi Zero W. I’ve done this before, and it’s reasonably well documented elsewhere, but I hate googling for all the pieces each time I do this so I figured I’d make a blog post documenting it all for the future so I’ve got all the links in one place
FWIW, I do most of my daily driving on Windows because that’s what I use at work. Hence this will be written for a Windows PC. It’s also high level because honestly, this is easy and if you’re goal is to install Kali on an rpi0w, you probably don’t need much hand holding. 😉
Raspberry Pi Zero W
Micro SD Card (8GB or bigger)
Accessories for Raspberry Pi Zero (Micro USB to full size USB, Micro HDMI to HDMi, Micro USB power supply, etc.)
So I recently learned just how easy it is to do GPIO on the raspberry pi. So I tried it. I already had several zero W’s, but none with headers. So during my last trip to Micro Center I picked one up with the headers. I put Raspian on it and was ready to go. After some quick Googling I found an example. Got that running and can now interact with GPIO in Python… Total time spent about 15 minutes… Can’t beat that.
All that said, I see this as being useful for overlapping, but not identical purposes to Arduino. I think they will work together nicely for me in the future.
Finally got to the workshop! Built the base unit for the probe. Nothing sexy, but very much functional. It’s a 10 cm round piece of 3/4″ birch furniture grade plywood. (Scraps from a past project). Below it are two strips of 1/2″ basswood cut to 8 cm and screwed on with countersunk 1″ wood screws. Only took about 20 minutes start to finish.
The build went like this:
Measured the servo, and plotted out where it needed to go on the board.
Cut a circle using my table saw and a guide my circle jig.
Routed out the hole for the servo with a Dremel.
Cleaned up the hole with a tiny file.
Carved out a groove for the cables with a round chisel and hammer
Cut the two 8 cm basswood pieces
Pre-drilled two 1/16″ holes for the wood screws.
Counter sunk the holes deep enough so the screw heads are recessed.
Placed in the servo.
It’s snug enough that I don’t really need to use the screw mounts for what I’m doing.
Like I said, not sexy. But it’s very stable, does the job, and cost me nothing but time. All said and done. I like it.
Version 2 might have the base plate carved into the Pyrrh1c logo…
Still haven’t been able to get into the shop to build out the frame for the the arm yet. However, that doesn’t mean I’ve been idle!
Decided to take the opportunity to start adding the LCD display I wanted. I grabbed a spare display I had lying around and get started. Found some good articles over on Robojax and got it set up.
I have it set up so that ever N’th time the arduino sends a serial line transmission of the current values it updates the LCD. This means the LCD isn’t as current as the serial monitor, but I found the refresh rate of the LCD was too slow to keep up. I plan to add more functionality to fine tune this via the C# app and the CLI, but for this morning just getting it running was good enough for me. I’d like to add “Enable-LcdUpdate”, “Disable-LcdUpdate”, and “Set-LcdInterval” commands. Possibly an option to choose what is displayed as well (servo’s vs sensors or something like that).
I’ve been too busy lately to really commit the time to go build out a proper frame for the light probe. Instead I’ve build a bunch of half-assed mock ups which all generally suck and failed to work. I guess the moral of the story is that there is no shortcut here and I need to just go build the thing.
That said, I’ve decided to add a dedicated CLI tab to the application so I
don’t have to keep switching back to the Arduino IDE’s serial monitor. The next step is getting it wired up. This will require me to learn some new techniques as I don’t really know how to write a buffer type variable, or even if one exists that I could just make use of. While contemplating this I again found myself looking for a quicker easier way to do it, and again half-assed some things that didn’t work and were rolled back. Again proving to me that there are no shortcuts. I think I might include that on the site motto going forward…
I’m travelling today so this will be a shorter update.
Finally got the calibration working so I can manually offset the photoresistor readings and servo positions. This was necessary because the components naturally have slight variations in their readings, etc. I will be creating semi-automated calibration sequence, but that will need the LCD screen up and running first. I also tweaked the CLI functionality a bit to more easily integrate with the C# app. Still outstanding is polishing it up so it can be used the a terminal emulator like Putty.
Next items on the agenda include:
Getting rid of the semi-colons from commands
Re-aligning the sensors from corners to sides (i.e. left and right instead of upper-left, upper right, etc.
enabling manual override of the automatic controls
Tying that to a Wii-Chuck (down the line a bit…)
LCD Status Screen
Bluetooth control module, to allow operation remotely, and without a PC/phone.
Having a blast building this thing, even if there is some serious scope creep happening. 😉
So I took some time this weekend to add a CLI to the Arduino. It follows the verb-noun syntax familiar to Powershell users (because I am one, and I love that syntax…) It still interfaces with the C# GUI of course, but now I can interact with it from the Arduino IDE’s serial monitor as well. Ultimately I will enable Putty interaction with it. I also did some refactoring to streamline the code a bit as I’m now up to over 70% of the Arduino’s available memory… May need to upgrade the Uno to a Mega. Fortunately I’ll be near a Micro Center in the near future. (W00t!)
Also got the servo’s governed down to between -45° and 45°. This was simple enough, but I did get hung up on an idiot loop because the damn values kept going out of the range and getting hung. Took some thinking to get that to stop. Derp.
As always, the code has been updated on the Github Page.
I also have the Latest Build available for download as well, though not much has changed.