Monday, July 18, 2022

Quick Hack: The Phone to Stream Deck Conversion

What do you do with those old Android or iPhone phones and tablets? You have plenty of options, but it is pretty easy to build your own stream deck with a little off-the-shelf software. What’s a stream deck, you ask? The name comes from its use as a controller for a live-streaming setup, but essentially, it’s an LCD touchscreen that can trigger things on your computer.

The software I’m using, Deckboard, is a server for Windows or Linux and, of course, an Android app. The app is free with some limitations, but for under $4 you can buy the full version. However, even the free version is pretty capable. You can use an Android phone or tablet and you can connect to the PC with a USB cable or WiFi. I’ve found that even with WiFi, it is handy to keep the phone charged, so realistically you are going to have a cable, but it doesn’t necessarily have to connect to the host computer.

Linux Setup

Setup is very easy. The biggest hurdle is you might need to set up your firewall to allow the server to listen on port 8500 with TCP.  There are a few small issues when installing with Linux that you might want to watch out for.  There are 32-bit and 64-bit versions in deb, tar.gz, and appimage format. There’s also a snap. The problem with the snap is it is sandboxed, so without effort you can’t easily launch programs, which is kinda the entire point. I finally removed it and installed the deb file which was fine.

There were still two other wrinkles. First, while Deckboard offers a way to launch programs, it must be a program from a list it reads from your system. That would be acceptable, but the list wasn’t complete. I never did figure out why some things show up on the list and others don’t. For example, GIMP which shows up on my application menu was absent. Yet other things that were fairly obscure didn’t show up.

I thought this might be a dealbreaker until I found that Deckboard has a well-developed plugin system and one of those plugins lets you run an arbitrary command line. I guess it is a little less convenient, but it is much more flexible since you can launch any program you want and provide options to it as well.

The only other complaint I had is that when you run the program, it shows its configuration interface and puts itself in the system tray. That’s great the first time you run it, but on system startup, it would be nice to just have it quietly start. If there’s an option for that I haven’t found it. I’ll tell you how I solved that later, but, for now, just live with it.

Configuration

Of course, getting it installed on both machines is only the start. The whole point of something like this is to configure it to your whim. The program knows how to communicate with OBS, Spotify, Twitter, and Twitch. But you can also add generic programs, URLs, and so on. There are also plugins for things like Discord, Open Hardware Monitor, Steam, and more.

The multimedia panel lets me control media and open a few apps

You can create a bunch of pages, so you don’t have to cram everything on one page. The free version limits how many buttons you can have on a page, but the upgrade lets you put way too many if you want. I found that three rows of 6 buttons in landscape mode on my old Pixel 2 XL was about right for me.

Of course, everyone will have different ideas about how to set it up, and you are probably better able to create something aesthetic than I am. However, I tried to keep a few things constant. The top right corner of each screen is a time button that doesn’t do anything, just shows the tim). This requires a plug in. The rest of the top row is reserved for buttons that open other pages and on every screen but the main screen, the button next to the clock takes you back to main.

Creating a new button is easy enough

The bottom right button on each screen opens a multimedia panel because it is just so useful. Again, you won’t like my setup and will want your own.

Creating buttons and pages is very easy on the PC. You can select actions ranging from keyboard macros to multimedia control. You can control the mouse, open a website, or take a screenshot. Of course, you can also run a program as I mentioned earlier.

Form and Function

Graphic buttons can make your deck look better but getting there isn’t obvious

My buttons are a bit bland, I’ll admit. The icons are built into the program and come from Font Awesome. However, I didn’t realize that you can make each button use your own custom graphic. You do this by selecting the button’s shape which can be square, round, or a mysterious third option that looks like an image. At first, I thought that just meant “totally transparent” but if you select that and then push the button in the edit window, it lets you pick a file for a background. I guess I’ll have to go reconfigure everything now that I know that.

