week of 6 august

06 Aug 2018

6 aug

I talked with Scott over the weekend about npm packages and dependencies. I’m going to try taking the ^ character out of the package.json file for packages I want to use old stuff with. I learned that the ^ means npm will install newer versions of the package if there aren’t breaking changes (major update). That’s not what I want.

I’m going to walk away from the serialport stuff for a while. I was hoping that if I could get a clean npm install that it would clear up whatever access issue I’m experiencing inside the Docker container, but I’m still not sure that serialport and modprobe are connected in any way. I get a weird error during npm install of serialport, but still somehow end up with serialport installed, so I’m not sure that’s the error that’s holding this up.

Going back to building docker images:

I don’t have time to run this whole thing again today, so tomorrow I need to:

7 aug

Starting the day off strong with a new directory for exploring a docker container with Alpine Linux/node.

After googling, I found that resin has an alpine-node base image specifically for rpi3.

Alpine is very diferrent than Raspbian. Package manager is apk instead of apt-get. I’m struggling to get normal packages installed. When I try to get npm to install my packages, it says it can’t find pigpio. That’s because it’s not installed. But I can’t figure out how to install pigpio without apt-get! I tried downloading wget, unzip, and make so I could download the package, unzip it, and install it using make, but now I’m getting an error from make, and I DON’T UNDERSTAND ANY OF THIS.

Gotta take a break until tomorrow.

8 aug

I was pretty fed up yesterday. Let’s hope some tunes and extra coffee can help me figure this out today.

Current situation:

Since I can’t debug alpine issues from my raspi, I built a blank resin/raspberrypi3-alpine-node container (no app) so I can work on installing pigpio from inside

Going back to the original new-test directory and seeing if any of my new-found knowledge will help debug this nonsense - added pigpio stuff to Dockerfile’s RUN apt-get install line and double checked my node_modules - still getting all that crazy error stuff when installing serialport but I don’t think it matters - spun up a container and got a modprobe i2c error - so I guess I’m back to “do I even need i2c stuff since I’m not using i2c pins?”

Got into new-test container using exec so I could dig around in the files

Just a personal note to self: yesterday, you were so frustrated by this you almost cried ~10 separate times. Even last night when you were telling Scott all about it, you almost cried again. You’re not a crier. You were legit angry at this not working after a full MONTH and you still couldn’t figure it out. After sleeping on it, you came back with a clear head and kept going. YOU DID IT.

Okay, it’s running, but the ajax request isn’t being sent correctly. I’ll get this sorted out after a massive celebration. I’m guessing this is a problem with the exposed port. That whole part of the docker container has not been on my radar as of yet.

9 aug

HTTP request problem solved: when I cloned my github repo I forgot to change the fake google URL to the real google URL. :joy:

I did end up changing my Dockerfile to expose port 443: EXPOSE 443 and added the -p 443:443 to the docker run command. I have no idea if this made any kind of difference, so I might end up testing and modifying that later.

Now I just need to figure out how to run the docker container indefinitely. I assume it has something to do with the detacehed flag -d. I’m also not sure it matters whether or not the app runs on the docker run command. It currently initializes the REPL and immediately closes the board… I wonder why?

imaging

Now that I’ve (mostly) figured out the Docker piece of this puzzle, it’s time to move on to imaging an SD card with my version of raspbian that includes Docker and my app container, is secure via ssh, and auto-upgrades raspbian.

In order to get a fresh raspi image to copy, I’ll have to set up a clean SD card. I’m thinking these will be my steps:

I assume that will take me most of tomorrow (after the academic affairs kickoff). After how much trouble I had flashing the SD card previously, I’m hoping this time it won’t be so hard. I’m probably wrong, but hopefully I’m older and wiser now, right?

Then I can attempt to save the disk as an image and flash another one. Yay!

Links for tomorrow:

10 aug

I just realized that the gate-counter time is ahead of eastern by 4 hours. I have no idea why, but I will figure it out later. Today is all about imaging.

Flashing blank SD card with raspbian:

wrap up

All in all, a frustrating but very successful week. I got a lot accomplished thanks to the semester break schedule and several library staff members being out. It’s hard to find uninterrupted time to deep dive on these problems, so it’s nice to have a few hours carved out during break weeks– even between lots of unnecessary meetings.