I went looking for a remote-controlled power switch (the wireless christmas kind, not the modern IoT kind) and didn't find it, but I did find this thing I bought just to figure out why it exists.
It's a timer outlet, but you program it from your phone... but it's not wireless.

Yeah instead it plugs into your phone's HEADPHONE PORT
I got it on sale.
probably because iphone dropped the headphone port and they had to get with the 21st century and make it bluetooth
So inside the box is the device. it's got a little 2-prong polarized outlet with no ground.
on top is the only controls: on/off/timer.
then there's a 3.5mm jack here
turns out there's one more button! it's a reset button.
I guess the thing saves settings when turned off, because you have to unplug it to push the reset button.
Specs: up to 10 amps for a resistive load, and up to 5 amps for a tungsten load.
and this is just an aux cable
I hate when they're just like "download the app by searching for foobar".
That's putting some serious trust in your SEO, man
this is what the app is supposed to look like
thankfully it's still on the app store.
although it tries to sell me a bunch of unrelated movies first?
uh-oh, 2 stars?

one of my favorite things to do is to look up the ratings on IoT apps... they're never good.
apparently it requires a lot of permissions and barely works
huh, triangle screws.
whelp, guess I better get my dremel and paper clips!
so the app wants to take pictures, access your location,
make calls, and access all your files.
and if you deny it, it just dumps you in the settings page to fix permissions, with no message.
huh, not all of the screws are triangles.
there's 4 of them, and 2 are philips
I hoped that'd make more sense when I opened it up, like one went into a PCB and the other didn't, but NOPE! it's just because Reasons.
So here's the control board.
We've got a CPU and two smaller chips. Probably one is some kind of communication chip, and the other is a flash chip for storing settings?
Nothing on the other side but the LED.
Although this bit is interesting: L/R/+/-, on the cables going to the other board.
L isn't connected... I think that means there's a version of this that can control two outlets at once, not just one.
also HIDDEN BATTERY!
someday that will die and leak and the whole thing will be destroyed.
The other PCB.
I do like that they keep all the high-voltage AC stuff separate from the low-voltage DC stuff.
Cheaper versions of this would have just had one PCB.
That big box is a Massuse ME-11-I-012-1HS3AF relay.
So that's an inrush type relay, 12v coil voltage,1A contact form, sealed, 16amp rating, AgSnO₂ contacts, class-F insulation.
So back on the main PCB, let's look at that CPU.
It's a Sino Wealth SH79F166A.
which is an 8-bit microcontroller with 16 kilobytes of flash ROM, 256 bytes of RAM, and 1 kilobyte of eeprom-like storage.

