Month: March 2020

Disillusionment

The exit polling where upward of 60% of voters say it was more important to nominate a candidate who could beat Trump than someone who agrees with them on issues … that’s pretty unbelievable to me. But it’s especially odd that “dude who can beat Trump” is also the dude who wasn’t dragged through the mud as a tangent to the impeachment trial. Anyone want to guess what this year’s “but her emails!!!” will be?

Parliamentary systems

Reports are Warren’s reassessing her continued candidacy too. Sad to see her leave the race, but I’d love to see her and Sanders form a combined ticket.
It would make the American election process a little more like the Parliamentary systems (no one has the needed majority, you start negotiating with other parties to develop a unified platform until some combination has enough sway) if candidates in the primaries would slot themselves into administrations as people drop out (not just VP, either — pick someone to head State, Education, HHS, etc).

Super Tuesday

In a way, it seems like reporting is being built to fit a narrative. A woman on one of the afternoon radio shows in Cleveland was on some iteration of The Real World. I remember her talking about how the producers pick a narrative for each contestant — who is the villain, who is the underdog, who is a slob. They then go back over the hundreds of hours of footage and edit together a show that fits their narratives. The reality is that everyone had emotional breakdowns or left a dirty plate in the kitchen. She was picked as clingy. I remember her talking about how she was trying to call her boyfriend. There’s some way they allocate phone time — I don’t know if you get a few minutes whenever or if you’ve got a window. Whatever the method, her boyfriend kept not being available when she’d call. And that was it for her opportunity to contact the outside world. They didn’t show the attempts to call that led up to her breaking down after missing him. And, as a one off, breaking into tears because one cannot talk to one’s partner does sound clingy and codependent.

Differential, even handing Biden delegates for all those who endorsed him {and I haven’t bothered to verify that those delegates *can* vote for Biden}, is 146 — although Warren has 51 and is evidently taking a day to reassess, so hopefully she’ll drop and endorse Bernie well ahead of next week’s primaries. But even with a 150 point spread, 300 delegates from California are not assigned. Ignoring Cali, there’s a narrative that Biden won handily. But Cali’s pretty big to ignore. The reporting was similar coming out of Iowa too — Buttigieg won – he is so far ahead in SDE’s. Oh, he lost the popular vote pretty significantly *and* the delegates are pretty evenly split. But *facts* got lost with the logistical problems and then New Hampshire voting.

Can they drag out the California results for a week so Michigan goes to Biden because he’s ahead (if upward of 60% are saying they are voting for ‘someone who can beat Trump’ v/s ‘someone who agrees with them on issues’ … seems like ‘ahead in the polls’ would sway a lot of voters). Or does showing Sanders trailing motivate younger people to get out and vote in the coming weeks (https://www.usatoday.com/story/news/politics/elections/2020/03/04/super-tuesday-bernie-sanders-youth-votes-fell-short-compared-2016/4947795002/). It’s easy enough to sit home if you think you’re guy is winning — and I’m certain it’s a lot easier for retired people to take some time and vote compared to someone working two jobs and taking care of their kids — but if the race is close?

If the political parties wanted to design a system to diminish faith in the ability of people to select who leads the country, the ability of people to push the direction political parties go … Republicans have gerrymandering, but the Democrats have this primary process.

MySQL: Moving Data From One Table To Another

Our OpenHAB persistence data is stored in MySQL. There’s an “items” table which correlates each ItemName string to an ItemID integer. There are then Item#### tables that store persistence data for each item. If you rename an item, this means a new table is created and previous persistence data is no longer associated with the item. For some items, that’s fine — I don’t really care when the office light was on last month. But there’s persistence data that we use over a long term — outdoor temperature, luminance, electrical usage. In these cases, we want to pull the old data into the new table. There’s a quick one-liner SQL command that accomplishes this:

INSERT INTO NewTable SELECT * from OldTable;
e.g. INSERT INTO Item3857 SELECT * FROM Item3854;

You can drop the old table too:

DROP OldTable;

But I run a cleanup script against the item list so often don’t bother to remove tables one-off.

ESP8826 (12e) Multisensor

We’d set up a prototype multi-sensor with an environment sensing kit that Scott picked up at MicroCenter a few years ago. There’s a little LCD display … but we wanted to report readings back to our OpenHAB server. Which required a network connection. Checking out prices for network cards to add to the Uno … well, it wasn’t a cheap add-on. But we found these ESP8266 modules that support 802.11b/g/n and provide the memory/processing for small programs. At about 3$ delivered, that was exactly what we needed.

I ordered a bunch of components to make multi-sensors – pressure sensors, luminescence sensors, temperature/humidity sensors. The sensors connect into a CP2102 ESP8266. The device is powered by a couple of 18650’s in a little box — another buck. There’s some miscellaneous wiring and a little breadboard, too. The total cost for the multi-sensor is about 8.50$. We could add a vibration sensor for another 0.50$, a PIR sensor for 2$, and a UV sensor for 2.50$. That’s 13.50$ for 7 different sensors — and we don’t need seven sensors everywhere.

I kind of want to make a weather station too — add a water level sensor, a precipitation detector, and a wind speed sensor. Those are surprisingly expensive! I want to check out the process to build your own anemometer. But I’d probably buy a nice Davis Anemometer 🙂

Connecting to a WiFi network with the ESP8266 is really easy:

  • Add a library to the Arduino IDE
    • In the Arduino IDE preferences, select File>Preferences menu.
    • In the “Additional Boards Manager URLs” field, add ‘https://arduino.esp8266.com/stable/package_esp8266com_index.json’
    • Select the Tools > Board menu and open the Boards Manager. Search for “esp8266” and install the platform.
    • From the Tools > Board menu, select the appropriate board. I ordered the CP2102 ESP8266 module, and we’re using “NodeMCU 1.0 (ESP-12E Module)” as the board.
  • Configure the WiFi network connection details in your code
  • Compile
  • Upload
  • You’ve on the network!

We’ve used an MQTT library and send sensor readings to our MQTT server.