One thing that is nice is that you can have a button do multiple actions. So, for example, when I press the Hackaday button, it not only switches to the Hackaday page on the deck, it also flips over to my Hackaday desktop on the PC by sending a keyboard command. It could also run a script or folder, too.

Buttons can run more than one action

It isn’t quite a scripting language, but it prevents you from having to tie buttons to a bash script in some cases.

The Final Piece

I mentioned that I didn’t appreciate that loading the program on startup also causes the main window to appear. I found a fairly simple way to combat that, at least on KDE. First, run the program minimized. You can do that a few ways. I used a KWIN window rule to force it to iconify, but you could also use kstart to do that. Of course, if you aren’t using KDE, you’ll have to find another way to do it and, honestly, it doesn’t really matter if you don’t mind seeing the config screen pop up for a bit on startup. That’s because in addition to setting the program to autostart, I also started a script file called deckboard-tidy.sh:


#!/bin/bash
sleep 5
wmctrl -c deckboard

In other words, wait for the program to start and then close its window. It still stays running in the systemtray. You could also tell Deckboard not to load itself and then do the whole loading operation in this script. You can probably pull the same stunt on other desktops, but the details will depend on your setup.

Honestly, this is a hack that is more useful than it is difficult. But you can spend a lot of time tweaking that perfect setup. But it makes that old phone something you can use every day.

If you prefer a more rigorous hack, check out FreeDeck. Not that that’s the only one out there. If you want a really useful hack, it would be nice to reverse engineer Deckboard’s TCP protocol so we could have a Raspberry Pi server for this.



from iphone hacks – Hackaday

Thursday, July 14, 2022

Building a Better 3D Scanner With an iPhone, and Making Art

Apple’s FaceID system uses infrared depth-sensing technology to authenticate people via their faces. It can also be used for simple 3D scanning, and [Scott Yu-Jan] found a better way to do that.

The main problem with using an iPhone as a 3D scanner in this manner is that the sensor is built into the front side of the device. It’s great for scanning your own face, but if you’re trying to scan an object, you can no longer see the iPhone’s screen. [Scott] solved this problem by slapping together a handheld 3D printed device to hold the iPhone along with an external monitor. This allowed Scott to scan while still seeing what was going on.

Having noticed that some of the 3D scanning apps produced strange, glitchy results when scanning faces, [Scott] decided to innovate artistically. He employed [Andrea] to model, took some scans, and Photoshopped the results into some impressive posters.

Overall, [Scott] demonstrates that it’s relatively easy to repurposed the iPhone for improved 3D scanning. With a simple design, he has a handheld scanner that works way better than just the phone on its own. Alternatively, consider getting into photogrammetry instead.



from iphone hacks – Hackaday

Sunday, June 12, 2022

Boot Mainline Linux On Apple A7, A8 and A8X devices

iPhone 6 with Linux boot log on its screen

[Konrad Dybcio] tells about his journey booting Linux on A7/8/8X processors, playing around with an old iPhone 5 he’s got in a drawer. It’s been a two-year “revisit every now and then” journey, motivationally fueled by the things like Linux on M1 Macs announcement. In the end, what we have here is a way to boot mainline Linux on a few less-than-modern but still very usable iPhones, and a fun story about getting there.

[Konrad]’s work is based on the Sandcastle project research, but he couldn’t quite figure out how to make their code work, and had to make sense of it as he went. At some point, he got stuck on enabling the MMU, which was the main roadblock for a while. Joined by another developer intrigued by Apple hardware, they were hacking away at it, developing tools and neat tricks on their way, but to no avail. With the framebuffer accessible and no other decent debugging methods in sight, he tells about a code snippet they wrote that printed register values as valid barcodes

Then, looking deeper into the known-working code, he realized that there was a single line difference in how they loaded the Linux image. Fixing that, they got the MMU to enable! From here, the Linux hacking part ensued, and still continues, with other people pulling their old iDevices out of their respective drawers and joining in on the fun. Integration work is ongoing, with basic peripherals being brought up. Some of the peripherals, we might not see working anytime soon, but from here, it should be way easier to develop drivers and conquer these devices one-by-one.

