Wednesday, November 22, 2017

Arduino Project One: The Arduino program takes shape

Introduction

This week, I created the skeleton of the program for the Arduino stack. I'm not ready to share my source code yet. Let me get the rest of the meat on the skeleton first.

Security

I listed some ideas for my cybersecurity scheme last week. I have incorporated all of the measure I listed into my program. I'm sure there's a hacker out there somewhere who will figure it out. My description here isn't meant as a challenge to them. It's just to inform you of some simple things that worked for me.
  1. I've chosen a port number, out of the 65,535 available, that's easy to remember.
  2. The server will only accept client requests from specified devices, and not from the world at large. Although MAC address spoofing is a thing, this will stop all but the most determined hackers.
  3. The server will use TCP instead of HTTP, trading long and legible transactions for short and incomprehensible ones.
  4. The router autoforward will be tweaked so that only TCP requests via the specified port can get through to the Arduino.
  5. The server uses a challenge-and-response mechanism, like two spies swapping passwords. When a socket is opened and the client's authorization is verified, the server sends the client a randomly-generated numeric sequence. The client must reply with the proper numeric sequence. I intend to keep the details of this algorithm proprietary. Sorry, folks.
  6. It may be necessary to have the server go through the challenge-and-response several times in the life of a connection.

Robustness and Reliability

The terms "robust" and "reliable" are not synonymous. "Reliable" means that the system will not fail during regular operation as a result of stupidity — my stupidity, to be specific. "Robust" means that the system can recover from power failures and loss of Wifi signal all by itself, without any human intervention.

When the Arduino is first powered up, or when it recovers from a power failure, it looks through its list of available Wifi routers and tries each one in turn, until it gets a connection. If it doesn't get a connection at all, then it sets a timer for 10 minutes and tries again. This is because it can take DSL modems and Wifi routers a while to recover from a power failure too, so if it doesn't catch one the first time, it gives it time to reboot.

After it gets a Wifi connection, it sets up a permanent TCP socket to listen for client requests. Although client requests are the whole reason for its existence, they're not very frequent, so it will spend most of its time being idle.

Every 10 minutes or so, it will ping the Wifi router, to verify that it still has the connection. If the ping fails, then the Arduino has lost the connection, so it goes through the power-up sequence again.

When a client requests a connection, the Arduino opens a temporary TCP socket for that client. It will be up to the client to send a TCP query every second or so, unless it's sending a button-push command. It's up to the client, whether it's a webpage or an Android app, to politely say goodbye and close the socket when it exits. (I'm sure that Corona SDK and JavaScript include onExit() event servers, or something similar.)

But it's possible for the remote client to just drop the connection - battery dies, phone gets run over, computer blue-screens, that sort of thing. So the Arduino will set a watchdog timer when it opens the temporary socket. Any query from the client resets the watchdog timer (that's called "kicking the watchdog" in Embedded Programming Land). If the client doesn't send a query for a long time, the watchdog timer expires, the Arduino says goodbye to the client in case the client is listening, and then the Arduino closes the socket.

TCP/IP

I haven't decided whether to allow multiple clients yet. Normally, only my wife and I will be using the app, and very seldom at the same time. It would be crazily rare to have three people trying to control the garage door at once. Still, it would be annoying for one person to open the app on their phone, and the other person try to open it on theirs, and get the equivalent of a busy signal. So I'll probably have to allow multiple clients.

I haven't put in the actual TCP/IP commands yet. That's for later. 

Sensor and Actuator

I haven't wired up the Hall effect sensor, and I haven't written any code for it. And although I haven't actually connected the relay to the garage door opener yet, I have written the relay code, and I've verified that the relay shield plays nicely with the ESP8266 shield.

What's Next

I'll stick with this program until it's finished. Then I'll need to write a server in plain vanilla C, or maybe Python, to test it. Once the program is finished and it works, I'll post the source code.


To read the other postings about this project, click here and scroll to the end.

Thursday, November 16, 2017

Arduino Project One: Moving right along

I have a lot to report this time. Good things have been happening.

No Corona app yet: More Arduino programming

I didn't write the app on yet. I thought I'd better characterize the Arduino hardware stack a little more.

First, I wrote a little relay demo that turns the relay on and off every second. I needed to find out how easy it was. It's ridiculously easy.

Then I wrote a webserver for the Arduino/ESP8266. I let the thing run open-loop. I tried to access the Arduino's webpage from both my phone and my PC. I was only successful part of the time. I read some online reviews of the ESP8266 shield, and some people complained that it worked once, and never again. Others complained that it didn't have the advertised range. I took two different approaches to this problem.

  1. I modified the SparkFun ESP8266 libraries to print out more information about the clients it was connecting with. I need to know the client's IP address, because other than my own phone and maybe a JavaScript TCP client on my website, nobody should be monkeying with this IoT gadget. I know that full-PC webservers always snoop clients' IP addresses. So I had the Arduino send a command AT+CIPSTATUS to the ESP8266 every time it got a client request, and  log the text of the client request on its serial output.

    After I was finished testing the webserver using the browsers on my phone and my PC, I left the logger running while I did other stuff. HOLY COW! I think that the passthrough is enabled by default on my router. My little Arduino was fielding requests from all over the world. I never did see any IP addresses, but good grief, there's a bunch of nosy machines out there. I couldn't tell if they were humans, spiders, or bad guys. I'll definitely need to use a proprietary port number on my webserver, and I'll definitely need to put restrictions on the passthrough.
  2. I dug up a Coredy E300 repeater/AP/router I've had sitting around for a year or longer, and configured it as a repeater. I plugged it into a wall outlet in the bedroom, almost exactly six feet above the garage door opener. Bonus! This also gives me better Wifi reception in the bedroom and the loft.

Don't give up on the Electric Imp yet

I should mention that this week I got an automated email from SparkFun asking me how I liked my Electric Imp purchase, and reminding me that they were available for tech support and troubleshooting. If I didn't know it was automated, I would have thought they were reading my mind. Or my blog. I will follow up with them on the Electric Imp. It would be cool to get it working.

HTTP vs. TCP

I noticed a lot of dropped bytes in the Arduino's webserver log. I don't know whether they were dropped between the client and the ESP8266, the ESP8266 and the Arduino, or the Arduino's serial port and my PC's Arduino terminal window. I should try using puTTY for my serial I/O and see if it has the same problem.

In the meantime, that got me to thinking: maybe I don't need a full-blown webserver on this project. I mean, Rick S. wrote an awesome webserver for RLE's products, and I learned a lot from working on those projects, but if the user interface is going to reside on an app or on a protected page at my own website, then all I'll need between the Arduino and the client are as follows:

From the client:
  • connection request
  • response to the Arduino's security challenge
  • garage door status query
  • button push
  • response to the watchdog signal ("Yes, I'm still here")
From the Arduino:
  • security challenge in response to connection request
  • garage door status, either in response to a query or initiated by the Arduino
  • acknowledgement of button push
  • a watchdog signal ("Are you still there?")
I don't need HTTP for that. TCP will work just fine.

Security

I am paranoid about a hacker getting into the Arduino, figuring out what it's doing, and using it to burgle my house. I thought of somehow incorporating a public/private key into the interface, but I don't know if the Arduino supports that. So I'll be taking these other security measures:
  • Using a proprietary port number. There's only 65,535 to choose from.
  • Using TCP instead of HTTP, making for shorter messages which will be unintelligible to anyone else.
  • Only accepting client requests from specified devices, and not from the world at large.
  • Tuning the router settings so that it only passes through requests using that port, and from those devices.
  • Incorporating a challenge-and-response feature. When a socket is opened and the client's authorization is verified, the server sends the client a randomly-generated numeric sequence. The client uses the numeric sequence to compute and send the server a numeric sequence in response. If the client's response isn't what the server expected, then the server closes the socket.
The challenge-and-response feature isn't very sophisticated, and it may not even be necessary, given all the other precautions. We'll see.

