10 ms·
Turning a TV set-top box into a Linux computer (2022)
- webdevver 4y agoOut of interest, what logic analyzer/logic analyzer software is the author using?
- c0wb0yc0d3r 4y agoLooks like sigrok[0]. From the screenshots, the logic analyzer looks similar to a saleae clone. [0]:https://sigrok.org/wiki/Main_Page https://sigrok.org/wiki/Main_Page
- unwind 4y ago... and if you're not aware, Saleae clones are widely available on e.g. Amazon, prices before shipping seem to start around $7 in the US. This is possible since the original Saleae is basically just a CY7C68013A [1] in a box, and once others realized that cloning it was not difficult. No idea about patents and so on here, obviously it's not OK for clones to use Saleae's firmware without licensing it. I have one, it worked fine and is of course highly recommended since the combination of a cheap way to get signals into the computer and Sigrok's protocol analyzers makes things really neat. [1]: https://www.infineon.com/cms/en/product/universal-serial-bus/usb-2.0-peripheral-controllers/ez-usb-fx2lp-usb-2.0-peripheral-controller/cy7c68013a-56ltxc https://www.infineon.com/cms/en/product/universal-serial-bus...
- retSava 4y agoI had a clone once upon a time, together with several Saleaes and have recommended them to many many people, and that clone was not accurate to me. While the chip and the firmware was probably exactly the same as the original one, the rest of the hardware was cost minimized and did not work as well. I compared. The clone must have had capacitive coupling or something, since signals was often slightly delayed in unpredictable ways. Eg, a bit here and there could be shifted early or late, which is kind of bad when you work on protocols or timing.
- deleted 4y ago[deleted]
- redfast00 4y ago(author here) this is indeed a Salea clone (one of the first results when searching for 'logic analyzer' on Aliexpress), with pulseview/sigrok as software. I try to use cheap tools if possible, so it's more accessible for other people to reproduce.
- death916 4y agoReally interesting writeup. Might be fun to try something similar with some old devices I have.
- moremetadata 4y agoIts on my bucket list of things to do, because here in the UK there are plenty of TalkTalk Youview (Huewei DN372T) TV boxes with 320GB hard drives that overheat and hang with the last official update from Youview and despite asking there is no way to revert these back. However with so many being available on Ebay et al and the HD-less (DN360T) forcing people onto streaming services, I think its only right to reprovision these to work in a hive networked manner with external storage so people can store as much broadcast footage as they have storage for, and stream from any device. Being an early adopter of Media Portal over a decade ago, but finding it impossible to secure windows even back then despite only using it for satellite transmissions, I think Linux should receive more attention now.
- emsixteen 4y agoVery cool, I wish I could do this sort of thing.
- trevithick 4y agoSame here. I appreciate the projects like OpenWRT that make this kind of thing possible for mere mortals like me. I flashed OpenWRT onto an old Verizon combo DSL modem/router[0] and now it's a VPN endpoint. I think the most complicated part was uploading the initial firmware via TFTP. But it looks like you can now just use the web interface, so it's even easier. Props to the people who figure this stuff out and make it available. [0] https://openwrt.org/toh/actiontec/gt784wnv https://openwrt.org/toh/actiontec/gt784wnv
- qbasic_forever 4y agoBootlin's embedded Linux class is fantastic and will teach you how to do all of this--uboot setup, building a kernel and root fs, etc. All of the materials for the class are free downloads so if you're motivated you can read the slides and follow it all yourself. I highly recommend it: https://bootlin.com/training/embedded-linux/ https://bootlin.com/training/embedded-linux/
- xwdv 4y agoI struggle to think of what purpose a device that wasn’t meant to be a Linux computer would realistically serve beyond nefarious goals.
- pjc50 4y agoRunning Linux is the goal. It might be useful if you want to drive a TV, say. And of course, since it already runs Android, it's pretty close to "intended to run Linux" to start with.
- BoatyPrint 4y agoPlenty of applications for a Linux box that aren't "nefarious". Maybe digital signage, or backup server, to name two.
- tenebrisalietum 4y agoThis is an ethically neutral activity. The mere act of transforming a device into such a computer doesn't add or remove any nefarious goals, if you have those goals, you can get another device intended to be a Linux computer and still accomplish them (and it would be much easier). If the transformation is done in contravention of the owner, it's bad, but it sounds like from the article that the ISP has written it off and in any case, they say they are doing this nondestructively.
- jrm4 4y agoI'd argue 100% ethically positive; it's the sprinkling of unnecessary devices by companies that's the negative.
- hungryforcodes 4y agoIn a worst case scenario the company (so called "owner), will just charge you for its replacement. Since it was well calculated that a) the box was useless and b) would never be asked for again and c) (as I've said) would just be charged a certain amount for non-return... I hardly see how it's an ethical activity. If the owner was one person that was needing this device -- fine. But this is just a company doing business...
- redfast00 4y agoauthor here, surprised to see this on HN. If you have any questions, don't hesitate to ask :)
- The_SamminAter 4y agoI’m about to attempt to do something similar on Deco routers, using [this](https://blog.keane.space/tp-link-deco-m5-hardware-hacking.html https://blog.keane.space/tp-link-deco-m5-hardware-hacking.ht...) as a base, but have never wired serial to usb manually before. My main question is how do you use a multimeter to tell which pad is which? Great article!
- redfast00 4y agoYou first need to find ground. You can do this by visual inspection (a bit less risky), or by using your multimeter in continuity mode across external metal parts (for example the outside of the USB port)/negative pin of the power supply. Then, you can use a logic analyzer to find the serial TX pin. The RX pin is usually pretty close, and might be pulled up through a resistor to VCC.
- devsda 4y agoIt is impressive that that they were able to run linux without making permanent destructive changes. Had a pogoplug that I was able to repurpose as a linux server for some odd cron jobs and occasional backups. Assuming there are no such constraints to revert, what other general purpose consumer devices are hack friendly and can be turned into low powered linux boxes ?
- trevithick 4y agoCheck out the OpenWRT Table of Hardware.[0] It runs on all kinds of stuff. [0] https://openwrt.org/toh/start https://openwrt.org/toh/start
- RobotToaster 4y agoNot exactly a consumer device, but old thin clients are cheap and can be repurposed this way.
- rbanffy 4y agoAnd the x86 ones are just PCs, so all the software bringup part is trivial (which is why I managed to succeed at that ;-) )
- thomastjeffery 4y agoIt's an Android TV box. It was running Linux already. The main difficultly is usually unlocking the bootloader.
- n8henrie 4y agoI love these kinds of writeups, thank you! How did you determine what addresses to read things into? (the chainloaded bootloader, then its initrd/ FDT / etc.).
- redfast00 4y agoMainly by looking at what addresses the original bootloader loads them into. The addresses don't matter too much, as long as you load them into valid memory, since for most you pass a reference to them anyway in later steps.
- n8henrie 4y agoThanks for your response! I'm a hobbyist that's been tinkering with uboot now and again for years and can never figure out the right addresses for stuff, or where / how to learn this. I assume this memory is subsequently released for the OS? Or does the OS just work around it? Are you hobbling your runtime experience in some way if you load to the wrong address?
- redfast00 4y agoThis is raw memory, so the concept of malloc/free does not really exist: the OS will just overwrite the data. I think (not entirely sure) that the kernel gets relocated to a more or less fixed address in memory anyway, this won't affect your runtime experience.
- cassepipe 4y agoAlmost all my friends in France have a old ISP modem router that their former ISP did not bother getting their hands back onto when they changed providers. I would love to repurpose them. Where do I start with ?
- redfast00 4y agoTry to identify a serial port on the PCB, connect a serial adaptor to it (careful to get the pins and voltage right!) and take it from there (Edit: or google the PCB board markings, maybe somebody already did this)
- kjs3 4y agoFinding the JTAG port is also useful, combined with something like OpenOCD.
- mritzmann 4y agoCheck whether an alternative firmware already exists (e.g. OpenWrt or DD-WRT). https://openwrt.org/toh/start https://openwrt.org/toh/start
- mk_stjames 4y agoThis is a good article that covers the basics of looking for a UART debug port that could be used as a way to get some low level access to the router and go from there: https://www.riverloopsecurity.com/blog/2020/01/hw-101-uart/ https://www.riverloopsecurity.com/blog/2020/01/hw-101-uart/
- Klasiaster 4y agoYou can also get a similar board with that CPU here: https://libre.computer/products/aml-s905x-cc/ https://libre.computer/products/aml-s905x-cc/ It's optimized for mainline Linux and since u-boot supports UEFI booting, you can just throw a downloaded Fedora arm64 image on it and it will boot.
- NayamAmarshe 4y ago+1 for Libre Computer. Le Potato is awesome.
- Maursault 4y ago> you can just throw a downloaded Fedora arm64 image on it and it will boot. I know what you meant, but I have known and loathed hardware for which this would occur quite literally
- kelvie 4y agoOh wow, if this had an M.2 slot i'd consider getting these for my home k8s cluster (I use rpi4s which are hard to get and such cause USB SSDs are flaky with power, and an odroid M1, which has a pretty slow processor, but is otherwise perfect)
- tracker1 4y agoI've found the Argon power supplies (18W, 3.5A) for RPi are probably the best option when using USB powered storage... I swapped out the ones that came with my DeskPi cases. I have tried several, an earlier model didn't have the inline switch, which I don't really use but a nice to have feature. https://www.amazon.com/gp/product/B0919CQKQ8/ https://www.amazon.com/gp/product/B0919CQKQ8/
- wyldfire 4y agoI've had trouble sourcing reliable SD cards for these SBCs. I have had the Le Potato, ODROIDs, RasPis. And they will generally work really well 98% of the time. But I keep them in a closet and I hate that I need to service them once a year or so. I tried buying SD cards from several different retailers and never got reliable results like from SATA SSDs (or even rotating disks it seems). I eventually just bought an intel NUC which I saw as a big defeat but also a remarkably practical solution.
- tinus_hn 4y agoHas anyone ever tried to find out how one can connect to the TV servers and how the DRM works? In the EU you’d be allowed to get the keys from the provider.
- avidiax 4y agoSometimes it is just an app that knows where the streams are, and sometimes there is a devices attestation certificate burned into a TPM. The latter you are probably not going to hack, and even if you could, the various pirate IPTV providers will provide it for less cost if you value your time at minimum wage.
- tinus_hn 4y agoYou don’t need to hack things, the providers are required to cooperate. I just wonder if anyone has tried to actually do it.
- haolez 4y agoI've worked with STB hardware before and they usually suck. The processors that I worked with were all from MIPS and it felt like all useful instructions were removed, except for the bare basics. Forget anything related to vectorization, for example. They were painfully slow.
- kasabali 4y agoThese boxes generally utilize stock Cortex A53/A55 which are quite good IMO.
- avidiax 4y ago"Good" as in they can do anything slowly. A7x boxes won't struggle.
- Matsta 4y agoExactly. A53 cores are efficiency cores designed for non-intensive background tasks in phones to save battery. The only decent cpu atm that will eventually show up in TV boxes is the Rockchip Rk3588, but they aren't as cheap as some old s905x chips, and software support is very early days, so it will be a while before we see them in any android tv boxes. The key does seem to be you need at least a quad-core of high-efficiency cores. The Nvidia Tegra X1 found in the Nvidia Shield and Switch runs fine even though it has even older A57 cores(predecessor to the A72). Compare this to rockchip's last-gen Rk3399, which only has 2x A72 cores (and 4x A53 cores) and is pretty slow compared to a Rpi 4 (but that could also be because of crap software support on the Rockchip side)
- kasabali 4y agoGood as in they implement the ARMv8 architecture fully unlike the crippled cores parent comment was talking about, also being more powerful because they're still 4-cores, GHz CPUs while the MIPS parent was talking about probably only had 1-2 core(s) and low 3-digit MHz clock speed.
- NKosmatos 4y agoVendors of STBs should unlock them so that we don't get so much e-waste. These boxes are most of the times locked, whereas they could be repurposed for many interesting uses (linux machines, android boxes, educational devices...), now they will be thrown away, remain in closets/garages or at the best be recycled. Tried to unlock my Vodafone TV box (Sagemcom DIW387 if I'm not mistaken), but with no luck since there is no community to "hack" it.
- larodi 4y agoIt must be a low. Like self unlock after 513 boots
- anonuser123456 4y agoWe aren’t going to modify our security protocols so a handful of people can mod their STB, sorry :P
- NegativeK 4y agoGiven how quickly support is dropped for consumer electronics, not opening up access to them is unacceptable. And that isn't really addressing the fact that many companies don't have the funding or the will to secure these devices.
- Clamchop 4y agoI think the desire to repurpose obsolete electronic appliances is probably far too small to make a meaningful dent in e-waste. Not much to be done at scale with random, idiosyncratic, and underpowered SBCs. I don't know for sure but I do strongly suspect it.
- BizarroLand 4y agoI mean, if nothing else when the device reaches EOL what would it hurt to release a bootloader unlock?
- 4y ago
- desimafiamanish 4y ago[flagged]
- larodi 4y agoI love this article so much for some u known reason. Hacking should be praised! Amen
- irsagent 4y agoIt's impressive that a set-top box can be turned into a Linux Computer. I feel with such a reality like that any device can electronic device, if it has the right compents can run linux, like how Doom is used as the base case.
- donatj 4y agoI find "set-top" a funny leftover term from the age of CRTs. There's no way to set anything on top of TV's these days. My Kinect is still teetering atop it, but even that seems precarious.
- squarefoot 4y agoVery interesting writeup, bookmarked! I wish there was a community willing to reverse engineer those very cheap DVR/NVR video surveillance boxes and boards sold on Ebay and Aliexpress. They have USB, SATA, some GPIOs and quite fast ADC chips on board to achieve high definition video sampling so they could be repurposed for various uses like SDR. They already run Linux inside, although it is predictably tight closed, not updated security-wise and often phones home to Chinese servers, so reverse engineering them would be worth beyond mere hacking. Here's one of these boards, just search for "ahd dvr board". https://www.aliexpress.us/item/3256804455950963.html https://www.aliexpress.us/item/3256804455950963.html
- detrites 4y agoDo you happen to know other spec's on these or similar? (Eg, CPU type/speed, RAM etc)
- squarefoot 4y agoNot much info unfortunately. Some of them apparently use a HiSilicon (owned by Huawei) chipset; the following Alibaba page lists some of them among others. https://www.alibaba.com/countrysearch/CN/dvr-motherboard.html https://www.alibaba.com/countrysearch/CN/dvr-motherboard.htm... Here are a few pages I found that could turn out interesting: https://securitycamcenter.com/firmware-chinese-dvr-nvr-security-cameras-h264-h265/ https://securitycamcenter.com/firmware-chinese-dvr-nvr-secur... https://github.com/hisilicon https://github.com/hisilicon And as widely reported, they're quite vulnerable. https://github.com/tothi/pwn-hisilicon-dvr https://github.com/tothi/pwn-hisilicon-dvr https://www.exploit-db.com/exploits/44004 https://www.exploit-db.com/exploits/44004 I wonder if those vulnerabilities could be used to gain root access to the hardware in order to either patch it and make decent security devices, or repurpose them completely, as the hardware is interesting and dirt cheap.
- detrites 4y agoMost interesting, thank you. These may have an ARM Cortex A7 dual-core at 1.3Ghz according to this datasheet for the HiSilicon hi3520dv400 (the 4 channel version): http://wangxunic.com/wp-content/uploads/2019/05/Hi3520DV400.pdf http://wangxunic.com/wp-content/uploads/2019/05/Hi3520DV400.... Not bad at all. And with DDR3.
- allenrb 4y agoExcellent work once again. Would have loved to find something like this when I was a student... back when computers occupied entire desks. This seems similar, if not identical, to the free streaming box I told Xfinity they could keep. Might go revisit that decision now.
- almost_noone 4y agoI work for an ISP and my role is pretty much to have the TV STBs become ewaste as late as possible (trying my best to do my part). Currently our security is pretty bad [1] (that's why I'm posting from a throwaway account), but I have a mainline Linux booting off a USB storage without touching internal storage (with very little changes). I plan to fix those security issues, and make this boot-from-usb official within few months. We're far from thrashing those units, but when we will, it'll be too late to open them up. [1] related to security of user private data
- jeroenhd 4y agoThat's great, be sure to post your story here on HN when you've finished the project!
- colordrops 4y agoIs there anything that can be done with unused Roku boxes? I have a Roku Ultra 4k that I'd love to install open source software onto.
- pizzaknife 4y agoyes but have you ported doom to it's hand held controller?
- granra 4y agoI made a similar write up on running mainline Linux on a similar device a few years ago. Interesting read though. https://codedbearder.com/posts/mainline-linux-on-tx3-mini/ https://codedbearder.com/posts/mainline-linux-on-tx3-mini/
- bigape911 4y agoNice. Repurpose and reuse for when these things get thrown away next year.
- progman32 4y agoI started down a similar path for a Lorex NVR, amusingly it brings out its serial port to a physical DB9 on the back. Trivial to get it into the uBoot prompt and start dumping its flash. Annoyingly it has a hardware watchdog that reset the machine every minute or so unless it's in the OS. I didn't feel like figuring it out so I wrote a quick script that dumped a few hundred K, waited for machine reset, re-entered u-boot, and kept dumping. Ultimately I decided to work on something else as I have plenty of more interesting hardware hacking projects to work on, but it was fun practice to overcome the watchdog.