This development should work for iPhone 5S, 6 and 6 Plus, iPod touch 6th gen, as well as iPad Air 1/2 and iPad Mini 2/3/4. Would you like to boot Linux on one of these devices in your posession? [Konrad] shares instructions on how to get your device from zero to a Linux bootlog on the screen; assistance is available but Linux experience is desired! If you do decide to play around with your own old iDevice, you should spend a minute or two helping him along the way – he is collecting ADT files from different iDevices, and instructions for providing one are super simple!

We haven’t seen Linux on an iPhone in a while – most such hacks come from 2008 or so, dying down a bit afterwards with only a few cool things like PostmarketOS on the iPhone 7 appearing here and there. However, we hope that this brings our smartphones a bit closer to our personal computers when it comes to usefulness.

We thank [Matthew Carlson] for sharing this with us!



from iphone hacks – Hackaday

Friday, May 27, 2022

The Huge Apple Toolkit For Fixing Your iPhone

It’s been a frequent criticism of Apple, that their products are difficult to repair. They’ve hit back with a self-repair program for iPhones, and should you wish to take advantage of it they will hire you a tool kit. Not the iFixit box you might expect, instead they give you two hefty suitcases that contain 36 Kg of tools and equipment. Yes, you can repair an iPhone, but they ensure that it’s not for the faint-hearted.

In the kit is an impressive array of everything you might need for your iDevice, including the proper heat plate and press for the job. None of that messing about with a hot air gun for your $49 rental cost and $1200 if you don’t return the tools, but it remains an impossibly difficult and expensive process for all but the most dedicated of Apple fanboy technicians.

The sense from the Verge article is that Apple have had their arm twisted to the extent that they must provide a repair option, but they’ve gone to extravagant lengths to make it something nobody in their right mind would pursue. There’s an attraction in the idea of playing with a fully-equipped Apple repair kit for a few days, but maybe it’s not worth the cost.

Even without the Apple toolkit, it’s still possible to upgrade your iPhone.

Thanks [Nikolai Ivanov] for the tip.



from iphone hacks – Hackaday

Saturday, December 4, 2021

Make Your Own BLE-Enabled iOS App From Scratch

iPhone pictured with a lock

Even those readers who are most skeptical of Apple products will like this Bluetooth Low Energy (BLE)-enabled iOS app tutorial from [Akio].

With everything being “connected” these days smartphone applications are of course a ubiquitous part of our existence. We’ve seen plenty of examples connecting your Bluetooth-enabled projects to an Android device, but comparatively fewer tutorials for connecting to iOS devices. This mostly has to do with Android’s much larger market share and also Android’s more open-source friendly business model. Nevertheless, if you do much IoT development either as a hobby or professionally, then you probably find yourself interacting with Apple devices more than you like to admit.

[Akio’s] app is essentially updating a chart, in real-time, with data read from an Adafruit nRF52832 Feather board. He then walks you through all the basics of creating a user interface (UI) using Apple’s Storyboard interface, a simple drag-and-drop scheme similar to something you’ve probably used in many other contexts. [Akio] shows readers how to add buttons for allowing users to interact with the app, labels for displaying data to the user, as well as walks you through Apple’s odd methodology of connecting UI elements to code using IBAction and IBOutlets. The highlight of his tutorial is showing readers how to add charts to their iOS apps which seems to take a few more steps than you might imagine.

[Akio] does a really good job detailing all the relevant functions so that readers will hopefully understand what each piece of the code is doing. And we really enjoyed him adding individual video tutorials for some of the trickier programming steps. He also readily admits that some folks may opt to develop their UI exclusively in code as opposed to the Storyboard but he argues that the Storyboard is still important for beginners and is really handy when the UI is fairly simple.