The system will still be vulnerable to DDoS attacks. There's not much I can do about that. Everything connected to the Internet is vulnerable to DDoS attacks.

A short hardware update

This week I stopped at Home Depot and bought 20 feet of shielded, round, 28 gauge 4-conductor cable, suitable for this project and others. The final installation of the Hall effect sensor will only need 10 feet.

I'm considering what kind of enclosure to get (or make) for the Arduino stack. It will need to be plastic, or at least transparent to Wifi signals. I'd like to have some status LEDs visible through it. 

Red-on-black LCD display from Sparkfun
Red-on-black LCD display from Sparkfun

I got a wild-hair idea this evening, that it would be good to have a small LCD or LED display on the enclosure, always displaying short status messages. I can start without it, and it's not really necessary, but it would be a nice touch.


To read the other postings about this project, click here and scroll to the end.

Saturday, November 11, 2017

Arduino Project One: Corona hits a roadblock

This project has many different facets, and a lot of new things to learn. Development is definitely not linear. It can go in many different directions simultaneously — and that's a good thing, because some of those different directions run into roadblocks.

The Corona Roadblock

For example, there's nothing that says I have to have the webserver running on the Arduino stack before I start working on the Android app. With that in mind, I concentrated on learning Corona this week. Since I once ran a game programming company, I'm familiar with this genre of software. So it seemed like a safe and comfortable place to go.

I downloaded the Corona SDK and worked through the Getting Started tutorial. The last step was to do a live build, installing a development version of your app on your Android device.

Sadly, it was not to be. When I selected File > Build > Android from the Corona Simulator, I got this error message:
Stupid error message.


I selected Yes, and I ended up downloading and installing Java SE Development Kit 9.0.1 for Windows, 64-bit. (It doesn't give you much choice.) After it was installed, I ran Corona and selected File > Build > Android again. Same error message.

I went to the Corona community forums and found this recent thread, which says that Corona SDK 2017.3135 doesn't support the 64-bit JDK. But a fix is coming, and in the meantime, the awesome Corona staff posted a link to the older, 32-bit, Java SE Development Kit 8u151. The word on the Web is that multiple JDKs can exist on my computer at once, so I'll leave 9.0.1 installed.

Corona's not the only game in town. But I'm comfortable with it, with my gaming background. My son has used it successfully and speaks highly of it. And I really don't feel like downloading, installing, and learning yet another development kit. I already have enough new tools to learn. But I went ahead, and downloaded and installed 8u151.

It works! Back in Corona, File > Build > Android built a .apk file for me.

Then I needed to practice installing it on my phone. The Corona Signing and Building page says that if I don't have the Android SDK installed, I can upload the .apk file to a webserver, then download it to my phone, go to the Downloads directory, and simply tap on the .apk file to install it. However, the Signing and Building page also says that I can use the adp install command to install the .apk file directly.

Two problems arose. First, the debug version of the app was so big that it exceeded (what was left of) my daily limit on my webserver, so detouring through the webserver was out of the question for the day. Second, adb is the Android Debug Bridge, which is part of the official Android SDK, and I inferred from the Corona documentation that adb is rather important.

So even though I didn't want to "download, install and learn yet another development kit," that's exactly what I did. First, I mistakenly downloaded and installed the Android Studio IDE. If adb was part of Android Studio IDE, it was hidden very well. I couldn't find it. Then I looked on the Corona debugging page, and it gave some clues on how to download the command-line-only Android SDK tools. That was a relief — if I had to download the entire Android Studio IDE, why was I even bothering with Corona? So I happily uninstalled Android Studio IDE.

According to the debugging page, I needed to install at least the Android SDK Tools (I had to scroll down to the bottom of the page to find them) and Android SDK Platform Tools. It took some sleuthing to find those links. The adb tool is in the Platform Tools, so I had to make sure I had that one.

I unzipped the downloaded files and stored them in C:\Program Files\Android\sdk-tools, in the subdirectories tools and platform-tools.

For a test, I tried installing the StarExplorer app from the Corona SDK "Getting Started" tutorial. It took a couple of tries to execute the adb install command:
C:\Program Files\Android\sdk-tools\platform-tools>adb install -r "\Users\Ray\Documents\Corona Built Apps\StarExplorer.apk"\Users\Ray\Documents\Corona Built Apps...d. 2.8 MB/s (27069109 bytes in 9.069s)        pkg: /data/local/tmp/StarExplorer.apkSuccess
C:\Program Files\Android\sdk-tools\platform-tools>
Finally it was successful - but then I couldn't find the app on the phone. I looked in the Apps pages, but StarExplorer wasn't there. Then I looked for the /data/local/tmp directory using the My Files app and I couldn't find it.

It turned out that I was being impatient. It just took a while for the phone to update its files. After about 20 minutes, I went back to the Apps pages and I found it. The app ran perfectly on my phone.

To make it a little easier the next time I install an app, I added the paths C:\Program Files\Android\sdk-tools\tools\bin and C:\Program Files\Android\sdk-tools\platform-tools to my PATH environmental variable. Now I don't have to type in adb's entire pathname to run it.

So even though it was a real trip down the rabbit hole, collecting and installing all the tools to build and install the app on the phone, it finally worked.

Corona Does Networking!

On the bright side, I did find out this week that Corona has a network library. Reading the API documentation and looking at some examples, I'd say that this will do the trick nicely. 

So What's Next?

Now I can write the app. Once it's completed, I'll go back to the Arduino. I have to do the following:
  1. get the relay clicking
  2. try out those Hall effect sensors
  3. write the webserver and exercise it from my home network
  4. get my DSL modem / Wifi router to passthrough HTTP requests to the Arduino webserver.
  5. exercise the Arduino webserver from outside my home network

What about Internet privacy?

One thing that I haven't thought about until now: I need to research privacy / security measures for the Arduino webserver. I don't want the whole world to know when my garage door is up or down, and I definitely don't want strangers activating it. Moreover, I don't want someone in Uzbekistan hijacking my Android, turning it into a bot, and using it to mount a DDoS attack on an embassy somewhere.


To read the other postings about this project, click here and scroll to the end.

Veterans Day, Remembrance Day, Armistice Day - always remember and never forget

The poppies at Flanders Fields, a large military cemetery in Belgium. (Image copied, without permission, from dailyhive.com)

November 11 is a holiday to remember the cessation of hostilities in World War I, which happened 99 years ago. The guns went silent at the eleventh hour, on the eleventh day, of the eleventh month of 1918.

For 20 years, WWI was known as The Great War, and was nicknamed The War to End All Wars. That didn't work, did it?

In 1919, U.S. President Woodrow Wilson declared November 11 Armistice Day, to commemorate the end of WWI. In 1954, it was renamed Veterans Day.

Also in 1919, Great Britain's King George V declared November 11 Armistice Day. In 1931, in Canada, the holiday was renamed Remembrance Day, and is celebrated as such in all countries of the Commonwealth of Nations (what's left of the former British Empire).

Most people, including me, confuse the meanings behind Veterans Day and Memorial Day. Veterans Day is to recognize and honor all of those who have served in the military. Memorial Day is to remember and honor those who died while in military service. (Thanks to Wikipedia for making that distinction.)

Personally, I think we should honor all of them, all of the time.
Today, I recognize and honor the following:

  • COL Edwin French, USAAF, killed 1946 in occupied Japan.
  • SGT Donald McIlveen, Royal Canadian Army, who fought in Italy in 1944-1945 and came home to live a long and happy life.


... all of my friends who fought in Vietnam, too many to name ...

... and these members of the next generation, who either recently served or are still serving:

  • Jason Depew
  • Jennifer Depew
  • Robyn Chalupa
  • Todd Williamson
  • Alisha McKee
  • Van James Walther Jr
  • Chris Barela
  • Casey Barnum
  • Nathan Murphy
  • Heather Hansen's husband, Joshua Hansen 
  • Dustin A Giesick
  • Don Bugg
  • Peter Boone
  • Nikki Yaste and her husband, Alex Yaste
  • Tom LeNeave
  • Ruth Ann LeNeave