AND IT'S AN 8051! EVERYONE TAKE A DRINK
Over here is a Holtek HT9274.
That's a quad-op-amp.
And this is a 026B-A-CF850S, which is an... air filter? hmm.
actually it turns out it's a battery charger/management chip, an XT2051.
because it has a battery, yeah.
so I was wrong, it does all the storage inside the chip itself! fancy.
so apparently the communication with the phone/tablet is two way!
because it can tell it's not connected properly, in this emulator I'm using
why does this look so iOS
it's an android app
thankfully they didn't obfuscate their java code, so I can see sound generation code.
it sounds like (NO PUN INTENDED) it has a protocol of simple tones that it plays at the device.
it also might not be two way:
android historically has had a AudioManager.isWiredHeadsetOn api which tells you if the 3.5mm jack is connected.
So it may just be detecting there's no headphones plugged in to my emulator.
sadly since it's gaming oriented it doesn't seem to have any way to shim that out.
so the Toner class has a bunch of methods that do various things, like playOn to turn it on, playRandom, playProgram, and playDusk (and "dust"? they seem to mix up dust and dusk a lot)
so to turn it on you send the simple command "1111".
and we can see over in getSimpleCommand that a simple command is a command + a clock sync + a length, then there's a checksum. And it logs all this for us! handy.
the clock sync stuff is the current date, daylights savings times, timezone, latitude, longitude, then CT and CD.
CT is "current time" as an integer of how many minutes it is into the day, and CD is the day of the week.
the day of the week is implemented in binary, with a fallback in case you're on an INVALID DAY.
(it's using Monday = 001, and counting up from there)
and here's the checksum function.
uhhh. I'm not sure I'm awake enough to figure this out, but... it starts by padding up to a multiple of 8 bits.
then it calculates a total sum by converting every group of 8 bits to an integer and adding them together
then it converts that to a binary number, and pads it out (on the left this time) to 8 bits
then it chops the checksum down to 8 bits... and checks if the last digit is a 1.
if it is, it adds a 1?
it's doing something like count up the bits, add that sum, but then add an extra 1 if it was odd. I think that means it's different lengths for even or odd? I may just have to stick this code in a harness and run it
yeah. it is variable length.
I don't know if that was intentional. I kinda don't think so.

More from foone

Everyone likes to forget this episode just because it's terrible, but we were really sleeping on inherent comedy in a unfreezing an investor 300 years in the future and having them discover we've transitioned to a moneyless post-scarcity utopia.


it's like a classic twilight zone episode.

in fact, it IS a twilight zone episode.
The Rip Van Winkle Caper, Season 2, episode 24.
Four criminals steal a million dollars of gold bars, then put themselves in suspended animation for a hundred years to hide from the law.

they wake up, then start killing each other from mistrust, then the last one dies in the desert, as he offers a gold bar to the driver of a passing car, asking for water and a ride into town

the confused driver walks back to his car with the bar, and his wife asks what the gold bar is.
he says something like "It's gold... they used to use this for money, before we figured out a way to manufacture it."
He tosses it away, and drives off.

More from Tech

"I really want to break into Product Management"

make products.

"If only someone would tell me how I can get a startup to notice me."

Make Products.

"I guess it's impossible and I'll never break into the industry."

MAKE PRODUCTS.

Courtesy of @edbrisson's wonderful thread on breaking into comics –
https://t.co/TgNblNSCBj – here is why the same applies to Product Management, too.


There is no better way of learning the craft of product, or proving your potential to employers, than just doing it.

You do not need anybody's permission. We don't have diplomas, nor doctorates. We can barely agree on a single standard of what a Product Manager is supposed to do.

But – there is at least one blindingly obvious industry consensus – a Product Manager makes Products.

And they don't need to be kept at the exact right temperature, given endless resource, or carefully protected in order to do this.

They find their own way.
Next.js has taken the web dev world by storm

It’s the @reactjs framework devs rave about praising its power, flexibility, and dev experience

Don't feel like you're missing out!

Here's everything you need to know in 10 tweets

Let’s dive in 🧵


Next.js is a @reactjs framework from @vercel

It couples a great dev experience with an opinionated feature set to make it easy to spin up new performant, dynamic web apps

It's used by many high-profile teams like @hulu, @apple, @Nike, & more

https://t.co/whCdm5ytuk


@vercel @hulu @Apple @Nike The team at @vercel, formerly Zeit, originally and launched v1 of the framework on Oct 26, 2016 in the pursuit of universal JavaScript apps

Since then, the team & community has grown expotentially, including contributions from giants like @Google

https://t.co/xPPTOtHoKW


@vercel @hulu @Apple @Nike @Google In the #jamstack world, Next.js pulled a hefty 58.6% share of framework adoption in 2020

Compared to other popular @reactjs frameworks like Gatsby, which pulled in 12%

*The Next.js stats likely include some SSR, arguably not Jamstack

https://t.co/acNawfcM4z


@vercel @hulu @Apple @Nike @Google The easiest way to get started with a new Next.js app is with Create Next App

Simply run:

yarn create next-app

or

npx create-next-app

You can even start from a git-based template with the -e flag

yarn create next-app -e https://t.co/JMQ87gi1ue

https://t.co/rwKhp7zlys

You May Also Like

@EricTopol @NBA @StephenKissler @yhgrad B.1.1.7 reveals clearly that SARS-CoV-2 is reverting to its original pre-outbreak condition, i.e. adapted to transgenic hACE2 mice (either Baric's BALB/c ones or others used at WIV labs during chimeric bat coronavirus experiments aimed at developing a pan betacoronavirus vaccine)

@NBA @StephenKissler @yhgrad 1. From Day 1, SARS-COV-2 was very well adapted to humans .....and transgenic hACE2 Mice


@NBA @StephenKissler @yhgrad 2. High Probability of serial passaging in Transgenic Mice expressing hACE2 in genesis of SARS-COV-2


@NBA @StephenKissler @yhgrad B.1.1.7 has an unusually large number of genetic changes, ... found to date in mouse-adapted SARS-CoV2 and is also seen in ferret infections.
https://t.co/9Z4oJmkcKj


@NBA @StephenKissler @yhgrad We adapted a clinical isolate of SARS-CoV-2 by serial passaging in the ... Thus, this mouse-adapted strain and associated challenge model should be ... (B) SARS-CoV-2 genomic RNA loads in mouse lung homogenates at P0 to P6.
https://t.co/I90OOCJg7o