Lilygo T-Watch 2020 TV-B-Gone
by TheJadeRabbit in Circuits > Gadgets
1076 Views, 0 Favorites, 0 Comments
Lilygo T-Watch 2020 TV-B-Gone
Thanks for checking this Instructable out. I'm going to assume you have your T-Watch 2020 thing set up with the Arduino IDE and all the necessary libraries are installed and what not. If this is not where you are, I would recommend going through this well made Instructable by DanGeiger which had helped me greatly when starting out.
This thing is essentially a universal remote that can power off most TV's by spamming them with a bunch of common IR TV signals. The original TV-B-Gone is by Mitch Altman a long time ago, so I like to think this is a much more updated version you can wear on your wrist if you're too lazy to get up off the couch or you just want to mess with someone. Be careful not to get yourself into trouble though...
This project is made to be only for educational purposes... but I suppose I wouldn't be able to stop you from messing with people with this...
I saw a video by "Another Maker" on YouTube about causing trouble with this smart watch... I thought this was a very interesting idea and attempted to make my own version of it.
There was a limited amount of resources posted along with this video and how it works, which was all for good reason. I wanted to make this Instructable in order to save people some time troubleshooting this. This only took me a few days of work and I think doing this yourself is much more educational, but I hope this is at least somewhat educational as well.
It is also worthy to note that this only works with older TV's, as I have tried it on my more recent models without success. The TV-codes that are spammed at the TV's were gathered in 2009 I believe according to the commented out lines, which would explain this.
Supplies
Lilygo T-Watch 2020
Arduino IDE
TV's to mess with
Code Stuff
As stated in the previously mentioned video, the esp8266 TV-B-Gone example was a tremendous help to getting this thing to work. This example works with the Esp32 as well, which the T-watch is based upon of course.
I basically went into the LVGL examples from the T-Watch libraries and opened the user_button one. I then just rewrote the basic example given by the above link and make it so whenever a virtual button on the watch was pressed, it sends the codes, rather than a physical momentary trigger button. If you are in Europe you will have to go through the code and uncomment the "EU" settings in the "main" and "TV-B-Gone" tabs and comment out the "NA" settings.
The watch will vibrate for a second when you press the button, which is indication that the TV power off codes have been sent.
Sorry I could not get my .zip file to upload properly as well, you will have to download all four files individually and place them in a folder together with the title the same as the .cpp file.
How the Code Works
This section is meant to be a more in-depth explanation of the previous suggestion. I copied most of the code I used here from "wfdudley" on Github here and their great system for this watch. I made copies of a couple header files (".h") from their library in order to edit them to work with what I wanted and have them point to the correct places.
The main executing file for this code is the "TV-B-Gone.ino" file, this is the file that has our "main" and "loop" functions. This file goes through all the procedures to give our watch a brain and it is connected to all our other files. The rest of the files are our header files, which essentially gives our main ".ino" file more stuff to work with.
The file "WORLD_IR_CODES.h" has a large variety of Infrared signals which have been used with a variety of TV's in the past and are maybe still in use. This is what the main ".ino" files calls to when it spams all the codes to try and turn any TV off. I got this code from an ESP32 TV-B-Gone library from "agrimpelhuber" on github here.
The "main.h" and "config.h" files act in similar ways to each other, each simply being setups for the watch and code, stating in prerequisites that you can change if you have a different device and such. The "config.h" file being being for the T-Watch from "wfdudley" as stated above, and the "main.h" file being from "agrimpelhuber" also above.
Further Code Explanation
Just a continuation of the code explanation, specifically that of the main "TV-B-Gone.ino" file. I edited in text into the photos with corresponding colors of each. The first two photos are just files being added to the main file to be used later, as well as required library files to use this code.
Done, I Think...
Above is a video of it being demonstrated working on an older Sony TV. Once the code is loaded in and you have the necessary libraries (see the above inserted links), you should be able to turn off any old-ish TV from your wrist!