... and any friends that I forgot to list.

Sunday, November 5, 2017

Arduino Project One: (Not really a ) Progress Report

For a project with no timetable or deadline, this one is progressing nicely.

Hardware

I've collected all of the electronics I will need. Here's a picture of them:
The stack in the center includes: the Arduino (this one's an Elegoo Uno R3) on the bottom; the Sparkfun ESP9266 Wifi shield in the middle; and the Evil Mad Scientist relay shield on top. In front of the stack are two ACS712-based Hall effect sensor boards. The one on the lower left is just the sensor. The one on the lower right includes an amplifier and a couple of adjustment potentiometers.

I will need to enclose the sensor in either a block of potting compound, or a 3D-printed plastic case. It will be in a place rather exposed to the elements, and I don't need it to break down at critical moments.

I'll need to either make a 3D-printed case for the Arduino stack, or find a project box that fits it. Since it will be mounted next to the garage door opener motor, it won't need environmental protection, but it will need to be protected from vibration, and it will have to be able to connect wirelessly to my router.

I'll also need to get a power supply (a wall wart) for the Arduino stack, and about 20 feet of 4-conductor 28AWG or 24AWG wire for the Hall effect sensor.

Finally, I'll need to verify that none of the signals used on the Wifi or Relay shields overlap. I fear I may already have a collision with the software serial interface on the ESP8266 and a relay control pin.

Software

The code for the Hall effect sensor, while not exactly trivial, is stuff I already know how to do. I've been doing this sort of thing for years.

I ran through the ESP8266 tutorial, and I can set up the ESP8266/Arduino combo as a very rudimentary webserver. I've successfully communicated with it via a browser. That's all I need on that end.

I found a webpage that tells how to connect the ESP8266/Arduino combo to the Internet, including the critical step (new knowledge!) of setting up forwarding through my DSL router/Wifi access point.

I found another webpage that expands on that, using JQUERY and HTML to control a servo - or in my case,  a relay.

I've installed Corona on my computer, but I haven't played with it yet. I hope there's a tutorial in there that gives me hints on how to create an app that can communicate with the ESP9266/Arduino's webserver.

I need to find something about installing public/private keys on the Arduino to keep this tiny part of the Internet of Things from getting hacked.

That's it for now

By next time, I should have the web server running on the hardware stack, and I should have some preliminary testing completed on the sensors.


To read the other postings about this project, click here and scroll to the end.

Wednesday, October 25, 2017

Arduino Project One: A long-distance garage door remote

Want to keep updated on this project? See the end of this article for a list of all progress reports.



Introduction

I've enjoyed "hobby computers" for a long time. I have more than one each of Raspberry Pi, C.H.I.P., and Arduino. There are many others out there, but I don't spend enough time with the ones that I have. I have worked through the tutorials, and I have done some breadboard constructions that are rather fun, but I haven't done any serious work with any of them.

Our garage door opener has given us a scare a couple of times in the eleven years that we've lived in this house. Twice, we have come home to find that it was open when we thought it was closed. The first time, a large lime against the door frame on one side caused the door opener to reverse, lest the closing door squish the lime. The second time, the door forgot where "closed" was, touched the ground, and opened again. Why did it forget? It could have been the house settling, the concrete heaving, or something slipping in the door opener mechanism.

After the incident with the lime, I started getting paranoid about the garage door. Don't tell anybody this, but I have driven two miles back to the house, just to drive past and make sure the garage door was really closed.

Finally! I have a great idea for a hobby computer project! I will build a web-based garage door sensor and actuator. I'm sure it's never been done before! I'll commercialize it and make millions!

Research on the State of the Art

Actually, in the world of hobby computers, I'm a few years behind. A Web search for "Arduino garage door" shows how many people have already done it.

Moreover, in the world of commercial, web-based, garage door sensors and actuators, I'm way behind. Here's a kit for only $120 from Overhead Door (or Genie).

I don't care. I'm going to do it anyway, just because it's fun.

Basic Design

So here's a basic design. TODO: Insert a graphic, a block diagram of the system.

Sensor
Actuator
Computer
- Arduino
- Wifi shield
Either a tiny webserver on the Arduino, or some executable code on a private webserver
Browser-based interface
Android app

Now for the details:

Sensor

A garage door can have three states: fully open, fully closed, or moving.

No, a garage door can have five states: fully open, fully closed, opening, closing, or stopped in the middle.

That's too much work. How are you going to keep track of all of that? You could put a shaft encoder on one of the rotating parts of the opener. That would let you tell if it was opening, closing, or stopped — but not whether it was fully open or fully closed. That's three states, but not the two that matter most.

One solution online was to use two powerful magnets and a Hall effect sensor, with the magnets positioned on the drive chain exactly where "fully opened" and "fully closed" should be. That allows the garage door to have three states: fully open, fully closed, or somewhere in the middle and presumably moving.

A one-button controller for a garage door opener works like this: press the button to start it moving. Press it a second time to stop it moving. Press it a third time to start it moving in the opposite direction. The door opener stops automatically at the fully open and fully closed settings. This takes us back to the five states.

How about we simplify the problem? I only care whether the door is or isn't fully closed. If it's not fully closed, then it's moving up, moving down, fully open, or stuck in the middle, and I don't care. Those all count as not fully closed — or open.

I already know that a photosensor and reflector wouldn't work reliably at our house. The photosensor might get confused by the sun's glare on summer mornings.

I could mount some kind of sensor (magnetic, photovoltaic, pressure) flat on the concrete, and the door would come down flat on top of it. This might not work in the winter, when we get a layer of ice on top of it.

I could mount a 3D linear accelerometer on the top panel of the door. When that panel goes completely vertical and stops moving, then the door is closed. I like this idea! But the accelerometer has to have some way to communicate with the computer, and it's attached to a moving door. 

Reed switches. Mercury switches. Mechanical things wear out. What if there were a mechanical switch that doesn't wear out? My pilot son had a great idea.

Aircraft have a switch built into the landing gear, called a squat switch, or a weight-on-wheels switch, which tells them when the aircraft is solidly on the ground. Some things in the aircraft, you don't want to have happen until the plane or helicopter cannot fall out of the sky. These switches are, by necessity, extremely robust. A squat switch will tell you whether the airplane is or isn't on the ground.

Where to mount the switch? Well, when a garage door closes, the top of the door is pressed flat across the lintel of the door frame. (The lintel is the horizontal part across the top. The vertical parts on the sides are called the posts.) When the door starts opening, the top of the door is pulled away from the lintel, and no other part of the door touches the lintel. So the lintel seems like a good place to mount a squat switch.

Now I just have to get one. My son, the pilot, is finding a source for me.

After thinking about it overnight (no wonder I didn't sleep well!) I realized that the location for the squat switch — top of the door, top center of the lintel — is also an ideal place for a magnet and Hall effect sensor. So if the squat switch ends up being expensive, I'll go back to SparkFun for one of their ACS712-based Hall effect sensor boards.

Actuator

The garage door opener is an Overhead Door SilentMax 4040. Installed by Yours Truly eleven years ago, it works as well as the day I put it in. Its rubber belt drive is almost completely silent, especially after I lubricated the belt with a thin spray of white grease a few years back.

The SilentMax 4040 has a wired remote on the wall of the garage, with two buttons: one for the door, and one for the light. Only two wires go into the opener itself, so the wired remote must do something to differentiate between the DOOR button and the LIGHT button. And it does. Here are the pertinent details:

  • With no buttons pushed, a 4.1Vdc difference exists between the terminals on the opener.
  • Pushing the DOOR button shorts the two terminals, so there's a 0.0Vdc difference for around 200 ms.
  • Pushing the LIGHT button doesn't short the terminals, but engages a voltage divider, so there's a 2.76Vdc difference between them.
Since I don't care about the light, I can just have the computer switch a relay. 
Anyway, I'll need to attach a relay to the same terminals used by the wired remote. The computer will switch the relay, which will duplicate the action of the remotes.

Computer

A Raspberry Pi or a C.H.I.P. would be overkill for this project. You don't need Linux to open and close a garage door. I'll use an Arduino. In fact, I'm going to go really old-school and use an Arduino Uno. I have two to choose from: a Redboard from SparkFun; and an Uno R3 from Elegoo. I should be able to run the same program on both boards. I'll try the Elegoo first. It's brand new, and I want to try it out.

The Arduino has general-purpose digital inputs and outputs that will work just fine for the sensor and the relay. I'll need to add a transistor to the relay output, and perhaps an op amp or other buffer to the sensor input.

For Wifi capability, I have two choices from SparkFun: either the Electric Imp, or the  ESP8266. Both solutions are versatile enough that someone smarter than me could figure out how to use the Electric Imp or ESP8266 by itself, without the Arduino, to do this project. I'm not that smart. Both solutions come in either an Arduino R3 shield form factor, which is ideal for my Arduino Uno boards, or in a smaller "breakout" board. I ended up buying both.

I tried the ESP8266 shield first. It worked the first time I powered it up.

I tried the Electric Imp next. It didn't work. That is, I couldn't get it to connect to my Wifi router. The setup requires you to download an app to your tablet or smartphone, power up the Electric Imp, hold it next to the phone screen, and run a function on the app which transmits your Wifi router information to the Electric Imp by strobing the phone screen into a light sensor on the Electric Imp. When the strobing is completed, you're supposed to wait up to 90 seconds for the Electric Imp to connect to the Wifi router.

Wouldn't it be simpler just to set up a serial connection to the Electric Imp and type in the SSID and password manually? It would certainly make troubleshooting easier. The concept of the Electric Imp is intriguing, but if I can't make it work, what use is it?

Since I'll be using an Arduino and a Wifi shield, and one can stack an infinite number of shields on an Arduino (as long as the pin assignments don't conflict), I bought the Relay Shield from SparkFun. I will stack it on top of the Wifi shield - or maybe the Wifi shield should be on top. We'll experiment.

The hardware as of 26 Oct 2017 (rawr)

Webserver

My first implementation will use a webserver. This could be a mini-webserver on the Arduino, or on the Wifi board (like I said, they're both versatile enough to handle it), or on a private server. All three are viable options right now.

I should probably use a port, for a couple of reasons — the main one being that it gives me some security, however weak. How many low-level hackers are going to be trying different ports?

For the sake of security, the webserver will require some kind of authentication. This is important so that some random hacker doesn't spend all day running my garage door up and down for his own amusement. This could be as simple as a login and password. 

In the long term, I'll also want some kind of security between the webserver (if it's remote) and the Wifi. One of the prior implementations used a dual challenge and response: the server sent the host a hashed number, and the host then replied with the unhashed number. If the number was correct, then the host sent the server a hashed number, and the server had to unhash it and check it. I dunno yet. I'll figure this part out later.

The basic procedure will go like this:
  1. Requester sends authentication; host accepts or rejects it.
  2. Host queries the Arduino for the current status of the door.
  3. Arduino checks the sensor and replies to the Host.
  4. Host tells door status to the requester.
  5. Requester pushes the button to start or stop the door. (Or exits, if they're satisfied with the status.)
  6. Host sends the Arduino the "button" command.
  7. Arduino energizes the relay for 200 ms.
  8. Host queries Arduino once per second, for as long as the requester is logged in or the app is open.
  9. Requester exits the app, Host and Arduino go idle.

Browser-based interface / Webpage

The browser-based interface will be as follows:
  1. Welcome screen: login, password
  2. Main screen
    1. Status indicator: green and "open" or red and "closed".
    2. A big button, labeled "Push this button" or something like that.
    3. A smaller "Exit" button.
    4. An even smaller "setup" button - to specify the Wifi's IP address.
  3. Under the hood
    1. Queries the Arduino once a second.
    2. Sends button pushes to the Arduino.

Android app

The Android app would do basically the same thing as the browser-based interface, without the need to login. Well, maybe - as a security precaution, in case the phone is stolen.

Software Tools

The Arduino is programmed in its own dialect of C. The ESP8266 is controlled using good ol' AT commands. The Electric Imp is programmed in a C-like language called Squirrel. The webserver could be JavaScript, perl, or who knows what else?

For the Android app, I considered using Xamarin, but I didn't want to get trapped in the Microsoft tar baby, so I'm going with Corona. It's advertised as a 2D game engine, but it's much more powerful than that. I've used game engines before, and I know what they can do. Besides, I can get some expert help with Corona.

Proposed Enhancements

I've seen people connect spy cameras to hobby computers. I'd like to connect a camera to the Arduino or the ESP8266, and have a tiny picture of the garage door on the main screen.

I need to measure the time it takes for the garage door to close. If the door status is "not closed" and someone pushes the button, the door status should changed to "closed" in a reasonable amount of time. If it doesn't, then the status should change to "there's a problem".

I'm not afraid of a more complicated state machine. With the right sensors, I could incorporate all five states. I'll try other sensors, if I can figure out how to make them work &mdash and if they're reliable.

Not that it affects the basic functionality of the machine, but I'm going to have to do some graphics work to create the objects that make up the app. Call me old-fashioned or steampunk if you will, but I still enjoy the skeuomorphic user interfaces that Apple and Microsoft used to use and have since abandoned. My app is going to have a couple of old-fashioned indicator lights mounted in chrome or bronze bezels, a 3D push button bigger than a fingertip, and a black leather (or black crackle-finish or black powder-coated metal) background.

Project Timetable

There isn't any timetable. This is a hobby, a just-for-fun DIY project. But here's a list of milestones as they occur.

25 Oct 2017 First draft of this project plan is written. Happy birthday!
26 Oct 2017 Added details about the Wifi shield and relay shield from SparkFun.. Added details about the wired remote.

Updates

I ended up posting each update as a separate article. Here are the rest of them.

Saturday, October 21, 2017

John Kelly, you have disappointed the nation.

John Kelly, you were one of the last people in the White House that I respected. Now you're just like all the rest of them: a big fat liar.

That was the short version. Here's the medium-length version.

I listened to MSNBC's "All In" on the radio yesterday. Chris Hayes is the host.

Chris Hayes played John Kelly's entire talk to the press, where the White House chief of staff told, in detail, the story of Florida Congresswoman Frederica Wilson's speech at the 2015 dedication of a new FBI building in Miramar, Florida. He told a convincing story about how she had spent her time at the podium taking credit for the building, and how she had personally gotten a $20 million commitment from then-President Barack Obama to build the building. According to Kelly, her whole speech was about herself and how great she was, especially for bringing the pork home. In his words, "... we were stunned." The gall of the woman's ego and self-promotion was beyond — well, beyond almost anybody in modern history, except perhaps Donald Trump.

Well, the Florida Sun Sentinel had dug up a videotape of that dedication ceremony, and All In had obtained a copy of it. So Chris Hayes played Congresswoman Wilson's speech, in its entirety. She told a story about how, four weeks before the dedication, the FBI had approached her and asked to have the building named after two FBI agents who had been killed in the line of duty. That literally takes an act of Congress, and so Wilson talked about how she had contacted the leadership of both the House and the Senate, and gotten that act of Congress through in record time. There was nothing "stunning" about it. She spent the rest of her speech praising the FBI, law enforcement and first responders in general, everyone involved in raising the building, and her colleagues in Congress for helping to get the building named.

She didn't say anything that John Kelly had accused her of. She bragged a bit about rushing that bill through Congress, but it was a fun story, and she gave credit to all of the other players.

As for the $20 million from President Obama, Wilson pointed out to reporters this week that the $20 million was appropriated by an act of Congress in 2009, and she didn't get elected to Congress until 2011.

Everything John Kelly said about her was a lie. Everything.

The long version? If I'm able to find a transcript of Kelly's words and one of Wilson's speech, I'll add them to this post so that you can read them for yourself.

Friday, October 20, 2017

An inside joke for an audience of one

I talk to a lot of people on my morning commute. I talk to the DJs on the radio. I talk  to the texting app on my phone (guilty as charged, yer honor). I talk to my car. I talk to the traffic lights, especially the red ones. I talk — politely, of course — to the other drivers on the road. And I talk to myself.

I have fun conversations with myself. Sometimes I even make myself giggle.

For example, this morning I was coming up behind and to the left of a VW Beetle that was stuck behind a slowpoke in the right lane. I said, "Come on over, bud, there's room for you." Then I said to myself, "Actually, that's Bug, not bud."

It was an inside joke for an audience of one. The audience liked it. I thought that you might like it too.

A QUESTION FOR YOU: What do you talk about, when you're alone in the car?

Monday, October 9, 2017

Looking ahead to 2020

Every day with President Donald Trump is a new disaster. We try to distract ourselves with hurricanes, earthquakes, mass shootings, and a trust-fund baby juggling nuclear missiles, but Trump is like the guy at the party who manages to insert himself into every conversation in the room — and ruin it.

If the USA were a publicly traded company and he were the CEO, the shareholders would have kicked him out by now. Too bad it's not that easy to get rid of the Chief Executive of the United States.

It's clear now that electing him was a disaster. Don't worry, if Clinton had gotten elected, we would be saying the same things about her. The 2016 election was a lose-lose proposition.

What can we do to make sure the 2020 presidential campaign doesn't go the same way?

Well, this article on NBC News got me thinking about 2020. The second-to-last paragraph says:

Late last month, [retiring Tennessee Senator Bob] Corker announced that he would not see[k] re-election, fueling speculation that he might challenge the president in a GOP primary. 
Unencumbered by the need to watch his mouth and make sure he gets re-elected to the Senate, Corker has been speaking his mind. Speaking truth to power. Calling out, repeatedly, that the emperor has no clothes. Using his bully pulpit to stand up to Trump and Co.

I don't know, he's starting to sound downright presidential. He would be a better president than Trump.

DETOUR:

After Vice President Pence's little rehearsed stunt at the Colts-49ers game yesterday, I'm starting to believe Corker would be a better president than Pence, too.

If you want to read about Pence's stunt, Google "Pence walks out". Every link I found was biased one way or the other. Read multiple sources to get a balanced view. But it was rehearsed. It was a stunt — a rather expensive stunt.. And if his airfare and hotel were paid for by the U.S. taxpayers, then shame on him. I used to respect Mike Pence.

About Pence's stunt, the great Tom Peters tweeted:

Wonder if POTUS gave VPOTUS a "good puppy" dog buscuit after yesterday's scripted showboating episode?

BACK ON THE MAIN ROAD:

If Bob Corker is serious about running for president in 2020, then he needs to start now building a few things:
  • A team - an organization.
  • A "base". Trump and Clinton have made this a dirty word, but it's still necessary.
  • A platform - a statement of what he believes in, what he's running for.
  • Knowledge.
  • More name recognition.
  • Credibility.
  • Likeability.
  • Even more visibility.
  • Popularity. It shouldn't matter, but every election in the past 100 years (longer?) has proven that it matters bigly.
HERE'S ANOTHER IDEA:

This year, the Mormons have proven to be faster and more effective than the federal government when it comes to disaster relief. Witness the responses to hurricane Harvey in Texas, Irma in Florida, and Irma and Maria in Puerto Rico (and the U.S. Virgin Islands), and the earthquakes in Central America. LDS Welfare Services started shipping supplies, in their own trucks, even before the hurricanes hit. Local and global LDS leadership was on the ground even before the rain stopped falling. Thousands of LDS volunteers were organized and working hard, in force, before the feds ever showed up. Maybe it's time we put a Mormon in the White House?

I don't know if Mitt Romney wants to give it another try, but I think it's pretty clear that he would have been a much better president than the current occupant. If not Mitt Romney, then how about Jon Huntsman Jr., the statesman, businessman, and diplomat?

But don't vote for Huntsman — or against him — just because he's a Mormon. Vote for him because he's a good man.

ON THE OTHER HAND:

I wouldn't mind if the 2020 election turned into a race between two great women — for example, Condoleeza Rice and Madeline Albright. Come on, people, this is the 21st Century. There must be some viable options besides white, allegedly Christian, males.

And there are definitely viable options besides Democrats and Republicans. If enough people opened their eyes and had the courage to vote third party, we would break the duopoly these parties have on the presidency, a duopoly which has proven to be unconstructive, easily corruptible, self-serving, and unfortunately, self-perpetuating.

I don't care if the next ideal candidate is Democratic, Republican, or Pirate Party, as long as it's a person of maturity, integrity, wisdom and vision. All of the above. In no particular order.

Wednesday, September 27, 2017

Time to refocus

My very wise friend, Jenny Willhouse Peterson, wrote this:

Time to refocus.

Things that are of critical importance to the health and wellbeing of millions of Americans today: conditions in and aid to Puerto Rico, healthcare vote. And Russia. Keep that one pinned to the top too.

Things that are thrown out there like chum to keep you divided and distracted: NFL shenanigans. It wasn't this much of a row before someone twisted the message to work everyone into a lather.

You're smarter than this. Focus. Love. Support. Unify.

I hope Trump will be remembered for this

When the history of this decade is written, I hope people will remember that while Puerto Rico was struggling in the aftermath of a Category 4 hurricane, President Donald Trump spent four days obsessing over professional football players who wouldn't stand during the playing of the National Anthem. Not until nine days after the storm hit, did he start taking any action to help Puerto Rico, and even then he spent way too much time patting himself and his buddies on the back and not really doing anything.

I know he's planning to visit Puerto Rico more than two weeks after the storm hit the U.S. territory, but:

1. I think he's being forced into it. His advisers are making him do it.
2. He really doesn't care about Puerto Rico. It's not on his radar.
3. The whole time he's there, he will be thinking, "Why am I doing this? This is a waste of time. And this place is a dump. Let's get out of here."


What this country needs

What this country needs are more radical moderates. Alt-independents. Conservative liberals. Liberal conservatives. People who think with their whole brains, and love with their whole hearts.

And you can quote me on that.

Friday, September 15, 2017

Short Thoughts on a Woman as President of the U.S.

Following up on something I said in my previous article:

To put it more bluntly: American voters aren't against electing a woman president. But they are against electing Hillary Clinton.

Let me elaborate. As I said in the article, "come on, people, it's 2017." Except for a few on the radical right (the remaining 8% of Americans who still support Donald Trump?), we don't live in the Stone Age anymore, and the idea of a woman as president is not only okay, but it's plausible - maybe even inevitable.


I would consider voting for someone like Condoleeza Rice or Madeline Albright, but not Hillary Clinton. To the best of my knowledge, Rice and Albright are not as blatantly greedy or power-hungry as Clinton. They are not rude, whiny, condescending or snobby, while Clinton is all of those things. They do not have the serious credibility or trust problems that Clinton has. They're not as full of themselves as Clinton is of herself. And they enjoy more respect (and credibility!) in both domestic and international circles of power than Clinton does.

Now, to those of you who will accuse me of holding a woman to a different standard than I would hold a man: first, notice that in the previous paragraph, I compared women to women. Second, perform a quick test by replacing "Clinton" in the previous paragraph with "Trump". See? Not a different standard at all.

Thursday, September 14, 2017

No, HIllary Clinton, You've Got It All Wrong.

I'm going to put the concluding paragraph of this article at the beginning. If you don't read anything else, read this:

Nowhere in What Happened will you read these words, "I understand now. The America people didn't like me because I was a thoroughly unlikeable and immoral person who made it very clear that I was only in it for myself - well, for the power and the wealth." But that's the truth, and that's the bottom line.

Now, if you're still interested, you can read the article from top to bottom.

Hillary Clinton is making the talk-show rounds, plugging her new book, What Happened, which is a very whiny and self-absorbed analysis of why she lost the 2016 presidential election to Donald Trump.

No, I haven't read the book. But I've heard a lot of the interviews — too many. Clinton's main contention is that it's everybody else's fault that she lost. Here, in no particular order, are my observations on her comments. Please note that I'm not citing any polls or news articles to support my assertions. I don't feel like doing that today. If that hurts my credibility, tough. Clinton and her election opponent, Donald Trump, did (and do) the same thing.

1. I agree that the Russians were undoubtedly involved.

2. I agree that James Comey's bumbling undoubtedly played a part.

3. Point 2 notwithstanding, I don't think the emails themselves had anything to do with it. But Clinton's attitude, that she could do whatever she wanted and that she was above the law, had a lot to do with it.

4. Trump's charisma, and the voters who were deceived by his charisma, played a big part. Hillary Clinton has never had charisma. See also Kennedy vs. Nixon, Bill Clinton vs. anybody, and Reagan vs. anybody. Charisma wins votes.

5. I disagree that sexism (or misogyny, a stronger word) played a big part. Come on, this is the year 2017. Sexism may have played a part in the right-wing fringes of the Republican Party, but I don't think it played as big a part with the general electorate as Clinton says it did. I think that the majority of Americans are not opposed to a woman as president. After all, we've witnessed successful female heads of state in Great Britain, Germany, India and Israel, to name only a few, but those women were (and are) great leaders and, ahem, statesmen. Clinton's not even in the same league with them.

5a. To put it more bluntly: American voters aren't against electing a woman president. But they are against electing Hillary Clinton.

5b. Do you remember, "Who wants to see a woman president?" Clinton herself shouted this from the podium at a rally, at the beginning of the primary season. She got an overwhelmingly positive response. There's no difference between "Vote for me because I'm a woman!" and "They didn't vote for me because I'm a woman." She was not above using sexism to her own advantage.

6. And point 5a, of course, brings up the Electoral College. She can blame that antiquated institution for her loss, but hey, the Republican side knew how to play the game, and they played it very well. She could have done the same thing. She chose not to. That's her own fault, and nobody else's.

7. Simply put, the American people didn't like her. They thought she was devious, manipulative and underhanded. They thought she was greedy and dishonest, exemplified by the Clintons' looting of the White House when they left it in January 2001. They thought she was self-centered, mean, petty and cruel, especially to those in subordinate positions. They thought, accurately, that she wanted the office of President just so she could collect more power and wealth for herself.

8. Who can forget:
- "I could have stayed at home and baked cookies," her disenfranchisement of half of the electorate in the country;
- "I will do whatever it takes to get elected [president]," justifying her campaign for the U.S. Senate;
- "What difference does it make?" her handwaving dismissal of the Benghazi debacle/tragedy;
- "Get the @#$%* away from me!" to her Secret Service escorts;
- and many other condescending, insulting, dismissive, or imperious remarks? To mix metaphors, she opened her mouth and shot herself in the foot, over and over again.

9. She was married to Bill Clinton. The country still hasn't forgiven him, and they still think she was complicit in some of his debauchery. This may not be fair, but it's real.

10. Many of you will reread point 7 and say in Clinton's defense, "Hey, you can say all these same things about Trump," and you will be right. Everything I said in #7 about Clinton can be said about Trump (except, maybe, looting the White House). Donald Trump was just as bad a choice for president as Hillary Clinton. I've already talked about that, in this article and this article, for example. Neither of them should ever have won their party's nomination, let alone the general election.

Nowhere in What Happened will you read these words, "I understand now. The America people didn't like me because I was a thoroughly unlikeable and immoral person who made it very clear that I was only in it for myself - well, for the power and the wealth." But that's the truth, and that's the bottom line.

Monday, September 4, 2017

Donald Trump is Nothing But a Mean Old Man

Donald Trump is a mean old man. Nothing more.

In June 2015, I had declared Donald Trump an idiot.

In October 2016, during the height of the election season, I declared that he was a lot of other things, none of them very good. And I meant every word I said.

More recently, I had come to the conclusion that  he was an infant and a jackass.

Last Thursday, I declared that Donald Trump is an impostor.

Well, now Donald Trump himself has revealed that he is nothing but a mean old man.

Yesterday, on a Sunday in the middle of a three-day weekend, the White House announced that Trump had "decided" to end the immigration policy known as "Deferred Action for Childhood Arrivals," or DACA. This policy, instituted by Trump's predecessor, Barack Obama, in June 2012, gave hope to the children of illegal immigrants — children who didn't choose to come here, in the legal sense, but came with their families. DACA was a way to give them hope that they could build a future in this new country — the only country they had ever known, and the place that they considered home.

Donald Trump is not doing any good by canceling this policy. Nor does he care that he is making innocent people suffer.

Trump did not take this step to Make America Great Again, because this does not make America great. It makes America small, petty, and mean — just like its chief executive.

He did not take this step to secure our nation's borders. It has no impact at all on national security.

He took this step because he's trying to fulfill at least one of his campaign promises, and he hasn't had a lot of luck so far.

He took this step as part of his (unwritten) policy to undo everything that President Obama did, good or bad.

And he took this step to solidify his standing among his so-called base. (According to Time magazine, that's only 35% of Americans, and the number is falling. Can't Trump do math?) Donald Trump's base has shrunk to the point that it now includes only the baser elements of American society: the racists, the neo-Nazis, and the right-wing extremists. Oh, and closed-minded, two-faced hypocrites.

If you knew any of these so-called Dreamers personally, you would feel the same way I do.

Twelve years ago, I taught mathematics to some of these children, first in English, as state law required, and then a second time in Spanish, so they could understand and learn.

Six years ago, my sweet wife taught literacy, English, to some of these children. One of them, a young girl, had to skip school every Wednesday to help her parents work in the fields.

Some of these children have now graduated from college. The rest of them have found honest jobs. They have become contributing members of American society. They pay taxes, Social Security and Medicaid/Medicare. They are marrying and raising families of their own.

Where is the justice in sending them back to a country that they don't call home? Where's the fairness? There isn't any.

Let's hope that Congress has the courage and the will, to do something to ward off the damage this "decision" will cause, before it takes effect six months from now.

Please feel free to share this article - I won't consider it copyright infringement.

UPDATE: Tuesday, September 5

So, Trump had his attorney general, Jeff Sessions, give the official announcement this morning. Sessions wrapped it all up in pretty little legalese justification, inventing the word "effectuated" to help him get his point across. But according to MSNBC, a metric trainload of legal and constitutional scholars have rebuffed every point Sessions tried to make, including the most important assertion, that Barack Obama's executive order memorandum, setting up DACA, was illegal.

Then Trump tweeted something to the effect of "Get to work, Congress! You have six months." First of all, he's still laboring under the impression that he's the boss of Congress, and second, he's using an ultimatum again, one of his favorite negotiating tools. Ultimatums are stupid. What do you expect?

Finally, tonight, the Daily Beast reported this:

President Donald Trump said Tuesday night that if Congress cannot pass a legislative fix for the Deferred Action for Childhood Arrivals (DACA) program that his administration scrapped, he will “revisit” it. “Congress now has 6 months to legalize DACA (something the Obama Administration was unable to do). If they can't, I will revisit this issue!” Trump tweeted. He declined to offer specifics on what “revisiting” would entail. 

Vague threats like this are another one of Trump's negotiating tactics. To bring this article full circle, he sounds like nothing as much as a mean old man, like a grouchy neighbor.

Thursday, August 31, 2017

Donald Trump is an Impostor

Donald Trump is an impostor. Donald Trump is a fake.

At one time, I admitted that I might be wrong about Donald Trump, and that it was possible that he was nothing more than a braying jackass.

As his presidential term lurched forward, I changed my mind, and thought of him as little more than a bawling infant.

I've changed my mind again. Just like Frank Abagnale in the story Catch Me If You Can, Donald Trump is nothing more than an impostor. A total fake.

Donald Trump has demonstrated, repeatedly, that he doesn't have what it takes to be president of the United States. He has no leadership ability. He has no morals. He has no empathy. He has no courage. He has no integrity. In place of depth, he has shallowness, an appalling superficiality. In place of knowledge and wisdom, he has willful ignorance and selfishness.

He has no talent. Okay, let me amend that: he has whatever talent it takes to be a unscrupulous, unprincipled real estate tycoon.

And all along, every time he opens his mouth — or Tweets — all I can think is "Jeez, what an idiot". The "idiot" theme spreads over all of my other opinions of him, like gravy covering everything on the plate at Thanksgiving.

The 30-something percent of Americans whom he is still fooling? He doesn't care about them. They don't realize the utter contempt in which he holds them.

It still astounds me that he made it into the White House. I didn't vote for him.

Insert picture here: If I could, I would post a picture here of protestors at an airport, waving huge signs saying "GO HOME TRUMP", "TRUMP IS A FAKE" and "GOOD RIDDANCE", as Trump's private jet lifts off in the background, carrying him back to ... well, to anywhere. Away from Washington D.C.

Update, 4 Sep 2017: Actually, Donald Trump is a mean old man, and nothing more.

Wednesday, July 5, 2017

Five out of six Democrats and Republicans are stupid

Okay, I've seen two news articles lately with polls like this. These poll results are powerful indictments of the stupidity of the majority of Republicans, and the majority of Democrats.

Here's one example, but it's only an example. Don't get hung up on it. This is a poll that asks people "Whom do you trust more: Donald Trump, or CNN?"


I saw a very similar diagram last week, for a poll that asked people something like "Do you believe in the Trump-Russia collusion connection?" and I've seen similar diagrams for the health care bill, Supreme Court nominees, James Comey's firing, and so on. Let's paint a generic picture of the results of these polls:


Now, I'm going to use some math here. If you're not very good at math, that's okay. You may have a lot in common with the majority of the people I'm going to talk about here. And if you're offended by my condescending attitude, that's your problem, not mine. Don't look here for an apology.

Let's dissect that figure above. First of all, look at the line marked "Independents". These are people who vote, but who don't consider themselves Democrats or Republicans. Most of them don't identify with any political party - not because they're politically apathetic, but because they prefer to do their own research and weigh the pros and cons of an issue (or a candidate) before making their own decision. The party line does not exist for them.

So you can use the statistics on the Independents as a bellwether: politically, they're atheists, logical, dispassionate, and not swayed by labels like red/blue, liberal/conservative, or Democrat/Republican. In this example poll, you can see that 40 percent of the independents lean pro-Trump on the issue, and 55 percent lean anti-Trump. Let's round that 55 percent up to 60 percent, to make the math easier for this example.

(Those of you who don't understand math and statistics may cry "Not fair!" at my rounding. Relax. 40 vs 60 is being kind to Mr. Trump. I saw a poll in June, where 30 percent of independents leaned pro-Trump and fully 70 percent of independents leaned anti-Trump on the question being asked. How about I use 30 vs 70 instead? No? Then stop whining.)


Now, I'm going to propose a theory. I think that political parties are composed of two kinds of people. One kind actually thinks about an issue or a candidate before they make a decision or form an opinion. The other kind always toes the party line. They only need to know what the party line is - no thinking required.

I'm going to pose a second hypothesis. I have nothing to base this suggestion on, other than my belief in the basic goodness of people, and humanity's natural gifts of logic and reason. I'm going to suggest that, if only the thinking Democrats AND the thinking Republicans were polled, their split would be very similar to the Independent results, as shown above.

This means that it takes some independence of thought for a Republican to lean anti-Trump, or for a Democrat to lean pro-Trump.

So let's give those 9% of Republican respondents who leaned anti-Trump credit for thinking for themselves. Using the 40/60 ratio from the Independents, let's also give 6% of the Republicans credit for using their heads, thinking it out, and coming out pro-Trump.



What does that say about the other 83% of Republicans, the ones who voted the party line without bothering to think? It says that they're stupid.

Is stupid too strong a word? How about sheep? Blind followers? Willfully ignorant?




On the Democrat side, let's give those 5% who leaned pro-Trump credit for thinking for themselves. Again using the 40/60 ratio from the Independents, let's give 8% (I rounded up; so sue me) of the Democrats credit for using their heads, thinking it out, and coming out anti-Trump.



What does that say about the other 83% of Democrats, the ones who voted the party line without bothering to think? It says that they're stupid.

Is stupid too strong a word? How about sheepBlind followersWillfully ignorant?



Wow. According to this and other public opinion polls, 83% of Democrats and Republicans are mindless party loyalists. THEY ONLY THINK WHAT THE PARTY TELLS THEM TO THINK.

Democrats think that they are the party of "thinkers" and the Republicans are the party of "stupid". Republicans think that they are the party of "thinkers" and the Democrats are the party of "stupid". Both parties are wrong. As the results of this and many other polls show, they're both the party of "stupid".

If you are a Democrat or a Republican, and you think you're one of the thinking minority, there's an 83-percent probability that you're wrong, that you are one of the party loyalists. The sheep. The stupid ones.

If you disagree with me, there are a couple of articles on Wikipedia that you need to read. The first is about fundamental attribution error, and the second is about self-serving bias, both of which are logical mistakes to which we mortals fall victim, over and over again.

The acrimony, the political divisions in this country will continue to get worse until people stop blindly supporting their party and learn to think for themselves. The poll results will get more and more extreme, and the divide between the two major political parties will get wider and deeper. Polite
political discourse has already ceased; inflammatory rhetoric has taken over. Violence is stomping through the door, and oppression is not far behind.

If you are a Democrat or a Republican, you have to do something to fix this. You don't need to abandon your party affiliation. You do need to abandon your mindless loyalty to your party. Use your brain to figure things out. If your party, or your party's representative, is wrong about something, then separate yourself from the majority on that issue, and make it known.

I don't pledge allegiance to a political party. I pledge allegiance to a flag, the nation that it symbolizes, and the Constitution that it is built upon. I don't vote for party leaders, political appointees, or lobbyists and influence peddlers, and I don't want them running the country - I mean, dictating how people think. That happened in the Soviet Union, but it should not happen here.

Wednesday, June 21, 2017

Cancer survivor

I am a cancer survivor.

Twice.

But I feel like a cheater.

In November 2013, at age 56, my wife found a black spot on the back of my ear. I had it surgically removed. It was a malignant melanoma. Fortunately, they got it all. I will be going back for checkups, every six months for five years, to make sure it doesn't show up somewhere else.

In May 2017, at age 59, I went to the emergency room with the worst stomachache in the history of the universe. I was diagnosed with pancreatitis, given a miracle painkiller called Dilaudid, and admitted to the hospital for four days.

The doctors stuffed me in an MRI tube to take a closer look at my pancreas. They never did find the cause of the pancreatitis, but while I was in there, they found something on my kidney that didn't belong there. Suddenly they were a lot more concerned about my kidney than my pancreas. They did a CT scan and confirmed that I had a tumor on my right kidney.

So about six weeks later, after my pancreas was back to mostly normal, I went into surgery to have the tumor removed. A biopsy on the tumor showed, according to the doctor, that it was a "classic renal cell carcinoma" and that it had "negative margin." He could have just said, "It was cancerous, but we got it all." I will go back for a CT scan 12 months from now, and if it shows no more cancer, then I'm free.

I was lucky—or blessed—both times. The first cancer, the melanoma, was caught by my alert and perceptive wife. The second cancer was only a Stage 1 carcinoma, only 2 centimeters long, and it was what the books call "incidental detection"—something you find while you're looking for something else. The first one was removed in the doctor's office, and all I had to do was wear a huge bandage behind my ear that made me look like Dumbo for three weeks. The second one was removed using video-game surgery, so they didn't have to slice my side wide open and stomp around inside.

That's why I feel like a cheater.

I didn't have to deal with chemo. Or radiation therapy. A suppressed immune system and the resulting opportunistic infections. Massive hair loss. Nausea. Sores that wouldn't heal in my mouth, my ears, or anywhere else. A feeding tube. Catheters and PICC lines. A portable oxygen system. Unending, unrelenting pain. Doctors who didn't comprehend the pain and wouldn't prescribe drugs simply to relieve the pain.

(Side note: I will always be grateful for that Dilaudid, and for the medical professionals who gave it to me. On a scale from 0 to 10, with 10 being pain so bad that you would rather die than continue to suffer, the pain from pancreatitis is a 20 or a 30. My doctors and nurses understood that.)

I didn't have to sell everything I own, including my house, to pay thousands of dollars a week for drugs that might or might not keep me alive. My family didn't have to go through weeks and months of endless torment, watching me get alternately better, then worse, but always worse, wondering if and when the beast would finally kill me.

I got to live. Twice.

From the melanoma, I have a skin graft on the back of my ear. From the carcinoma, I have six small scars on my right side. Only nine days after the surgery I'm up and around. I'll be riding my bike in a couple of weeks.

I'm neither bragging nor complaining. I know how blessed I am. Four medical professionals—doctors and surgeons—independently acknowledged the hand of God in this latest episode, remarking on the fact that it hadn't been for my pancreatitis, ...

But I feel guilty. I feel like a cheater. I got out of the cancer class twice, without having to take the full exam.

Still, when all is said and done, there is this:

I am a cancer survivor. Twice.

Thursday, May 18, 2017

Four Character Traits that are Vital to Success

In my opinion, all of the success literature either ignores, or takes for granted, four character traits that are vital to succeeding in any endeavor in life. If you're missing any of these traits, you have two choices:
1. Give up.
2. Acquire and develop the missing character traits in your life.

Here are the four traits, and a short explanation of each.

Courage
  • Not just courage to do the right thing, but courage to do the scary thing.
  • ... or the uncomfortable thing.
  • ... and, especially, the thing you don't want to do.
Ambition
  • This is the drive to do something important or meaningful in your life.
  • It's not necessarily about fame, or wealth, or power. 
  • It's the will to do something besides watch TV, surf the web, play games, or read magazines.
  • It's the will to do something with the time you've been given, besides waste it in meaningless pursuits.
Initiative
  • This is the ability to get up and do something - to start something.
  • Ambition by itself may not be enough to motivate you to action.
  • To repeat and rephrase: initiative is the power to get up off the couch and get started.
Tenacity
  • This is the ability to stick with something until it's completed.
  • My friend John W started dozens of home-improvement projects around his house. He never finished a single one. His house always looked half-demolished, as if a truck had crashed into it. He had an abundance of ambition, but a complete absence of tenacity.
  • Tenacity is related to perseverance, and also to stubbornness. It's the wolverine on the bear's nose in Vardis Fisher's Mountain Man.
  • It's the unwillingness, maybe the inability, to give up.
Notes: I wrote these down on a piece of notepaper and stuck it in my wallet, many years ago. I've been carrying it around since then. It needs to be published - and now it is.

 And here's the original, for those of you who want to see it.



© 2017 R. Ray Depew. You can use these points to give an inspirational speech or write something, as long as you remember to give me credit for them. Always list your sources!

Tuesday, February 21, 2017

What do you call a Mormon bishop when he's no longer a bishop?



This question came up with some of my Young Single Adults last week: "What do you call a Mormon bishop when he's no longer a bishop?"

Consider my 7th-grade math students, who went from calling me "Mr. Depew" as their teacher, to "Brother Depew" as a member of the stake high council, to "Bishop Depew" as their bishop. What will they revert to?

Some of my YSAs have said that they'll never stop calling me "Bishop." My heart gets all warm and squishy and full when I hear that.

Some of them are already calling me "Papa Pew." We have little Temperance Mae Call to thank for that. Tempe gets my heart all warm and squishy, too.

A small handful have always called me "Ray" and will never stop. They make my heart happy.

Here's the official word. I found this in the results of a Google search for "what do you call a Mormon bishop". It matches what I was taught as a young man. I haven't heard of any recent, official changes to this custom.



This is a little old, but in the April 1993 ENSIGN:
"The titles Bishop and President (designating members of temple, mission,
 stake, and district presidencies and branch presidencies) are appropriate 
even after the leader has been released." 

For what it's worth, I may not be their bishop any more, but they will always be my kids.

Wednesday, January 4, 2017

Beware of PhotoKeeper


UPDATE, JULY 10, 2017: You will notice that one of the comments is from the developers of PhotoKeeper. They give a plausible explanation for the scamming/spamming behavior, and they ask us (you and me) to consider trying the app again.

And the PhotoKeeper entries at Google Play and the App Store have been VERY recently deleted and rewritten. All of the old reviews are GONE.

This review was written in January 2017. The developers submitted their comment on April 20, 2017. And yet, according to this webpage, as of May 23, 2017, PhotoKeeper was still spamming.

I'd like to hear some more comments from people who either tried the app, or received an email from PhotoKeeper, after April 20, 2017. Is it now well-behaved, or is it still spam?



UPDATE, JULY 12, 2017: I've been snooping around the Internet, and I've found plenty of reports that confirm that PhotoKeeper is still spamming people.


UPDATE, SEPTEMBER 27, 2017: PhotoKeeper disappeared from the App Store and was replaced by Photo Backup. This happened about two weeks ago. The text looks the same, and the creators are the original PhotoKeeper creators. Let's see if Photo Backup turns out to be spam as well.


  End of updates



Beware of the PhotoKeeper app!

You may get an email from a friend — or perhaps from an address you don't even recognize — that says:
"Hi Ray, you just got photos!
You were granted access to photos by @jjb4929 because you're in their network.
Click to see 24 photos on PhotoKeeper. "

So you click on the link.

If you're on a PC, you go to a page that says:  
"We’re still working on a web viewer — sorry for the inconvenience. Meanwhile, you can view photos in the FREE app :)
Send a link to my phone →"

That's bait and switch, kids. Don't fall for it.

But if you're on a phone, clicking on the link takes you directly to Google Play or the App Store, so you can download the App.

STOP! Don't do it! Read the reviews!

Once you install the app, it immediately harvests your contacts list and sends to them the same message that it sent to you, offering to share YOUR photos with all of your contacts - if THEY will install the app.

That's classic virus spam behavior. It's bad. You will be sorry.

PhotoKeeper advertises itself as a good way to keep track of all the photos you have tucked into various electronic places. Maybe it does that. It may even be good at it. But a photo-management app shouldn't need access to your Contacts, and it DEFINITELY shouldn't be sending unsolicited emails to your Contacts without your knowledge or permission.

IF YOU READ THE REVIEWS:

Until a few minutes ago, among the 100-plus reviews were 19 five-star reviews dated September 30, 2016 and October 10, 2016. These were all one-line reviews that said things like "Good game!" and "Fun to play!" One even said "Good strategy game!" It's not a game, and the reviews were spam: totally bogus reviews put up there by PhotoKeeper's makers to inflate their rating on Google Play. The two reviews posted on October 11 also look bogus.

Some of the later reviews praise the app's "editing tools." These reviews are also bogus. How do I know? BECAUSE THE APP DOESN'T HAVE ANY EDITING CAPABILITY.

THE BOTTOM LINE:

Think twice before you download PhotoKeeper. Maybe even think three times. There are other ways to manage your photos which don't involve surrendering control of your phone to a shady app backed by fake reviews.

p.s. I'm open-minded. I'm willing to be proven wrong about PhotoKeeper. I haven't installed it myself. After the research I conducted in order to write this blog entry, I chose not to.