I wondered: “Is it even possible to do this many things with one microcontroller?”

This time, the advice in this thread didn’t help. I’m still not sure if what I needed could have ever worked, since it requires one humble WeMos D1 ESP8266 microcontroller to send a request to one URL: Integromat’s Web hooks and then receive commands via Blynk.io — which doesn’t seem to love playing with others. It just logs on and waits to be triggered.

Two IoT Heads Are Better Than One

Took me months to realize the answer was a second microcontroller. Just like Carly Rae Jepsen’s “Call Me Maybe”, this would create a call and response relationship between the microcontrollers. The button would tell Integromat to start its scenario using the webhook and the WeMos D1 could just stand by and wait for Blynk.io to tell it what to do. Plus, doing it this way would have to be easier, right? No.

Why the NodeMCU ESP8266?

The NodeMCU has WiFi built in, is itty-bitty small and can be had for around three dollars. To sweeten the deal, I had one lying around already that I’d been intimidated by, compared to the friendly Arduino Uno. That’s why, the WeMos D1 is the perfect Arduino to ESP8266 gateway board, luring in Arduino newbies with its Uno-like good looks and approachability. I was now ready to try the NodeMCU!

Again, this was freakishly hard considering I was just trying to make my own Amazon Tab button. Nothing at all unique. Articles like this one — in credible publications like Make Use Of — made me think this wouldn’t be hard. Lies!

The following article and ones like it are wrong and outdated: How to Make Your Own Wi-Fi Connected Button With ESP8266 This article tells you to just go get the IFTTT library and you’re good to go! There is no more IFTTT Arduino library. It was deprecated years ago. Again, I’d have to do this the hard way.

[I was going to make this paragraph profanity-filled, but keeping this post family friendly]

Getting the NodeMCU onto WiFi wasn’t hard, once figuring out the same board-connection and pinout challenges I talk about above. But then…

HTTP vs. HTTPS, 301 Errors, SSL and SHA1 Fingerprints

When trying to connect to Integromat webhooks I kept getting an error 301 in the Serial Monitor. Again, the community answer to what is an Arduino 301 error didn’t help. This is when I discovered postman-echo.com which is helpful for troubleshooting HTTP calls and other API things. When I used it to make the call to HTTPS instead of HTTP, I got the response I wanted: triggering Integromat. I understood that the HTTP approach I used with Blynk and IFTTT (my only Arduino to cloud experience) wasn’t going to work for Integromat. HTTPS / SSL on the NodeMCU was hard to figure out. Some articles said I would need to reflash the board with new firmware using Esptool or the NodeMCU firmware builder for this work, but that was wrong. Others had deceptively hopeful names like Doing SSL Requests on ESP8266 Correctly and still left me lost.

The most useful article about making HTTPS GET and PUT requests with an NodeMCU ESP8266 is this one from Circuits4you.com:

ESP8266 NodeMCU HTTPS Secured GET Request | Circuits4you.com

It didn’t work right out of the box, (nothing seems to), but It helped me realize that I didn’t need to flash firmware or get a fancier board than the NodeMCU. This was at least possible. And it’s the only article I’ve seen talking about the SHA1 fingerprint to do SSL on Arduino compatible boards and it even shows you how to obtain the SHA1 fingerprint.

Once I got the SHA1 fingerprint for Integromat and added some of the other elements in the Circuits4you example, I could do the HTTPS calls. This took a lot of trial and error so please check out my code closely. For example, you’ll need to use Port 443 and add a library for base64 which the above example doesn’t have.

And another fun fact about SHA1 fingerprints: they change and need updating.

I found this out while getting the Machine ready to photograph for this Medium post, long after I thought I was done messing with the code. The Machine stopped working while I’d been busy writing this never-ending novella. I had to troubleshoot back to authentication to realize the fingerprint had changed when I repeated the process above.

I now realize that the Machine has so many dependencies, it will always be a never-ending story.