The BRB of doom


#1

So I'm working on a Big Red Button project. I'm thinking that it ought to throw a Pause/Resume toggle for any print job in-progress.

Philmore UPC 038975307817 Push Button (Red) Game Switch SPDT

brb

For whatever OCD-related reasons I may have had, I designed the printed part to be just bigger than the switch itself, creating an hour-long activity of trying to reassemble everything inside.

My original thought was that it needs to be connected via a pair of JST connectors to the Raspi's GPIO pins. But now that I see it sitting here, it's telling me that it wants to be wireless.

Okay, so there's some space still inside there but it's not enough for a Pi Zero. There's enough room for a battery. What am I looking for? Is it a Tinyduino, a Feather, a Trinket...? Can I do remote GPIO from Arduino to Raspi? Has anyone used any of these boards yet? The last time I worked with a PCArduino I ditched the project because Node wouldn't work on it. :angry:

Is there a Bluetooth-only kind of solution?


Tedder's pi printer hat, v6.1.1 working
#2

ESP8266 is a super cheap and widely used solution for adding WiFi to stuff like this. It'd be simple for it to shoot out a REST call to something on your Pi (or MQTT or whatever).

If Bluetooth would suit you better, ESP32 can do WiFi+BT.


#3

Thinking more about this - If you've used Arduino in the past you'll find ESP8266 Arduino to be super simple to use. Find a WeMos D1 Mini clone somewhere nearby (available from :cn: for about two fiddy) and it will have everything you need one one board. Set up Arduino IDE for ESP8266 then a simple sketch can call OctoPrint's REST API.

I had a bunch of links to examples in this post but the forum won't let me add any more so... feel free to ask if you'd like more guidance on this. The ESP8266 platform is perfect for this sort of use case and I have them all over my house doing simple tasks.


#4

Alright, I think I'll go the more expensive Adafruit route but basically work from this platform. Guess I'll need a battery and a microUSB receptacle. Not entirely sure what I'm doing with this one. Do you have any information on a battery setup that allows the external USB connection to power the battery?


#5

Just quickly chiming in to second the ESP - easy to program, very versatile and ridiculously cheap.


#6

So in regards to battery - what is the use case? The ESP8266 isn't super about low power without some extra steps taken. Do you want the device to be entirely cordless? You can do that by having the button trigger an interrupt which will bring the ESP out of deep sleep, but you'll also need to source a battery management solution which could be as simple as a USB battery bank. There are ESP32 options which offer both deep sleep and integrated battery charge management that may be suitable as well. Check out Andreas Spiess' work on those devices for more detail.

The device you've chosen doesn't have built-in USB (which is the specific reason I suggested the WeMos), so now you have another problem - you're going to need a way to program and power this thing. The Adafruit link there should help you select some solutions for that.

edit: One more thing - I found this project which looks like it might work for your use case. The code and explanation will probably help you out. If you have any more questions I might need to PM you because apparently I can't post more than twice in a topic.


#7

Yeah, I think that would do it. And yes, I understand the programming/cable requirements on the Adafruit version.


#8

Did you already buy that thing ?

They carry that stuff in Frye's ?

I'm jealous !

I ordered a handful of ESP's yesterday, and I have to WAIT for them to come in the mail


#9

Unfortunately Fry's doesn't have those but Adafruit has goodies that I need. I've been storing up a number of things I'll get from them (to include another Zero).


#10

In regards to the slow boat from China I take the Mitch Hedberg baked potato approach - order a handful today, because by the time they get here who knows what use case you'll have thought of :smiley: Monday I wanted to setup my sprinkler system to not turn on when it's raining, and 15 minutes later I had an ESP8266 and relay hooked up to my sprinkler controller which would stop it from running if the forecast called for 50% chance of rain. Today it's been raining and my sprinklers didn't kick on. It's these sorts of ad-hoc simple use cases that make cheap WiFi micros so stinkin handy!


#11

Over the past year I've been working on an ESP8266-based project for home automation control which I call the HA SwitchPlate: http://haswitchplate.com

The device can display any information my home automation system (Home Assistant) knows about. Because Home Assistant supports OctoPrint, I now have the ability to monitor print progress and temperatures from any room in the house. The display looks like this:

All powered by a $2.50 microcontroller!


#12

That is awesomeness. If I weren't in an apartment, I'd so do that. And yet, I'm so going to do that and just save them because they're awesome.


#13

I can see displaying the SDGE cost-per-kilowatt data on one of these and perhaps a histogram of the $/kw for the last 24 hours.


#14

It can do all sorts of stuff! Scene controller, light dimmers, weather display, alarm system controller, sprinkler zone controller, media player controls, basically anything that Home Assistant can talk to (and that's a ridiculously large list) can be setup for interaction on a touchscreen that mounts in existing wall boxes. The project is little more than the touchscreen, an ESP8266, a power supply, and a box to stick it all in.

There's loads of simple stuff you can get done with these things. A really nice Youtuber made a video about another quick project I made, this one almost embarrassingly simple but damn handy: https://www.youtube.com/watch?v=1DyblwsjfU8 If you have your garage door opener connected to your HA system, this project will open/close your garage door for you as you come and go. GitHub: https://github.com/aderusha/MQTTCarPresence


#15

I'm thinking in terms of being able to adjust the power-cost threshold for lights, say. I could program in that I want the light to shut off if the cost for a k-h goes above whatever. (Power prices in San Diego skyrocket during the summertime and especially during certain hours.)

Similarly, you could toggle on/off the power for charging circuits to take advantage of cheaper cost at night for power.


#16

grumble grumble Enron. That's when I lived in SD last.

(I miss 91X)


#17

It was like $45/month two months ago, then without doing anything different it shot of up $100+ last month.


#18

I live in the PNW now, home of surplus electricity since WW2.


#19

You gotta love stackoverflow. One person answers the question and fifteen others ignore the answer and answer it in essentially the same way. :laugh:

Color me jealous, though. My mining rig would be bigger in that case.


#20

Alright, I bought the ESP from Adafruit along with the serial cable and lots of little friends who wanted to jump in the same box.

I really don't get why a 3V battery can't be shipped via USPS. For realz?