Thursday, October 20, 2022

Off-grid Base Camp Solar Power

 800 watts of panels, 5.4 kWH of battery*, satellite internet, all I could need for work-from-woods


This was a constant tinkering project, but it always basically worked all summer.

Hackish Off-grid Weather Station (2021)

In 2020 I noted that you can build a small gadget-charging off-grid solar power system for about $200. In 2021 I deployed it to a spot in the woods of Vermont.

This is largely a tale of what kinda-worked and what I should do better next time.

Friday, October 7, 2022

Victron Energy VE.Direct hackish

I have been increasingly pleased by Solar energy components from Victron Energy. Most of their products have a "VE.Direct" port which is just 5V UART serial at 19200 8N1 (a few older battery module units are 3.3V). If you ask nicely and register at their site they will give you pretty thorough technical documentation of the protocol over that serial port. I've been using this python module for parsing VE.Direct serial port broadcast (status update just sends once a second, this may be all the data you need for many uses).

They have an official $30 VE.Direct USB serial adapter that plugs in to their equipment and Just Works. But I work with embedded stuff to know that those are some pretty cheap commodity parts potentially. So I set up with this USB to UART TTL (5v or 3.3V) module that's $10 for a 5 pack and this JST 2.0 PH cable, and for $3 and some soldering I have my hackish VE.Direct adapter cable. Worked the first time!



Wednesday, September 28, 2022

IRV Fails Again, Alaska 2022-08-16

Instant Runoff Voting, the form of Ranked Choice Voting most enacted in the US, known for decades to be flawed, has failed again.

The August 16, 2022 special election in Alaska elected Mary Peltola to US House, but more people wanted Nick Begich.

This isn't an obvious conclusion from the top line reported results, so let's dig and see how this happened.

The IRV rounds played out like this, with Begich in third and eliminated in the first round.

Round 1Round 2
Peltola, Mary S.7580391375
Palin, Sarah5893786195
Begich, Nick54009
exhausted330414626
overvote23693
active188749177570
But let's look at all the second choice votes, from Peltola and Palin also:

FirstSecond
73948Peltola, Mary S.41424Begich, Nick
8447Write-in
3635Palin, Sarah
56669Palin, Sarah32551Begich, Nick
3197Peltola, Mary S.
1214Write-in
51762Begich, Nick25699Palin, Sarah
14093Peltola, Mary S.
1391Write-in
3051Write-in1075Begich, Nick
997Peltola, Mary S.
429Palin, Sarah

Begich was the clear consensus second choice of Peltola voters and Palin voters, and he had a sizeable first-choice vote as well.

When you add it all up, the pairwise preferences look like this:
123
(1) Begich, Nick88212101500
(2) Peltola, Mary S.7951591438
(3) Palin, Sarah6369386283
Peltola had good first choice support, but much weaker second choice support, so ultimately more people wanted Begich over Peltola than the other way around.

With no additional complexity and no additional cost, we could have better Ranked Choice Voting that recognizes the democratic principle that if more people want A than B, A should win.

Monday, March 14, 2022

Time Zones, DST, Act Locally

Lots of debate about DST and time zones and should we change them.

Around where I am in Boston, with DST, sunrise varies by over two hours from 05:06 to 07:22, and sunset varies by over four hours from 4:11pm to 8:25pm. (DST is really "sunrise stabilization time".)

What I think I hear underneath is that people want their schedules aligned to the sun. The want more sun in their day. They want their waking aligned to the sun and the end of their day aligned with the sun.

Then they run up against needing a bunch of states going in on change together, or even an act of Congress. The sad fact of astronomy is that summer days are over 15 hours but winter days are only 9 hours and maybe with that scarcity of daylight we're just not going to make everyone happy.

But, we can act locally starting any time. Businesses can change their hours. School districts can change their hours. There's nothing sacred about school starting at a time named "7:35 am" or whatever. DST or not, that time could even shift a couple times during the year, maybe in steps of half an hour. If I was running a coffee shop I'd be tempted to declare "opens at sunrise" (or an hour before sunrise in some places).

Act locally, start now.

Monday, February 21, 2022

2020 San Francisco RCV Election Not Reproducible

