Hi Everyone,
More than 2 years ago, I posted about how poorly my Handibot was performing on the network. It's an Intel Edison based Adventure Edition 2.0, and even with an external antenna, it could never stay connected to my Wifi. I have a limited amount of garage/workspace that I don't want to fill with sawdust, so I prefer to put the Handibot on the back patio during long cuts. I won't go back into those details here, suffice to say I shelved the tool while searching for a reliable solution, and this weekend I finally cracked the code and got the Fabmo build from the github repository running in a docker container on a Raspberry Pi.
Below are my notes on how I got it working. Leveraging the completely unorganized, outdated, gap-ridden, bizarrely formatted sprinkling of documentation about Handibot was nearly impossible - the G2 v30x boards never had published data sheets or any kind of pinout diagram, and in general the stack of 3 custom boards makes for a guess-fest when trying to determine which things are important. If these breadcrumbs help even one other person (or a future self that has lost my build notes) it will have been worth it:
- Make sure G2 has been upgraded to latest firmware. This was tested with 1.7.2.
- Firmware updates were not possible with docker build, reinstall edison and flash up using :81 interface first
Docker Problems to Overcome:
1. Docker Build must be done on a Pi with no NodeJS or NPM installed.
- The dependencies are ancient and its a rabbit hole of problems to upgrade. Just SerialPort is 16 major revisions behind
- Remove any NodeJS install before starting
- Overall I recommend just getting a dedicated SD card to do this with.
2. BOSSA is missing
- It's actually a sub-project on git, so download it and add it to the directory
- [
github.com]
- The docker build will exit with a Make error if this is missing
3. Network manager has no code for linux generic
- Since we're not trying to replicate the Wireless AP mode, most of this is
irrelevant, however it will still try to run during startup and break
the process
- The generic network_manager can be copied from the root to:
/fabmo/network/linux/generic/index.js
- The online check should be edited to just return True:
GenericNetworkManager.prototype.isOnline=function(callback) {
setImmediate(callback, null, true);
}
- The dependency on log should be changed to require('../../../log')
4. Machine starts in "ALARM" state sometimes
- Not sure why this is the case
- While its in alarm, it refuses to do anything else which breaks the initial setup
- I resolved this by running clearAlarm from g2.js right after connect in the machine.js code but removed it later.
5. Docker must run privileged to access the serial port, must have 80 passed through for normal http access.
- Did not test with alternate external ports but it would probably work.
6. No apps are included by default.
- Apps are FMA files that are really Zip files with content in the root.
- Downloading a repository as a zip from github puts the content in a directory which won't work.
- If needed, download, extract, re-zip without the containing directory.
- Upload from inside Fabmo and be patient - it takes a while.
- Recommended minimum: Fire-Up, Macro Installer, Hole Cutter
Instructions:
1. Get a clean Pi and apt-get update/upgrade before proceeding. Tested on a Pi 2 and a Pi 3.
2. Clone [
github.com] into /fabmo
3. Clone [
github.com] into /fabmo/BOSSA
4. Fix the network manager stuff. (pre-req step 3)
5. Build the docker image: docker build -t fabmo /fabmo
6. Connect the G2 board with a USB2 A>B cable to a USB port on the Pi.
6. Make sure you can see /dev/ttyAMA0 from the Pi while the G2 is connected (this is the USB serial port used)
7. Start the container: docker run -it -v /dev:/dev -p 80:80 -p 81:81 --privileged fabmo /bin/bash
8. Inside the container start the app: npm run dev
9. Install apps in the instance using FMA files (pre-req step 6)
10. Commit the changes to a new image - docker commit <example 9a03c28c0a37> fabmo-apps
This was good enough to send the tool a few cuts and it stayed connected thanks to the better connectivity of the outboard Pi!
I'm looking for a good place on the tool to hijack some DC 5v for the Raspberry pi so that I don't need a separate power cable, so if anyone can point me to a place where I can pull that (it's up to 2.5a for a Pi 3) it would be a big help. If anyone wants to collaborate on this I think it would revitalize some of the older tools that might be hanging around out there.