Are you over 18 and want to see adult content?
More Annotations
A complete backup of visualtelas.com.br
Are you over 18 and want to see adult content?
A complete backup of weathercharts.org
Are you over 18 and want to see adult content?
A complete backup of biz-rusmarket.ru
Are you over 18 and want to see adult content?
Favourite Annotations
A complete backup of news.now.com/home/local/player?newsId=382193
Are you over 18 and want to see adult content?
A complete backup of malayalam.samayam.com/malayalam-cinema/movie-review/tovino-thomas-mamta-mohandas-reba-monica-john-starrer-f
Are you over 18 and want to see adult content?
A complete backup of www.firstpost.com/entertainment/hit-movie-review-vishwak-sen-stands-out-in-an-engaging-suspense-thriller-sa
Are you over 18 and want to see adult content?
Text
PAINFULLY OBVIOUS
Monitoring it all the way to the Done state is possible, albeit a bit boring. Leave the command running in the background while you do other things. When you hear the cycle finish, verify that the state changed to 3 (Maybe Done). After about five minutes, it should change to 4 (Done) and then straight back to 0 (Idle). PAINFULLY OBVIOUS → POLITICS They’ll think somehow that that will resonate with voters, that 20 years ago Christine O’Donnell on MTV said ‘Masturbation is a sin.’. And they’ll play it, and they’ll ridicule it, and the voters will be like, ‘Yeah, I don’t have a job.’. That’s how they’ll blow it. It’s like Patrick Henry famously said, “Isupport the
PAINFULLY OBVIOUS → TUMBLES In the playoffs, every story line is ex post facto, with the process graded after the fact by whatever the outcome was.You know the stories. A team with a first‐round bye is refreshed and full of energy if they blow out their opponents (often as big favorites at home), but rusty and lost their timing if they lose to their opponents, who don’t have anybody believing in them but themselves. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 2: THE CONTROL PANELSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 4: A CRASH COURSESEE MOREON ANDREWDUPONT.NET
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 1: THE CABINETSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → TUMBLES The best way to think about the old NFL collective bargaining agreement is as a beautiful magic cloak. It allowed the owners a kind of charmed invisibility when it came to collusion, to artificially controlling competition, to inhibiting player movement, to making their costs certain, and generally suppressing every free marketprinciple.
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 6: ADDING A A rotary encoder without a knob. (Artist’s rendering.) The volume knob has been around forever. For instance, if you’re old enough to want to build an arcade cabinet, you probably remember your grandparents’ TV and how it didn’t have a remote, which meant you had to twist a knob on the set itself to control the volume. Simplertimes.
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 11: NOT Nostalgia-Tron, Part 11: Not electrocuting yourself. A while back you might remember that I was about to tell you how to synchronize the on/off states of your Pi, your monitor, and your marquee light. It involved an Arduino wired to two relay modules, which themselves were wired to an outlet of my own construction. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 10: METADATA If you add some games to your ROM s folder, they won’t show up in your gamelist.xml until you (re)launch EmulationStation, at which point ES will notice the new files and create barebones metadata entries for them. This script automatically backs up your gamelist.xml to a unique filename each time it’s run.PAINFULLY OBVIOUS
Monitoring it all the way to the Done state is possible, albeit a bit boring. Leave the command running in the background while you do other things. When you hear the cycle finish, verify that the state changed to 3 (Maybe Done). After about five minutes, it should change to 4 (Done) and then straight back to 0 (Idle). PAINFULLY OBVIOUS → POLITICS They’ll think somehow that that will resonate with voters, that 20 years ago Christine O’Donnell on MTV said ‘Masturbation is a sin.’. And they’ll play it, and they’ll ridicule it, and the voters will be like, ‘Yeah, I don’t have a job.’. That’s how they’ll blow it. It’s like Patrick Henry famously said, “Isupport the
PAINFULLY OBVIOUS → TUMBLES In the playoffs, every story line is ex post facto, with the process graded after the fact by whatever the outcome was.You know the stories. A team with a first‐round bye is refreshed and full of energy if they blow out their opponents (often as big favorites at home), but rusty and lost their timing if they lose to their opponents, who don’t have anybody believing in them but themselves. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 2: THE CONTROL PANELSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 4: A CRASH COURSESEE MOREON ANDREWDUPONT.NET
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 1: THE CABINETSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → TUMBLES The best way to think about the old NFL collective bargaining agreement is as a beautiful magic cloak. It allowed the owners a kind of charmed invisibility when it came to collusion, to artificially controlling competition, to inhibiting player movement, to making their costs certain, and generally suppressing every free marketprinciple.
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 6: ADDING A A rotary encoder without a knob. (Artist’s rendering.) The volume knob has been around forever. For instance, if you’re old enough to want to build an arcade cabinet, you probably remember your grandparents’ TV and how it didn’t have a remote, which meant you had to twist a knob on the set itself to control the volume. Simplertimes.
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 11: NOT Nostalgia-Tron, Part 11: Not electrocuting yourself. A while back you might remember that I was about to tell you how to synchronize the on/off states of your Pi, your monitor, and your marquee light. It involved an Arduino wired to two relay modules, which themselves were wired to an outlet of my own construction. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 10: METADATA If you add some games to your ROM s folder, they won’t show up in your gamelist.xml until you (re)launch EmulationStation, at which point ES will notice the new files and create barebones metadata entries for them. This script automatically backs up your gamelist.xml to a unique filename each time it’s run. PAINFULLY OBVIOUS → POLITICS The Act does not compel physicians to apprise women of the risks inherent in abortion, inform the women of available alternatives, and facilitate access to additional information if the women wish to review it before making their decisions; existing Texas law already compels such speech by physicians Instead, the Act compels physicians to advance an ideological agenda with which they may PAINFULLY OBVIOUS → MOVIES This poor man has been shot and will die late at night inside the Louvre; his wounds, although mortal, fortunately leave him time enough to conceal a safe deposit key, strip himself, cover his body with symbols written in his own blood, arrange his body in a pose and within a design by Da Vinci, and write out, also in blood, an encrypted message, a scrambled numerical sequence and a footnote PAINFULLY OBVIOUS → TUMBLES In the playoffs, every story line is ex post facto, with the process graded after the fact by whatever the outcome was.You know the stories. A team with a first‐round bye is refreshed and full of energy if they blow out their opponents (often as big favorites at home), but rusty and lost their timing if they lose to their opponents, who don’t have anybody believing in them but themselves. PAINFULLY OBVIOUS → SXSW If you’re like me and your MacBook Pro keeps waking up inside your laptop bag (draining your precious battery life), you can force it into “safe sleep” (hibernation) instead by running sudo pmset -a hibernatemode 1 from the terminal. It takes a bit longer to go to sleep, but it also prevents these accidental awakenings, since you have to hold down the power key for a second or two to PAINFULLY OBVIOUS → LAUNDRY SPY, PART 4: THE FINALE In this article — the finale to the series, I promise — you’ll actually install your laundry spy and calibrate it to your particular washer and dryer. Once you’ve got them working reliably, I’ll show you a few ESP8266 libraries that you can drop into this sketch (or others) if you crave more features. PAINFULLY OBVIOUS → POST SERIES → LAUNDRY SPY Laundry Spy, Part 4: The finale. In this article — the finale to the series, I promise — you’ll actually install your laundry spy and calibrate it to your particular washer and dryer. Once you’ve got them working reliably, I’ll show you a few ESP8266 libraries that you can drop into this sketch (or others) if you crave more features. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 7: LED CONTROL Assuming all your LED s are on, run pacdrive -f; if everything is working properly, all your LED s should go off. Running pacdrive -a should turn them all back on. You can pick out individual LED s to turn on or off, like so: # turn everything off, then turn on LEDs 1 and 12 pacdrive -f -l1 1 -l12 1. PAINFULLY OBVIOUS → LAUNDRY SPY, PART 3: THE SOFTWARE Contrasting an idle machine with one in the middle of a cycle. Theoretically. Suppose this is a graph of vibration scores over time. The red line is how I imagine the vibration score of an idle washing machine: nearly zero, with occasional spikes that are caused by redherrings.
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 9: A UTILITY Nostalgia-Tron, Part 9: A utility script for testing controls. For the moment I’m out of hardware topics, so let’s look at some stuff that might be more widely applicable to folks who don’t make my exact hardware choices. In a minute I’ll show you a script I wrotefor testing input.
PAINFULLY OBVIOUS → JAVASCRIPT “ASSOCIATIVE ARRAYS I hesitate to add to the proliferation of “considered harmful” essays, but this is an important point, and it needs a URL, if only to cut down on the amount of typing I have to do.. The Problem. Try the following code on an empty page, one without any JavaScript libraries added: var associative_array = new Array (); associative_array = "Lorem"; associative_array = "IpsumPAINFULLY OBVIOUS
Monitoring it all the way to the Done state is possible, albeit a bit boring. Leave the command running in the background while you do other things. When you hear the cycle finish, verify that the state changed to 3 (Maybe Done). After about five minutes, it should change to 4 (Done) and then straight back to 0 (Idle). PAINFULLY OBVIOUS → POLITICS They’ll think somehow that that will resonate with voters, that 20 years ago Christine O’Donnell on MTV said ‘Masturbation is a sin.’. And they’ll play it, and they’ll ridicule it, and the voters will be like, ‘Yeah, I don’t have a job.’. That’s how they’ll blow it. It’s like Patrick Henry famously said, “Isupport the
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 2: THE CONTROL PANELSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 4: A CRASH COURSESEE MOREON ANDREWDUPONT.NET
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 1: THE CABINETSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → POST SERIES → LAUNDRY SPY Laundry Spy, Part 4: The finale. In this article — the finale to the series, I promise — you’ll actually install your laundry spy and calibrate it to your particular washer and dryer. Once you’ve got them working reliably, I’ll show you a few ESP8266 libraries that you can drop into this sketch (or others) if you crave more features. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 8: OVERSEE MORE ONANDREWDUPONT.NET
PAINFULLY OBVIOUS → LAUNDRY SPY, PART 1: THE HARDWARE Laundry Spy, Part 1: The hardware. My washer and dryer are two appliances that I’ve wanted to make “smart” for a long time, or at least smart enough to balance out how dumb I am about remembering to empty them when loads are finished. On several occasions, wet clothing has lingered in my washing machine for days. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 10: METADATA If you add some games to your ROM s folder, they won’t show up in your gamelist.xml until you (re)launch EmulationStation, at which point ES will notice the new files and create barebones metadata entries for them. This script automatically backs up your gamelist.xml to a unique filename each time it’s run. PAINFULLY OBVIOUS → LAUNDRY SPY, PART 3: THE SOFTWARE Contrasting an idle machine with one in the middle of a cycle. Theoretically. Suppose this is a graph of vibration scores over time. The red line is how I imagine the vibration score of an idle washing machine: nearly zero, with occasional spikes that are caused by redherrings.
PAINFULLY OBVIOUS
Monitoring it all the way to the Done state is possible, albeit a bit boring. Leave the command running in the background while you do other things. When you hear the cycle finish, verify that the state changed to 3 (Maybe Done). After about five minutes, it should change to 4 (Done) and then straight back to 0 (Idle). PAINFULLY OBVIOUS → POLITICS They’ll think somehow that that will resonate with voters, that 20 years ago Christine O’Donnell on MTV said ‘Masturbation is a sin.’. And they’ll play it, and they’ll ridicule it, and the voters will be like, ‘Yeah, I don’t have a job.’. That’s how they’ll blow it. It’s like Patrick Henry famously said, “Isupport the
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 2: THE CONTROL PANELSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 4: A CRASH COURSESEE MOREON ANDREWDUPONT.NET
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 1: THE CABINETSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → POST SERIES → LAUNDRY SPY Laundry Spy, Part 4: The finale. In this article — the finale to the series, I promise — you’ll actually install your laundry spy and calibrate it to your particular washer and dryer. Once you’ve got them working reliably, I’ll show you a few ESP8266 libraries that you can drop into this sketch (or others) if you crave more features. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 8: OVERSEE MORE ONANDREWDUPONT.NET
PAINFULLY OBVIOUS → LAUNDRY SPY, PART 1: THE HARDWARE Laundry Spy, Part 1: The hardware. My washer and dryer are two appliances that I’ve wanted to make “smart” for a long time, or at least smart enough to balance out how dumb I am about remembering to empty them when loads are finished. On several occasions, wet clothing has lingered in my washing machine for days. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 10: METADATA If you add some games to your ROM s folder, they won’t show up in your gamelist.xml until you (re)launch EmulationStation, at which point ES will notice the new files and create barebones metadata entries for them. This script automatically backs up your gamelist.xml to a unique filename each time it’s run. PAINFULLY OBVIOUS → LAUNDRY SPY, PART 3: THE SOFTWARE Contrasting an idle machine with one in the middle of a cycle. Theoretically. Suppose this is a graph of vibration scores over time. The red line is how I imagine the vibration score of an idle washing machine: nearly zero, with occasional spikes that are caused by redherrings.
PAINFULLY OBVIOUS → POLITICS The Act does not compel physicians to apprise women of the risks inherent in abortion, inform the women of available alternatives, and facilitate access to additional information if the women wish to review it before making their decisions; existing Texas law already compels such speech by physicians Instead, the Act compels physicians to advance an ideological agenda with which they may PAINFULLY OBVIOUS → TUTORIALS It’s time to write the firmware for the hardware we made in Part 1. It’ll turn the raw acceleration data into determinations about when our machines are running and report its findings over MQTT to our homeautomation server.
NOSTALGIA-TRON GAMES LIST Metal Slug 5 is a run-and-gun arcade game for the Neo-Geo console/arcade platform created by SNK Playmore. It was released in 2003 for the MVS arcade platform, is the fifth game in the Metal Slug series, and was one of the last games for the Neo Geo system. PAINFULLY OBVIOUS → TUMBLES In the playoffs, every story line is ex post facto, with the process graded after the fact by whatever the outcome was.You know the stories. A team with a first‐round bye is refreshed and full of energy if they blow out their opponents (often as big favorites at home), but rusty and lost their timing if they lose to their opponents, who don’t have anybody believing in them but themselves. PAINFULLY OBVIOUS → LAUNDRY SPY, PART 2: THE INFRASTRUCTURE Laundry Spy, Part 2: The infrastructure. When we left off, we had built a weird two‐tentacled sea creature without a brain. Despite my hasty promise at the end of Part 1, I’m not going to give it a brain just yet, because I can always turn a two‐part series into a four‐part series merely by overthinking it. To refresh your memory:the
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 7: LED CONTROL Man, has this series been neglected! I was going to tell you folks how I synchronized the power states of my Pi, marquee light, and monitor with an Arduino, but it turns out it’s hard to write Arduino tutorials when you’re only barely certain of what you’re doing, electronics‐wise, and at the back of your mind the whole time is a creeping suspicion that your instructions are going to PAINFULLY OBVIOUS → LAUNDRY SPY, PART 4: THE FINALE In this article — the finale to the series, I promise — you’ll actually install your laundry spy and calibrate it to your particular washer and dryer. Once you’ve got them working reliably, I’ll show you a few ESP8266 libraries that you can drop into this sketch (or others) if you crave more features. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 5: A PROPER POWER Mounted (superglued) to the back corner. Using a Forstner bit, I drilled a hole on the back of my cabinet in the rear left corner. The button fit into this hole, but the MDF was just barely too thick to allow me to screw on the securing ring from the inside. The way I’d placed the hole didn’t give me many options for workarounds, so I ended up just affixing the button with superglue. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 9: A UTILITY Nostalgia-Tron, Part 9: A utility script for testing controls. For the moment I’m out of hardware topics, so let’s look at some stuff that might be more widely applicable to folks who don’t make my exact hardware choices. In a minute I’ll show you a script I wrotefor testing input.
PAINFULLY OBVIOUS → JAVASCRIPT “ASSOCIATIVE ARRAYS I hesitate to add to the proliferation of “considered harmful” essays, but this is an important point, and it needs a URL, if only to cut down on the amount of typing I have to do.. The Problem. Try the following code on an empty page, one without any JavaScript libraries added: var associative_array = new Array (); associative_array = "Lorem"; associative_array = "IpsumPAINFULLY OBVIOUS
Monitoring it all the way to the Done state is possible, albeit a bit boring. Leave the command running in the background while you do other things. When you hear the cycle finish, verify that the state changed to 3 (Maybe Done). After about five minutes, it should change to 4 (Done) and then straight back to 0 (Idle). PAINFULLY OBVIOUS → POLITICS They’ll think somehow that that will resonate with voters, that 20 years ago Christine O’Donnell on MTV said ‘Masturbation is a sin.’. And they’ll play it, and they’ll ridicule it, and the voters will be like, ‘Yeah, I don’t have a job.’. That’s how they’ll blow it. It’s like Patrick Henry famously said, “Isupport the
PAINFULLY OBVIOUS → TUMBLES In the playoffs, every story line is ex post facto, with the process graded after the fact by whatever the outcome was.You know the stories. A team with a first‐round bye is refreshed and full of energy if they blow out their opponents (often as big favorites at home), but rusty and lost their timing if they lose to their opponents, who don’t have anybody believing in them but themselves. PAINFULLY OBVIOUS → POST SERIES → LAUNDRY SPY Laundry Spy, Part 4: The finale. In this article — the finale to the series, I promise — you’ll actually install your laundry spy and calibrate it to your particular washer and dryer. Once you’ve got them working reliably, I’ll show you a few ESP8266 libraries that you can drop into this sketch (or others) if you crave more features. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 4: A CRASH COURSESEE MOREON ANDREWDUPONT.NET
PAINFULLY OBVIOUS → LAUNDRY SPY, PART 1: THE HARDWARE Laundry Spy, Part 1: The hardware. My washer and dryer are two appliances that I’ve wanted to make “smart” for a long time, or at least smart enough to balance out how dumb I am about remembering to empty them when loads are finished. On several occasions, wet clothing has lingered in my washing machine for days. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 1: THE CABINETSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → TUMBLES The best way to think about the old NFL collective bargaining agreement is as a beautiful magic cloak. It allowed the owners a kind of charmed invisibility when it came to collusion, to artificially controlling competition, to inhibiting player movement, to making their costs certain, and generally suppressing every free marketprinciple.
PAINFULLY OBVIOUS → LAUNDRY SPY, PART 4: THE FINALESEE MORE ONANDREWDUPONT.NET
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 6: ADDING AARCADE1UP RETROPIE VOLUME SWITCHNO VOLUME RASPBERRY PIRASPBERRY PI SET VOLUMERASPBERRY PI VOLUME CONTROL KNOB The volume knob is a rotary encoder. It turns infinitely in either direction. Turning it to the right will increase the volume; turning it to the left will decrease the volume. The knob can also be pressed like a button in order to turn muting on or off.PAINFULLY OBVIOUS
Monitoring it all the way to the Done state is possible, albeit a bit boring. Leave the command running in the background while you do other things. When you hear the cycle finish, verify that the state changed to 3 (Maybe Done). After about five minutes, it should change to 4 (Done) and then straight back to 0 (Idle). PAINFULLY OBVIOUS → POLITICS They’ll think somehow that that will resonate with voters, that 20 years ago Christine O’Donnell on MTV said ‘Masturbation is a sin.’. And they’ll play it, and they’ll ridicule it, and the voters will be like, ‘Yeah, I don’t have a job.’. That’s how they’ll blow it. It’s like Patrick Henry famously said, “Isupport the
PAINFULLY OBVIOUS → TUMBLES In the playoffs, every story line is ex post facto, with the process graded after the fact by whatever the outcome was.You know the stories. A team with a first‐round bye is refreshed and full of energy if they blow out their opponents (often as big favorites at home), but rusty and lost their timing if they lose to their opponents, who don’t have anybody believing in them but themselves. PAINFULLY OBVIOUS → POST SERIES → LAUNDRY SPY Laundry Spy, Part 4: The finale. In this article — the finale to the series, I promise — you’ll actually install your laundry spy and calibrate it to your particular washer and dryer. Once you’ve got them working reliably, I’ll show you a few ESP8266 libraries that you can drop into this sketch (or others) if you crave more features. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 4: A CRASH COURSESEE MOREON ANDREWDUPONT.NET
PAINFULLY OBVIOUS → LAUNDRY SPY, PART 1: THE HARDWARE Laundry Spy, Part 1: The hardware. My washer and dryer are two appliances that I’ve wanted to make “smart” for a long time, or at least smart enough to balance out how dumb I am about remembering to empty them when loads are finished. On several occasions, wet clothing has lingered in my washing machine for days. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 1: THE CABINETSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → TUMBLES The best way to think about the old NFL collective bargaining agreement is as a beautiful magic cloak. It allowed the owners a kind of charmed invisibility when it came to collusion, to artificially controlling competition, to inhibiting player movement, to making their costs certain, and generally suppressing every free marketprinciple.
PAINFULLY OBVIOUS → LAUNDRY SPY, PART 4: THE FINALESEE MORE ONANDREWDUPONT.NET
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 6: ADDING AARCADE1UP RETROPIE VOLUME SWITCHNO VOLUME RASPBERRY PIRASPBERRY PI SET VOLUMERASPBERRY PI VOLUME CONTROL KNOB The volume knob is a rotary encoder. It turns infinitely in either direction. Turning it to the right will increase the volume; turning it to the left will decrease the volume. The knob can also be pressed like a button in order to turn muting on or off. PAINFULLY OBVIOUS → ABOUT ME Who are you? My name is Andrew Dupont.I’m a web developer. I’ve been writing JavaScript for more than a decade, but I still have to look up the argument order for .slice every time I use it. I live in Pasadena, California, but I travel as much as I am able. PAINFULLY OBVIOUS → TUTORIALS It’s time to write the firmware for the hardware we made in Part 1. It’ll turn the raw acceleration data into determinations about when our machines are running and report its findings over MQTT to our homeautomation server.
PAINFULLY OBVIOUS → SPORTS The best way to think about the old NFL collective bargaining agreement is as a beautiful magic cloak. It allowed the owners a kind of charmed invisibility when it came to collusion, to artificially controlling competition, to inhibiting player movement, to making their costs certain, and generally suppressing every free marketprinciple.
PAINFULLY OBVIOUS → VIDEO GAMES To express my feelings for Assassin’s Creed: Brotherhood, I had to track down a sentence Roger Ebert wrote: “Learning the difference between good movies and skillful ones is an early step in becoming a moviegoer.” In the last few years, I’ve started to notice the “skillful video game” trend: a game that’s got all the polish in the world but isn’t any fun to play. PAINFULLY OBVIOUS → THOUGHTS I understand that nothing gets people yelling at each other like a meaty discussion on accessibility, but I’m not getting why the idea of making alt optional on img tags in HTML5 is causing such a furor. The alt attribute is the lowest of the low‐hanging accessibility fruit, and the number of people on earth who care about valid HTML — but don’t care even a little about accessibility PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 1: THE CABINET Nostalgia-Tron, Part 1: The cabinet. A surefire marker of middle age for geeks of my cohort is building an arcade cabinet and letting it gather dust. The point isn’t that you get to play old arcade games; you could have played them already on your computer. The point is tobuild it.
PAINFULLY OBVIOUS → CONVERSATIONS At the beginning of an episode of X-Play on G4TV.. Adam Sessler Hey there, and welcome to X‐Play: a vain attempt to hold the attention of men 18–34. Morgan Webb PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 8: OVER It will have become clear to most readers that I swung for the fences on this project. The two ServoStiks I purchased prove the point: they can switch between 4-way control and 8-way control. Did I need this? No. Was I going to take advantage of it once I bought them? Of course. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 3: HARDWARE Channeling the front cover of an Atari 2600 game. Arcade enthusiasts, I’ve discovered, will have arguments about nearly anything — bat‐top versus ball‐top joystick, which kind of microswitch has the best feel, whether using anything other than a CRT monitor is a sacrilege. But everyone seems to agree that GameOnGrafix is where you get your marquee printed. PAINFULLY OBVIOUS → JAVASCRIPT TOOLS TEXTMATE BUNDLE The centerpiece of the bundle is its integration with JavaScript Lint, Matthias Miller’s excellent tool for finding errors and other dumb things in your JavaScript files. The bundle will run jsl on the frontmost file and present the results all pretty‐like in an HTML window. Linting results. Clicking on a line number will bring yourPAINFULLY OBVIOUS
Monitoring it all the way to the Done state is possible, albeit a bit boring. Leave the command running in the background while you do other things. When you hear the cycle finish, verify that the state changed to 3 (Maybe Done). After about five minutes, it should change to 4 (Done) and then straight back to 0 (Idle). PAINFULLY OBVIOUS → POLITICS They’ll think somehow that that will resonate with voters, that 20 years ago Christine O’Donnell on MTV said ‘Masturbation is a sin.’. And they’ll play it, and they’ll ridicule it, and the voters will be like, ‘Yeah, I don’t have a job.’. That’s how they’ll blow it. It’s like Patrick Henry famously said, “Isupport the
PAINFULLY OBVIOUS → TUMBLES In the playoffs, every story line is ex post facto, with the process graded after the fact by whatever the outcome was.You know the stories. A team with a first‐round bye is refreshed and full of energy if they blow out their opponents (often as big favorites at home), but rusty and lost their timing if they lose to their opponents, who don’t have anybody believing in them but themselves. PAINFULLY OBVIOUS → POST SERIES → LAUNDRY SPY Laundry Spy, Part 4: The finale. In this article — the finale to the series, I promise — you’ll actually install your laundry spy and calibrate it to your particular washer and dryer. Once you’ve got them working reliably, I’ll show you a few ESP8266 libraries that you can drop into this sketch (or others) if you crave more features. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 4: A CRASH COURSESEE MOREON ANDREWDUPONT.NET
PAINFULLY OBVIOUS → LAUNDRY SPY, PART 1: THE HARDWARE Laundry Spy, Part 1: The hardware. My washer and dryer are two appliances that I’ve wanted to make “smart” for a long time, or at least smart enough to balance out how dumb I am about remembering to empty them when loads are finished. On several occasions, wet clothing has lingered in my washing machine for days. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 1: THE CABINETSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → TUMBLES The best way to think about the old NFL collective bargaining agreement is as a beautiful magic cloak. It allowed the owners a kind of charmed invisibility when it came to collusion, to artificially controlling competition, to inhibiting player movement, to making their costs certain, and generally suppressing every free marketprinciple.
PAINFULLY OBVIOUS → LAUNDRY SPY, PART 4: THE FINALESEE MORE ONANDREWDUPONT.NET
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 6: ADDING AARCADE1UP RETROPIE VOLUME SWITCHNO VOLUME RASPBERRY PIRASPBERRY PI SET VOLUMERASPBERRY PI VOLUME CONTROL KNOB The volume knob is a rotary encoder. It turns infinitely in either direction. Turning it to the right will increase the volume; turning it to the left will decrease the volume. The knob can also be pressed like a button in order to turn muting on or off.PAINFULLY OBVIOUS
Monitoring it all the way to the Done state is possible, albeit a bit boring. Leave the command running in the background while you do other things. When you hear the cycle finish, verify that the state changed to 3 (Maybe Done). After about five minutes, it should change to 4 (Done) and then straight back to 0 (Idle). PAINFULLY OBVIOUS → POLITICS They’ll think somehow that that will resonate with voters, that 20 years ago Christine O’Donnell on MTV said ‘Masturbation is a sin.’. And they’ll play it, and they’ll ridicule it, and the voters will be like, ‘Yeah, I don’t have a job.’. That’s how they’ll blow it. It’s like Patrick Henry famously said, “Isupport the
PAINFULLY OBVIOUS → TUMBLES In the playoffs, every story line is ex post facto, with the process graded after the fact by whatever the outcome was.You know the stories. A team with a first‐round bye is refreshed and full of energy if they blow out their opponents (often as big favorites at home), but rusty and lost their timing if they lose to their opponents, who don’t have anybody believing in them but themselves. PAINFULLY OBVIOUS → POST SERIES → LAUNDRY SPY Laundry Spy, Part 4: The finale. In this article — the finale to the series, I promise — you’ll actually install your laundry spy and calibrate it to your particular washer and dryer. Once you’ve got them working reliably, I’ll show you a few ESP8266 libraries that you can drop into this sketch (or others) if you crave more features. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 4: A CRASH COURSESEE MOREON ANDREWDUPONT.NET
PAINFULLY OBVIOUS → LAUNDRY SPY, PART 1: THE HARDWARE Laundry Spy, Part 1: The hardware. My washer and dryer are two appliances that I’ve wanted to make “smart” for a long time, or at least smart enough to balance out how dumb I am about remembering to empty them when loads are finished. On several occasions, wet clothing has lingered in my washing machine for days. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 1: THE CABINETSEE MORENEW CONTENT WILL BE ADDED ABOVE THE CURRENT AREA OF FOCUS UPON SELECTIONSEE MORE ON ANDREWDUPONT.NET PAINFULLY OBVIOUS → TUMBLES The best way to think about the old NFL collective bargaining agreement is as a beautiful magic cloak. It allowed the owners a kind of charmed invisibility when it came to collusion, to artificially controlling competition, to inhibiting player movement, to making their costs certain, and generally suppressing every free marketprinciple.
PAINFULLY OBVIOUS → LAUNDRY SPY, PART 4: THE FINALESEE MORE ONANDREWDUPONT.NET
PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 6: ADDING AARCADE1UP RETROPIE VOLUME SWITCHNO VOLUME RASPBERRY PIRASPBERRY PI SET VOLUMERASPBERRY PI VOLUME CONTROL KNOB The volume knob is a rotary encoder. It turns infinitely in either direction. Turning it to the right will increase the volume; turning it to the left will decrease the volume. The knob can also be pressed like a button in order to turn muting on or off. PAINFULLY OBVIOUS → ABOUT ME Who are you? My name is Andrew Dupont.I’m a web developer. I’ve been writing JavaScript for more than a decade, but I still have to look up the argument order for .slice every time I use it. I live in Pasadena, California, but I travel as much as I am able. PAINFULLY OBVIOUS → TUTORIALS It’s time to write the firmware for the hardware we made in Part 1. It’ll turn the raw acceleration data into determinations about when our machines are running and report its findings over MQTT to our homeautomation server.
PAINFULLY OBVIOUS → SPORTS The best way to think about the old NFL collective bargaining agreement is as a beautiful magic cloak. It allowed the owners a kind of charmed invisibility when it came to collusion, to artificially controlling competition, to inhibiting player movement, to making their costs certain, and generally suppressing every free marketprinciple.
PAINFULLY OBVIOUS → VIDEO GAMES To express my feelings for Assassin’s Creed: Brotherhood, I had to track down a sentence Roger Ebert wrote: “Learning the difference between good movies and skillful ones is an early step in becoming a moviegoer.” In the last few years, I’ve started to notice the “skillful video game” trend: a game that’s got all the polish in the world but isn’t any fun to play. PAINFULLY OBVIOUS → THOUGHTS I understand that nothing gets people yelling at each other like a meaty discussion on accessibility, but I’m not getting why the idea of making alt optional on img tags in HTML5 is causing such a furor. The alt attribute is the lowest of the low‐hanging accessibility fruit, and the number of people on earth who care about valid HTML — but don’t care even a little about accessibility PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 1: THE CABINET Nostalgia-Tron, Part 1: The cabinet. A surefire marker of middle age for geeks of my cohort is building an arcade cabinet and letting it gather dust. The point isn’t that you get to play old arcade games; you could have played them already on your computer. The point is tobuild it.
PAINFULLY OBVIOUS → CONVERSATIONS At the beginning of an episode of X-Play on G4TV.. Adam Sessler Hey there, and welcome to X‐Play: a vain attempt to hold the attention of men 18–34. Morgan Webb PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 8: OVER It will have become clear to most readers that I swung for the fences on this project. The two ServoStiks I purchased prove the point: they can switch between 4-way control and 8-way control. Did I need this? No. Was I going to take advantage of it once I bought them? Of course. PAINFULLY OBVIOUS → NOSTALGIA-TRON, PART 3: HARDWARE Channeling the front cover of an Atari 2600 game. Arcade enthusiasts, I’ve discovered, will have arguments about nearly anything — bat‐top versus ball‐top joystick, which kind of microswitch has the best feel, whether using anything other than a CRT monitor is a sacrilege. But everyone seems to agree that GameOnGrafix is where you get your marquee printed. PAINFULLY OBVIOUS → JAVASCRIPT TOOLS TEXTMATE BUNDLE The centerpiece of the bundle is its integration with JavaScript Lint, Matthias Miller’s excellent tool for finding errors and other dumb things in your JavaScript files. The bundle will run jsl on the frontmost file and present the results all pretty‐like in an HTML window. Linting results. Clicking on a line number will bring yourPAINFULLY OBVIOUS.
Jump to menu ↓
article
7
LAUNDRY SPY, PART 4: THE FINALE May 8, 2018 • Posted in Articles, ESP8266
, Tutorials
I’m Andrew! You might remember me from Part 3 , in which I guided you up to the very _moment_ that your firmware started running on your laundry spy — and then vanished without further explanation. In this article — the finale to the series, I promise — you’ll actually install your laundry spy and calibrate it to your particular washer and dryer. Once you’ve got them working reliably, I’ll show you a few ESP8266 libraries that you can drop into this sketch (or others) if you crave more features.INSTALLING THE SPY
We haven’t actually installed the hardware near your washer and dryer yet because it’s not much fun to write code while sitting in your laundry room. It’s loud and stuffy and the ergonomics are all wrong. But now that we’ve demonstrated that the sketch is working well enough to measure vibration, it’s time to subject the spy to some real‐world data. Any mounting option works as long as the sensor umbilicals aren’tunder any strain.
The ideal place to install your laundry spy is on the wall behind your washer and dryer at an equal distance from both. I tend to use velcrotape
for applications like these where I might need to detach the thinglater.
If you’d rather not attach anything to your walls — godspeed to the fellow renters out there trying to make their homes smarter in non‐destructive fashion — then you can mount the head unit on one of your actual machines. If you use a magnet, make sure it’s a strong one; you don’t want the sensor to drift as the machine shakes. The two sensors themselves should be attached firmly to their machines, but it doesn’t really matter where. Put them wherever the tether will allow them to reach and where they won’t interfere with operation. I’ve got my sensors attached to the back corner of each machine nearest the spy itself. I mounted mine with foam mounting tape,
but VSB tape
would work just as well. Hell, based on my quick research,
you could even use a glued‐on magnet to keep the sensor case in place on the back of each machine. The spy will get power from the USB micro port we incorporated into the design. You’ve probably got an extra wall wart charger sitting in a drawer somewhere, and if you don’t, cheap ones are available all over the place. The maximum power draw of an ESP8266 is under the 500mA you’d get from a powered USB port on your computer, and any AC-to-USB charger will provide at least that much current, so you don’t even have to be choosy. A spare Raspberry Pi power supply would also more than suffice. As soon as it’s plugged in, the spy should run its firmware. Within a few seconds it’ll connect to WiFi and start broadcasting overMQTT.
TUNING THE SPY
The firmware publishes to four different MQTT topics — two each for the washer and dryer. * laundry-spy/washer/state and laundry-spy/dryer/state publish the integer values of each of the five states: 0 for Idle, 1 for Maybe On, 2 for On, 3 for Maybe Off and 4 for Done. This happens as soon as thestate changes.
* laundry-spy/washer/force and laundry-spy/dryer/force publish vibration scores. Not _every_ vibration score; after all, we sample the score as often as 20 times each second. Instead, roughly every two seconds we’ll publish the most recent vibration score we got. The purpose of publishing the force data directly is to help us get a sense of what vibration scores we can expect in various states. In this spirit, let’s listen in on the washing machine. Did you install mosquitto in Part 2? Run this from
the command line:
mosquitto_sub -v \ -h YOUR_MQTT_SERVER_IP -p YOUR_MQTT_SERVER_PORT \ -t "laundry-spy/washer/force" Do this when your washer is idle as a mere sanity check. You should get values very close to zero. laundry-spy/washer/force 0.01 laundry-spy/washer/force 0.01 laundry-spy/washer/force 0.01 laundry-spy/washer/force 0.01 laundry-spy/washer/force 0.00 laundry-spy/washer/force 0.01 laundry-spy/washer/force 0.00 If you see an occasional spike, that’s fine. Our firmware should recognize those as false positives. When you start a load of laundry, run that command again. Here’s what mine looks like when the washer is on: laundry-spy/washer/force 0.03 laundry-spy/washer/force 0.07 laundry-spy/washer/force 0.06 laundry-spy/washer/force 0.03 laundry-spy/washer/force 0.14 laundry-spy/washer/force 0.02 laundry-spy/washer/force 0.10 laundry-spy/washer/force 0.10 laundry-spy/washer/force 0.08 laundry-spy/washer/force 0.10 laundry-spy/washer/force 0.19 laundry-spy/washer/force 0.03 laundry-spy/washer/force 0.08 laundry-spy/washer/force 0.15 laundry-spy/washer/force 0.08 laundry-spy/washer/force 0.05# ...
The vibration scores you see when the machine is running should be, well, _higher_ than the ones you got when it was idle. Sure, there are a couple of outliers in there; that 0.02 score is probably something we’d get once in a while when the machine is idle. But that’s why we wrote code that’s robust enough to consider scores over a longer window of time. A single high score won’t flip the machine into the On state, and a single low score won’t flip it back to Idle. So you’ve got two kinds of scores: the sort you’ll get when your machine is idle, and the sort you’ll get when your machine is running. Use these to determine your threshold: pick a value that would routinely get exceeded when the machine is on, but _not_ when it’s idle. In my case I picked 0.08. You might need to come back to tune this value later. If you get through an entire cycle without the spy noticing and switching to the On state, your threshold is probably too high. If you get notifications telling you a cycle has finished, yet you have no memory of putting clothes in the washer or dryer, then your threshold is probably too low, or else you took Ambien and had a spate of household productivity right before you fell asleep. Speaking of false positives… while the washer is running, let’s check on the vibration scores for the dryer. mosquitto_sub -v \ -h YOUR_MQTT_SERVER_IP -p YOUR_MQTT_SERVER_PORT \ -t "laundry-spy/dryer/force" laundry-spy/dryer/force 0.01 laundry-spy/dryer/force 0.03 laundry-spy/dryer/force 0.01 laundry-spy/dryer/force 0.00 laundry-spy/dryer/force 0.02 laundry-spy/dryer/force 0.04 laundry-spy/dryer/force 0.00 These scores are low, but not as low as they’d be if the washer were idle. Some of the washer’s vibration is transferring to the dryer through the floor. (If your machines are sitting on a slab foundation, this probably won’t be a big factor, but our laundry room is in the back of a house built on a pier‐and‐beam foundation.) You want your threshold to be high enough that activity from the adjacent machine won’t generate a false positive. My dryer’s threshold is 0.12 because it rumbles more violently than my washing machine — but I could probably move it up or down a bit without making a practical difference to its behavior. In fact, this version of the laundry spy has been running concurrently with the proof‐of‐concept version I made last year. Though the two machines vary in their accelerometer hardware and in the exact way they measure vibration changes, they behave almost identically, and notify me about finished laundry cycles at nearly the exact same time. If, somehow, this isn’t granular enough control, you can also play around with the time‐based constants: TIME_WINDOW, TIME_UNTIL_ON, and TIME_UNTIL_DONE. The last of those three, in particular, is very conservative for a reason: washing machines may vibrate less during certain parts of the cycle, like when water is draining, and I didn’t want any such phase to fool the spy into thinking a cycle was done. Note, however, that as the sketch is currently written, these constants are not independently configurable between machines the waythe thresholds are.
SETTING THE THRESHOLDS Once you decide on good values for your washer threshold and dryer threshold, put them back into the sketch as the new values of WASHER_THRESHOLD and DRYER_THRESHOLD, then flash the new firmware onto the spy the way we did in Part 3.
THE FINAL EXAM
The next time you do laundry, you can take the laid‐back approach and simply wait to see if you get a notification from Pushover… or you can spy on the machine’s MQTT feeds before and during the beginning of the cycle to see if it’s switching states the way weexpect.
Just before you start a cycle, subscribe to both the state and force topics for your machine by using the # wildcard: mosquitto_sub -v \ -h YOUR_MQTT_SERVER_IP -p YOUR_MQTT_SERVER_PORT \ -t "laundry-spy/washer/#" (This is why we’ve been using the -v switch this whole time; without “verbose” mode, you won’t see the name of the topic in theoutput.)
Since we set the “retain” flag when we publish a machine state, you should immediately get back a response: laundry-spy/washer/state 0 The 0 corresponds to an Idle state. So far, so good. Go turn your washing machine on, but _leave the mosquitto_sub commandrunning_.
By the time you get back to your computer, the state value should change to 1 (Maybe On), because it picked up on the vibrating machine almost instantly. (If this didn’t happen, look at the force readings being published and make sure they’re in the range that you expect. It’s possible that your threshold is _way_ too high.) After another 30 seconds, state should change to 2 (On). (If it goes back to 0 instead, that means at least three seconds elapsed without your threshold being exceeded. It’s possible that your threshold is _slightly_ too high.) If you get all the way to the On state, congratulations! Your spy will probably work just fine. Monitoring it all the way to the Done state is possible, albeit a bit boring. Leave the command running in the background while you do other things. When you hear the cycle finish, verify that the state changed to 3 (Maybe Done). After about five minutes, it should change to 4 (Done) and then straight back to 0 (Idle). (If the spy won’t progress to 3, or will get to 3 but never to 4, it means that your threshold is too _low_, and is being exceeded on a consistent basis even when your machine is idle.) If all of this happens but you _still_ don’t get a notification, then the problem is somewhere in your Node‐RED workflow, and you should test the Pushover integration by itself. OH, RIGHT, THE NODE‐RED WORKFLOW I want to revisit that workflow just so we all understand what’s going on. This is what I had you import in Part 2. You can
double‐click on each node if need be to make sure it’s doing exactly what I say it’s doing.Remember this?
* This workflow will listen for messages published to laundry-spy/washer/state and laundry-spy/dryer/state, just like we’ve been doing manually with Mosquitto. * All such messages will get sent to the “Done?” node, which will only allow those messages through if their payload is 4 (our value for the Done state). * The function node will build a new message with topic and payload values corresponding to the title and text of the Pushover notification we want to send. Then it’ll forward _that_ messagealong to…
* …the Pushover node, which turns it into a notification and sends it to the user who corresponds to the user key that you provided in the node’s configuration.Thanks, robot!
Easy, right?
WHY DID WE DO THIS?
If you wanted to build a laundry sensor with a minimal amount of effort, you’d probably be reading someone else’s tutorial rightnow.
On one hand, it sometimes bothers me that most Arduino‐esque tutorials I read — on Instructables and similar sites — are written in a rigid, recipe‐like fashion: _do these exact things, then run this exact code_. On the other hand, recipes do have their place — if you follow a recipe you’ll at least end up with _edible food_ when you’re done. My first version of the laundry spy didn’t need a local MQTT server — it published data to Adafruit IO , and then explicitly triggered a Zapier workflow via webhook when a cycle was done. Ultimately, I decided to bring those functions in‐house when I began to do other IoT things. I wanted all my home automation logic in one place, and I didn’t want that place to be somewhere in the cloud when I could do it just as easily myself without a monthly fee. Right now, the laundry spy is just one of about ten different devices in my house that communicate over MQTT. Node‐RED isn’t just my gateway to Pushover; it’s how I tell my backyard string lights to turn off at 10pm every night, and it’s how I tell my nightstand fan to turn off if it’s been on for at least three hours. So this four‐part series wasn’t just about laundry. If you’ve read this far, you’re probably interested in doing other home automation–type things around the house, in which case the stuff wedid in Part 2
isn’t overengineering; it’s just prudent foundational prep work.USEFUL ADDITIONS
At this point, you’ve got a pretty solid, straightforward firmware that does a small amount of things well, and which you can likely leave running indefinitely without any trouble. The WiFi library will automatically attempt to reconnect if your WiFi drops out, and losses of power are no big deal because the firmware will just start from scratch whenever it regains power. When the spy has failed to notify me, it’s almost always been the fault of my IoT server, rather than the spy itself. In addition to Node‐RED, I’m running Homebridge(for HomeKit
integration) and Redis (for various tasks that require persistence), and something I’m doing is causing either a hard freeze or a loss of network connectivity every couple weeks. So far I’ve been too lazy to hook up the headless machine to a displayto diagnose it.
You might want to add some stuff to this sketch for your own convenience — in fact, the first two I’ll talk about are things that I left out of the sketch for simplicity’s sake.ARDUINOOTA
ESP8266s are starting to supplant Arduinos around my house even for tasks that don’t absolutely require internet connectivity, and it’s for one major reason: built‐in networking means firmware updates are easy. ArduinoOTA makes this possible: it’ll let you flash new firmware _over the air_ instead of through a serial connection. This is a godsend when you’ve got ten oddball devices doing things around your house and you’ve got to change something on each one. The caveat is that this process works only for sketches that are in correct working order; if your sketch is crashing, or otherwise not hitting its intended code path, you’ll have to tether to it the old‐fashioned way. ArduinoOTA is built into the ESP8266/Arduino core, and its API is deadsimple. Observe:
#includevoid setup () {
// other setup code, then... ArduinoOTA.setHostname(HOST); ArduinoOTA.onStart(() { Serial.println(" Starting update...");});
ArduinoOTA.onEnd(() { Serial.println(" ...update finished.");});
ArduinoOTA.onError((ota_error_t error) { Serial.printf("OTA: Error: ", error); if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); else if (error == OTA_END_ERROR) Serial.println("End Failed");});
ArduinoOTA.begin();
}
void loop () {
// other loop code, then... ArduinoOTA.handle();}
That’s it.
The Arduino IDE will list network update targets in the TOOLS → PORT menu (under the “Network Ports” heading). And PlatformIO users can specify an update address in their platformio.ini file or via command‐line switch. ArduinoOTA relies on mDNS, which Macs support natively, and which Linux machines support through Avahi (which is bundled by default in many distros, and usually installable via a package manager otherwise). Windows users can install Bonjour forWindows
.
MDNSRESOLVER
Oh, have I not talked about mDNSyet?
mDNS, otherwise known as Bonjour, is part of the glue that makes IoT easy. Instead of having to know each others’ IP addresses — and instead of making you implement your own home network DNS — it lets machines on the same network multicast the names they want to be called and advertise the services they provide. Computers also use mDNS to auto‐discover things like printers and scanners on your network. Good news: the ESP8266/Arduino core comes with built‐in mDNS broadcast support. Our firmware declares a HOST constant (laundry-spy by default) and we advertise ourselves on our network by that name through a call to MDNS.begin(HOST). Bad news: the built‐in support is limited to mDNS _broadcast_, not mDNS _resolution_. When configuring MQTT, we had to tell the laundry spy what our MQTT server’s IP address was, even though from my Mac I can refer to that same machine as home.local when using SSH. Because hard‐coding IP addresses creates work for your future self, consider using the mDNSResolver library instead. It’s a focused library that can resolve mDNS‐style .local domains without any of the service discovery stuff you don’t need. Here’s how I use it in my sketches: #define MQTT_SERVER "home.local" #includeWiFiUDP udp;
mDNSResolver::Resolver mdnsResolver(udp);char serverName;
void MQTT_resolve () {IPAddress ip;
if ( ip.fromString(MQTT_SERVER) ) { // We were given an IP address. strcpy(serverName, MQTT_SERVER);} else {
// We need to resolve this value via mDNS to get an IP. ip = mdnsResolver.search(MQTT_SERVER); if (ip == INADDR_NONE) { // We can’t resolve this address via mDNS. It might point to an // external server, so just copy it over to `serverName` and make it // someone else’s problem. Serial.print("Couldn't resolve mDNS server: "); Serial.println(MQTT_SERVER); strcpy(serverName, MQTT_SERVER);} else {
// We have an IP address. PubSubClient expects it as a string, though. strcpy( serverName, ip.toString().c_str() );}
}
}
void MQTT_connect() { Serial.print("Connecting to MQTT... "); // Have we resolved our server name yet? if (strlen(serverName) == 0) {MQTT_resolve();
client.setServer(serverName, MQTT_SERVER_PORT);}
// ...
}
When we first try to connect to the MQTT server, we’ll attempt to turn our configured MQTT_SERVER constant into an IP address; if that doesn’t work, we’ll just assume it’s not on our home network, in which case it’s a DNS server’s job to turn it into an IP address later on. We only have to do this work once. Up until recently, I was hard‐coding my IoT server’s IP address into my sketches, and using DHCP reservation on my router to guarantee that the server would always have the same IP. Good enough, right? Sure, until you switch routers, and your new router assigns IPs that start with 192.168.7.X instead of 10.0.0.X like your old router did.ESP8266WEBSERVER
Hey, your ESP8266 can serve up pages over HTTP! And the API is even pleasant to use; if you’ve ever used Sinatra or Flask , you’ll feel at home. #include""
""
"""
"Hello world!"
""
};
char tempJsonString;void setup() {
server.on("/", HTTP_GET, () { // Send a string from PROGMEM. server.sendContent_P(HELLO_WORLD);});
server.on("/settings/get", () { int someValue = getSomeValue(); // sprintf(tempJsonString, "{ \"foo\": %d }", someValue); server.send(200, "application/json", tempJsonString);});
server.begin();
}
void loop() {
server.handleClient();}
But! Don’t go overboard here. * _Running a server with a single endpoint that shows diagnostic data for debugging purposes_: fine idea. * _Running a server with a few regular‐sized pages of HTML and JavaScript_: mediocre idea, but it has its place. Read thedocumentation
,
store those big strings in PROGMEM, and
use CDN‐hosted JavaScript libraries if you can. * _Running a complex web app with a robust HTTP API that, like, consumes JSON post data and emits, I don’t know, XML or something ridiculous_: good god, friend. You know this hardware costs $4, right? Serving HTTP is glorified string‐building, and that’s not what embedded devices excel at. If you want to put a fancy interface on your data, consider writing a web app that lives on your IoT server and communicates with your device via MQTT or something. Remember that your device can _subscribe_ to MQTT as well as publish to it — some ESP8266 tools use this method to expose an API for changing device state and/or settings. I don’t want to overstate it — your ESP8266 can serve up even complex responses as long as you’re smart about how you build your strings. Like if you know your response will never be larger than X characters, you can allocate the space for that string once and then reuse it every time. If you want your device to be able to parse and generate arbitrary JSON, and I haven’t talked you out of it, then take a look at the ArduinoJSON library, and strongly consider buying the exhaustive guide as a way of supporting its author. It’s really quite nice to work with.WHAT’S NEXT?
Go wash your clothes. YES. AND AFTER THAT? Well, I’ll probably take a break before I start another series like this, but maybe next time I’ll talk more about what I’ve been doing with Node‐RED. I’ve found that it excels at turning one sort of interface into another: making MQTT data available via web sockets, wrapping an HTTP API around a proprietary smart switch, and so on. Maybe I’ll even write the whole thing ahead of time so I can tell you at the beginning how much reading I’m making you do.article
0
LAUNDRY SPY, PART 3: THE SOFTWARE April 27, 2018 • Posted in Articles, ESP8266
, Tutorials
It’s time to write the firmware for the hardware we made in Part 1. It’ll turn the raw acceleration data into determinations about when our machines are running and report its findings over MQTT to our homeautomation server.
Read more →
article
0
LAUNDRY SPY, PART 2: THE INFRASTRUCTURE April 17, 2018 • Posted in Articles, ESP8266
, Raspberry
Pi ,
Tutorials
We need a broker between the laundry spy and the rest of the world, so here’s an abridged primer on setting up Node‐RED and MQTT on aRaspberry Pi.
Read more →
article
3
LAUNDRY SPY, PART 1: THE HARDWARE February 15, 2018 • Posted in Articles, ESP8266
, Tutorials
My washer and dryer are two appliances that I’ve wanted to make “smart” for a long time, or at least smart enough to balance out how dumb I am about remembering to empty them when loads are finished. On several occasions, wet clothing has lingered in my washing machinefor…
Read more →
83RD & PARK
I was very damp when I took this.0
Flickr
October 14, 2017
article
1
NOSTALGIA-TRON, PART 11: NOT ELECTROCUTING YOURSELF September 18, 2017 • Posted in Articles, Raspberry Pi
,
Tutorials
The best way to synchronize your monitor and marquee to your Pi’s power state without wiring up your own power outlet.Read more →
article
2
NOSTALGIA-TRON, PART 10: METADATA September 6, 2017 • Posted in Articles, Raspberry Pi
,
Tutorials
You might have noticed that your list of installed games looks a bit bland in EmulationStation without artwork, game descriptions, and the like. You could use the metadata scraper that comes with RetroPie, but for MAME games I think it’s better to leverage the pedantry of the community and fill your game lists with more reliable metadata.Read more →
article
1
NOSTALGIA-TRON, PART 9: A UTILITY SCRIPT FOR TESTING CONTROLS August 2, 2017 • Posted in Articles, Raspberry Pi
,
Tutorials
For the moment I’m out of hardware topics, so let’s look at some stuff that might be more widely applicable to folks who don’t make my exact hardware choices.Read more →
article
8
NOSTALGIA-TRON, PART 8: OVER-ENGINEERED JOYSTICK ROTATION July 10, 2017 • Posted in Articles, Raspberry Pi
,
Tutorials
It will have become clear to most readers that I swung for the fences on this project. The two ServoStiks I purchased prove the point: they can switch between 4‐way control and 8‐way control. Did I need this? No. Was I going to take advantage of it once I bought them? Ofcourse.
Read more →
article
19
NOSTALGIA-TRON, PART 7: LED CONTROL June 26, 2017 • Posted in Articles, Raspberry Pi
,
Tutorials
Let’s make the poor‐man’s version of LEDBlinky: a way to light up specific buttons for specific games using a Pac‐Drive and someshell scripts.
Read more →
* ← Older
*
This is
The weblog of Andrew Dupont , web developer and writer.Elsewhere
* GitHub
* Flickr
The short version
* About me
* About this site
* Code I’ve written* Notable Posts
Archives
Search Feeds
* Atom
* RSS
Categories
* Apple
* Articles
* Arts
* Code
* Conversations
* Design
* Development
* ESP8266
* Government
* JavaScript
* Links
* Movies
* Music
* OS X
* Other
* Personal
* Photos
* Politics
* Prototype
* Quotations
* Raspberry Pi
* Reviews
* Ruby
* Sports
* SXSW
* Technology
* Television
* TextMate
* Thoughts
* Tips
* Tumbles
* Tutorials
* User Interface
* Video Games
* Videos
* Web
* Writing
Details
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0