Of course, in true open-source fashion, [Akio] provides all his code on his GitHub repository so you can clone the repo and run the code yourself as well as credit some of the resources he used while making his app. Two things we really love to see. Hopefully, [Akio’s] tutorial will make connecting to iOS devices seem much less onerous than it once was.



from iphone hacks – Hackaday

Friday, September 18, 2020

Listening To An iPhone With AM Radio

Electronic devices can be surprisingly leaky, often spraying out information for anyone close by to receive. [Docter Cube] has found another such leak, this time with the speakers in iPhones. While repairing an old AM radio and listening to a podcast on his iPhone, he discovered that the radio was receiving audio the from his iPhone when tuned to 950-970kHz.

[Docter Cube] states that he was able to receive the audio signal up to 20 feet away. A number of people responded to the tweet with video and test results from different phones. It appears that iPhones 7 to 10 are affected, and there is at least one report for a Motorola Android phone. The amplifier circuit of the speaker appears to be the most likely culprit, with some reports saying that the volume setting had a big impact. With the short range the security risk should be minor, although we would be interested to see the results of testing with higher gain antennas. It is also likely that the emission levels still fall within FCC Part 15 limits.

 

The phenomenon of electronics leaking unintended information in magnetic waves has been knows since WW2, and it even has a codename, TEMPEST. If you want to learn more about it and do some experimentation, there are a number of open source software toolkits you can play with.



from iphone hacks – Hackaday

Friday, December 27, 2019

Apple HomeKit Accessory Development Kit Gets More Accessible

Every tech monopoly has their own proprietary smart home standard; how better to lock in your customers than to literally build a particular solution into their homes? Among the these players Apple is traditionally regarded as the most secretive, a title it has earned with decades of closed standards and proprietary solutions. This reputation is becoming progressively less deserved when it comes to HomeKit, their smart home gadget connectivity solution. In 2017 they took a big step forward and removed the need for a separate authentication chip in order to interact with HomeKit. Last week they took another and released a big chunk of their HomeKit Accessory Development Kit (ADK) as well. If you’re surprised not to have heard sooner, that might be because it was combined the the even bigger news about Apple, Amazon, the Zigbee Alliance, and more working together on more open, interoperable home IoT standards. Check back in 2030 to see how that is shaping up.

“The HomeKit ADK implements key components of the HomeKit Accessory Protocol (HAP), which embodies the core principles Apple brings to smart home technology: security, privacy, and reliability.”
– A descriptive gem from the README

Apple’s previous loosening-of-restrictions allowed people to begin building devices which could interact natively with their iOS devices without requiring a specific Apple-sold “auth chip” to authenticate them. This meant existing commercial devices could become HomeKit enabled with an OTA, and hobbyists could interact in sanctioned, non-hacky ways. Part of this was a release of the (non-commercial) HomeKit specification itself, which is available here (with Apple developer sign in, and license agreement).

Despite many breathless mentions in the press release it’s hard to tell what the ADK actually is. The README and documentation directory are devoid of answers, but spelunking through the rest of the GitHub repo gives us an idea. It consists of two primary parts, the HomeKit Accessory Protocol itself and the Platform Abstraction Layer. Together the HAP implements HomeKit itself, and the PAL is the wrapper that lets you plug it into a new system. It’s quite a meaty piece of software; the HAP’s main header is a grueling 4500 lines long, and it doesn’t take much searching to find some fear-inspiring 50 line preprocessor macros. This is a great start, but frankly we think it will take significantly more documentation to make the ADK accessible to all.

If it wasn’t obvious, most of the tools above are carefully licensed by Apple and intended for non-commercial use. While we absolutely appreciate the chance to get our hands on interfaces like this, we’re sure many will quibble over if this really counts as “open source” or not (it’s licensed as Apache 2.0). We’ll leave that for you in the comments.



from iphone hacks – Hackaday