The good news is that San Francisco publishes full ballot data from their elections [1]. It's a quarter-gigabyte zip file full of JSON and I can go digging into it and look for deeper patterns in how people rank candidates on their ballot. Is there a hidden story about who 2nd-choice candidates were and what people really want? Did IRV screw up and we should switch to Condorcet?

The bad news is that I can't reproduce their results. They publish the full data, but the program they run isn't open source.

Saturday, February 19, 2022

RCV Nearly Null Result

The Board of Elections of New York City released full vote data for the Ranked Choice Votes (RCV) for the 2021-06-22 primary election. I downloaded this data and processed it with my software to do some analysis. Out of 63 elections: 3 had different outcomes than pick-one (Yay! This way is better!) and none had different outcomes IRV vs Condorcet. I still maintain that IRV is inferior because sometimes it can fail and for no additional cost or complexity we can have something better, but that 'sometimes' is looking more rare in practice, though it did happen.

Thursday, January 27, 2022

Open Source Voting Machines: 2022-01

A year ago I posted a teaser of some work I'm doing on Open Source Voting Machines.

The ballots are looking a lot better now. There's a proper header and 'how to vote' instructions. The big feature I've been working for the last month is ballot recognition. Given a scan of any known ballot page, identify which precinct it is and scan the appropriate bubbles. With that I think this is now much closer to being a practical system where a central scanning operation could receive absentee ballots and precinct ballots and scan them all. All this with no barcodes, it's 100% human readable. This can be important psychologically to voters because there are no mysterious markings for people to get suspicious of. Most places I've voted still have a plain serial number on each ballot to prevent duplication, that can be addded if desired.

The test ballot I'm generating is based on random words from the Linux dictionary, so just look at it visually and don't read too much into the nonsense ;-)



Thursday, January 20, 2022

Best Wordle Start Word: raise

 I'd seen a couple other posts and decided to do the analysis myself.

There are two word lists of 5 letter words; one with 2315 words and one with 10657 words. Others have noted that the shorter list is probably words that could ever be a solution to wordle, and the longer list is things that will also be accepted as guesses. Linux /usr/share/dict/words contains only 6112 words that match ^[a-zA-Z]{5}$ .

Doing letter frequency analysis on the union of these lists leads to the impression that the best word (with the most frequent letters) is "soare" (an obsolete word for a young hawk). Doing this just on the solution list yields "later" "alter" or "alert".

But we can do better. wordlehack.go does the following:

for each guess word:

  for each target word:

    for some {target} and {guess}, how many possible words remain?

  get the sum of remaning words for all targets

So, what word has on average the fewest remaining words after it has been guessed, across all possible targets? "raise"

This takes into account letter position, not just letter frequency. "arise" is not quite as good.

And if "raise" gets you nothing, the best next word is "clout".

So, there you go, go forth and be more reputable among your peers. raise your clout.

---

Source code (jupyter notebook python and Go)

https://github.com/brianolson/wordlehack

Go play the game

https://www.powerlanguage.co.uk/wordle/


Tuesday, January 4, 2022

Aerial Survey with Open Drone Map

Open Drone Map promises to be an open source tool chain that takes a set of aerial photos and turns them into a map with 3d reconstruction. Last summer I took a bunch of aerial videos hoping to feed them into a process like this. I hadn't researched the details of the tools I'd use to do it, but I vaguely knew they were out there.

I wish I'd known two rules for working better with ODM:

  • Fly high, look down (no horizon in the shot)
  • Take stills, not video (no motion blur, my drone adds GPS tags to stills). It looks like the system will work better with 20-40 stills than all those frames of video.
But still, I was able to get some mediocre results out of ODM with what I had.

I forked ODM and made a branch with setup and run that doesn't use Docker. (branch "no_docker")

I used ffmpeg to get jpeg frames out of my video. Here grabing a section from 3 minutes 24 seconds to 4 minutes 48 seconds, at 2 frames per second, to a directory of images:
ffmpeg -i 'source.MP4' -ss 3:24 -to 4:48 -filter:v fps=2 /path/to/odm/data/images/%05d.jpg

Then from the ODM source dir, I activated the python venv and ran the ODM wrapper script:

(source odmve/bin/activate && ./run.sh --project-path /path/to/odm data)

I'm hoping when I go back and scan the area with what I know of technique I'll get better output. The system is tantalizing enough that I want to do more.