The Bee Pi Light

Beeminder generously provided me the parts to build a Raspberry Pi Beeminder traffic light (thank you so much @mary && @dreev!) , provided I beemind the project and create resources for anyone else who would like to build one to be able to follow along, use my code, etc. I’ll be posting updates in this thread, and making sure I do that using this goal:

So far I’ve pulled everything out of the box, plugged in the Pi, and realized I have to install Raspbian on a mini SD card before I can really get down to business.

A few pictures to tease:

And a parts list:

5 Likes

Update

Working on intsalling Raspbian on my micro sd card. Not sure if I’m going to need to boot directly off the pi, with a monitor and keyboard, mouse, to finish the installation, or if I can do everything remotely without needing to connect a monitor directly to it. Has anyone done this before?

2 Likes

I’ve gone ahead and purchased an adapter so I can connect a display directly to the pi:

I have, it’s easy. Here are my notes:

Raspberry PI Headless

$ cd /Volumes/boot
$ touch ssh
$ code nano wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
    ssid="YOUR_SSID"
    psk="YOUR_WIFI_PASSWORD"
    key_mgmt=WPA-PSK
}

$ ssh pi@raspberrypi.local

The default password for the pi-user on a clean Raspbian install is raspberry.

Maybe wpa_supplicant.conf needs:

country=de

Worked for me without this, though.

2 Likes

You are giving me ideas! My acrylics supplier of choice got these shinies:

Which as it so happens is a pretty good (if you don’t look to hard) match for the Beeminder goal status colours:

image

And there is this handy dandy bad boy of a laser cutter:

I won’t be doing anything but cramming until the 9th but afterwards… Well there is this little dashboard that wants some attention, too. But THEN I ma totally beat you to this :stuck_out_tongue: Nah just kidding. Or am I? Wanna make a bet?

I would arrange those in a hexagon pattern and not a traffic light. Hm… :thinking:

2 Likes

Haha, some friendly competition! You’re on. :sweat_smile:

1 Like

Update

Purchased a monitor adapter, and am currently installing Raspbian!

1 Like

Update

  • Successfully SSH’d into the Pi
  • Created a GitHub repository to be a home for instructions, parts list, code, etc:

Update

Added command tables to GitHub repo:

1 Like

Update

Added instructions on how to configure a remote graphical desktop connection to the pi:

Do you have a goal that makes you add content to your site regularly? :wink:

1 Like

Just a goal that requires I post updates here, and I’d be embarrassed to post an empty update. :stuck_out_tongue_winking_eye:

3 Likes

Update

Added more detailed info on finding the Pi’s IP address.

Update

Got the lights going! Code and instructions now in the repo to do this:

GIF-191122_154127

3 Likes

Wait so how does this work? What do the colors mean? Are they per goal or for everything?

3 Likes

Just to be clear, this project isn’t yet done. The lights don’t mean anything yet.

The plan is that, when it’s done, if any goal is going to derail today, the red light will be on. If any goal will derail tomorrow, the yellow light will be on. Otherwise, the green light will be on.

The initial desire was for an indicator of whether or not it’s safe to go to bed.

3 Likes

Update

Added Beeminder integration to the project. The Beeminder integration isn’t used for the lights yet, but it does find the nearest deadline and calculate how many seconds until it’s reached:

bee-pi-light-calc

Update

The lights are now set based on nearest goal deadline!

The script finds the goal with the nearest lose date. If the lose date is before midnight tonight, it flashes the red light. If the lose date is before midnight tomorrow, it flashes the yellow light. Otherwise, it flashes the green light. It makes this check every 10 minutes, or half of the remaining time before the lose date, whichever is smaller.

One problem: I have a do-less goal with a zero slope and zero buffer. The way Beeminder calculates lose dates means that goal will always be due before midnight today, even though I have pessimistic presumptive data turned off and wouldn’t derail if I never touched the goal again. Because of this, running the script with my goals will never result in a green light even if I don’t have to touch any of my goals for weeks. Any ideas on the right way to get around this?

5 Likes
  1. Archive the goal. What’s the point of having it as a Beeminder goal if you don’t have to do anything and there are no consequences?

If you want to keep it for the sake of recording:
2) actually do less of whatever it is so you give yourself more buffer and keep that as your new nominal.
3) change your goal to allow one more days worth of whatever it is, for one day, then change back to the current settings of the next day then proceed as above. It’s the opposite of retroratcheting.

The goal is working as-is. I don’t wish to change it.

I’d rather modify the script to behave better.

Failing that, I may add the ability to exclude goals in the config file.

2 Likes