Got frotz working on the Pocket CHIP. Now I can run Interactive Fiction games (ex. Infocom) on the move, while using a discontinued hardware device. 🙂 At least I finally put it to use.
Before you do anything, check out the mirrored documentation found at chip.jfpossibilities.com The site has mirrored the sources, so you can actually run updates again. Thank you, JF!
# Pocket C.H.I.P. (Pocket CHIP)
# Installing SSH Server on Pocket CHIP
# Note: When using sudo (do as sysadmin) the password is “chip”
* Open Terminal
* Move to apt directory
> cd /etc/apt/
* Update sources.list
> sudo nano sources.list
* In sources.list, replace opensource.nextthing.co with chip.jfpossibilities.com
* CTRL-O to write out (save). CTRL-X to exit.
* Updates preferences
> sudo nano preferences
* In preferences, replace opensource.nextthing.co with chip.jfpossibilities.com
* CTRL-O to write out (save). CTRL-X to exit.
* Update with jfpossibilities as the repository (instead of the defunct nextthing)
> sudo apt-get update
* Install SSH Server
> sudo apt-get install openssh-server
* Start the SSH Server
> sudo service ssh start
* Get the IP address. You can look on your router, or:
> ip a
* Look for the wlan0 inet entry (looks for your subnet, etc 192.168.x.)
* On your PC, use WinSCP or similar to SSH into that IP.
* The user will be “chip” and the password is also “chip” (if you didn’t change default).
* You should now be able to easily transfer files between your PC and the Pocket CHIP.
# Why I Did This
# Not a whole lot of the use for the device, but it’s portable, has a screen and keyboard…so…
# How about Interactive Fiction / Text Adventures? The old Infocom games. Running the Z Machine.
# How to install FROTZ — the Z Machine
* Do all of the above to get SSH Server running (makes it easier to copy games from PC).
* Instal frotz
> sudo apt install frotz
* In /home/chip/ you can create a folder called games
> cd /home/chip
> mkdir games
* I then used WinSCP to copy to Z5 game files to that directory (/home/chip/games/)
* Now to run them. Navigate to the /games/ directory.
> cd games
* Run frotz
> frotz [gamename].z5
* For example: > frotz leather_goddesses_of_phobos.z5
# Do some web searches to find z5 files. I found this site helpful: https://if.illuminion.de/
I got the X and Y limit switches working. Not perfect, but good enough to move forward. Spent yesterday coding “go home” “go center” and a preliminary “scan slide”.
Slide Center is currently hard-coded based on “eye balling” one of my sample slides. I’ll have to come up with something more scientific. 🙂
The level of magnification determines the steps per photo — inverse ratio (lower the mag, higher the # of steps). It follows the mag values, but I’ve tweaked to give some additional overlap. The steppers and gearing are good enough for over 1000x (the optics, not so much).
I’ve also directly connected the camera to the microscope (not going through an eyepiece). These images are roughly 300x. 3D printed a little 32mm adapter tube.
As I play with it, I’m coming up with a list of stuff to do: add a Cancel/Abort/Panic button (hooked to an interrupt). Allow user to set scan ranges. Allow user to set center. Save default values?
Also thinking through a proper case for it.
Of course, also working through how I’m going to trigger cameras.
It’s so simple a problem that it’s a giant pain in the neck! To further automate the microscope, I need a way for the program to find a “home” position — a starting point. Something that won’t strip gears, crack slides, or otherwise cause mayhem.
Most X/Y/Z devices (3D printers, laser cutters, CNC routers, etc) use limit switches. The trouble is the way the microscope stage moves.
X – Moves just the slide left/right
Y – Moves the stage forward/back
Z – Moves the entire stage up/down
So, you either start attaching switches in weird places (on the stage, on the body) or come up with something else. Added fun? The top limit of Z should change depending on the objective lens. And, by the way, not the entire stage moves for Y — just the very top of it. But, Z does move everything. You start to see my problem.
How to cleanly find home, inexpensively, with as little modification to the microscope as possible?
I’ve looks at more sensors than I wish to admit:
Time of Flight (Laser) — Good for finding a single direction of movement, but I’d need three at $15 each. I tried some ideas of using just one for X and Y, but that didn’t pan out.
RGB Sensor Through Eyepiece — Find the “dark” / black and you determine the edges of the sample. Works fine, in a controlled (dark) environment, but reflected light (from the room light, bouncing off the top of the slide) messes with the readings.
Hall Effect Sensors — Like switches, but triggered by magnets. Most promising, but when Z is moved, their point of triggering changes. I pretty much need a constant/known distance between magnet and sensor.
Accelerometer / Magnetometer — AKA Gyroscope and Compass — Good for finding Yaw/Pitch/Roll, but since the microscope doesn’t Yaw/Pitch/Roll, not helpful for me. The stage movements are too small to accurately tell if its moving in a particular direction. Perhaps this is a solution, but I’ve not figured out how to tease out good data.
I was also thinking of a proximity sensor, like the one found on our Prusa 3D printer. Kinda like a Hall Effect without the magnets. But, the sensors aren’t cheap ($15-$30 each), pretty big, and I’d need three. And the whole range of motion problems and where to mount them.
So, for now, I’ve admitted defeat and gone back to micro switches. I’m hoping to get them working “good enough” so that I can write code. For now, the focus (ha-ha) is on X and Y. I’ll add Z later. (Z is less important, as the focus really needs a human eye, or smart AI.)
Pocket watch or network sniffer? Not sure. Both? A portable web server? I haven’t figured it out yet.
Using a recycled LiPo battery from an eCigarette. MakerFocus ESP8266 WiFi dev board with 0.91″ OLED display and charging circuit.
The 3D printer makes iterating though designs easier. A lot of unused parts, but we use them during classes to illustrate the progression of work — it’s not right the first time! Or the 5th!