The Android Linux Commander

Last time, I described how to write a simple Android app and get it talking to your code on Linux. So, of course, we need an example. Since I’ve been on something of a macropad kick lately, I decided to write a toolkit for building your own macropad using App Inventor and any sort of Linux tools you like.

I mentioned there is a server. I wrote some very basic code to exchange data with the Android device on the Linux side. The protocol is simple:

  • All messages to the ordinary Linux start with >
  • All messages to the Android device start with <
  • All messages end with a carriage return

Security

You can build the server so that it can execute arbitrary commands. Since some people will doubtlessly be upset about that, the server can also have a restrictive set of numbered commands. You can also allow those commands to take arguments or disallow them, but you have to rebuild the server with your options set.

There is a handshake at the start of communications where Android sends “>.” and the server responds “<.” to allow synchronization and any resetting to occur. Sending “>#x” runs a numbered command (where x is an integer) which could have arguments like “>#20~/todo.txt” for example, or, with no arguments, “>#20” if you just want to run the command.

If the server allows it, you can also just send an entire command line using “>>” as in: “>>vi ~/todo.txt” to start a vi session.

Continue reading “The Android Linux Commander”

Reverse Engineering A (Toy) Fire Engine

Your kid has a toy remote control fire truck. You have an RTL SDR. See where this is going? [Jacob] couldn’t resist tearing into the why and how of the truck’s remote control protocol.

The entire process began with a basic GNU Radio setup to determine the exact frequency of the signal. Then a little analysis suggested that it might be using amplitude shift keying. That is, the information is in the amplitude of the signal, where one possible amplitude is completely off in some cases.

Continue reading “Reverse Engineering A (Toy) Fire Engine”

Heart Rate Monitoring Via WiFi

Before you decide to click away, thinking we’re talking about some heart rate monitor that connects to a display using WiFi, wait! Pulse-Fi is a system that monitors heart rate using the WiFi signal itself as a measuring device. No sensor, no wires, and it works on people up to ten feet away.

Researchers at UC Santa Cruz, including a visiting high school student researcher, put together a proof of concept. Apparently, your heart rate can modify WiFi channel state information. By measuring actual heart rate and the variations in the WiFi signal, the team was able to fit data to allow for accurate heart rate prediction.

The primary device used was an ESP32, although the more expensive Raspberry Pi performed the same trick using data generated in Brazil. The Pi appeared to work better, but it is also more expensive. However, that implies that different WiFi chipsets probably need unique training, which, we suppose, makes sense.

Like you, we’ve got a lot of questions about this one — including how repeatable this is in a real-world environment. But it does make you wonder what we could use WiFi permutations to detect. Or other ubiquitous RF signals like Bluetooth.

No need for a clunky wristband. If you could sense enough things like this, maybe you could come up with a wireless polygraph.

Homebrew Tire Pressure Monitoring System

When [upir] saw that you could buy tire valve stem caps that read pressure electronically, he decided to roll his own Tire Pressure Monitoring System (TPMS) like the one found on modern cars. An ESP32 and an OLED display read the pressure values. He didn’t have a car tire on his workbench though, so he had to improvise there.

Of course, a real TPMS sensor goes inside the tire, but screwing them on the valve stem is much easier to deal with. The sensors use Bluetooth Low Energy and take tiny batteries. In theory, you’re supposed to connect to them to your phone, although two different apps failed to find the sensors. Even a BLE scanner app wouldn’t pick them up. Turns out — and this makes sense — the sensors don’t send data if there’s no pressure on them, so as not to run down the batteries. Putting pressure on them made them pop up on the scanner.

Continue reading “Homebrew Tire Pressure Monitoring System”

The Android Bluetooth Connection

Suppose someone came to talk to you and said, “I need your help. I have a Raspberry Pi-based robot and I want to develop a custom Android app to control it.” If you are like me, you’ll think about having to get the Android developer tools updated, and you’ll wonder if you remember exactly how to sign a manifest. Not an appealing thought. Sure, you can buy things off the shelf that make it easier, but then it isn’t custom, and you have to accept how it works. But it turns out that for simple things, you can use an old Google Labs project that is, surprisingly, still active and works well: MIT’s App Inventor — which, unfortunately, should have the acronym AI, but I’ll just call it Inventor to avoid confusion.

What’s Inventor? It lives in your browser. You lay out a fake phone screen using drag and drop, much like you’d use QT Designer or Visual Basic. You can switch views and attach actions using a block language sort of like Scratch. You can debug in an emulator or on your live phone wirelessly. Then, when you are ready, you can drop an APK file ready for people to download. Do you prefer an iPhone? There’s some support for it, although that’s not as mature. In particular, it appears that you can’t easily share an iPhone app with others.

Is it perfect? No, there are some quirks. But it works well and, with a little patience, can make amazingly good apps. Are they as efficient as some handcrafted masterpiece? Probably not. Does it matter? Probably not. I think it gets a bad rep because of the colorful blocks. Surely it’s made for kids. Well, honestly, it is. But it does a fine job, and just like TinkerCad or Lego, it is simple enough for kids, but you can use it to do some pretty amazing things.

Continue reading “The Android Bluetooth Connection”

Radio Apocalypse: America’s Doomsday Rocket Radios

Even in the early days of the Cold War, it quickly became apparent that simply having hundreds or even thousands of nuclear weapons would never be a sufficient deterrent to atomic attack. For nuclear weapons to be anything other than expensive ornaments, they have to be part of an engineered system that guarantees that they’ll work when they’re called upon to do so, and only then. And more importantly, your adversaries need to know that you’ve made every effort to make sure they go boom, and that they can’t interfere with that process.

In practical terms, nuclear deterrence is all about redundancy. There can be no single point of failure anywhere along the nuclear chain of command, and every system has to have a backup with multiple backups. That’s true inside every component of the system, from the warheads that form the sharp point of the spear to the systems that control and command those weapons, and especially in the systems that relay the orders that will send the missiles and bombers on their way.

When the fateful decision to push the button is made, Cold War planners had to ensure that the message got through. Even though they had a continent-wide system of radios and telephone lines that stitched together every missile launch facility and bomber base at their disposal, planners knew how fragile all that infrastructure could be, especially during a nuclear exchange. When the message absolutely, positively has to get through, you need a way to get above all that destruction, and so they came up with the Emergency Rocket Communication System, or ERCS.

Continue reading “Radio Apocalypse: America’s Doomsday Rocket Radios”

Quieting That Radio

If you are casually listening to the radio, you probably tune into a local station and with modern receivers and FM modulation, the sound quality is good. But if you are trying to listen to distant or low-powered station, there’s a lot of competition. Our modern world is awash in a soup of electronic interference. [Electronics Unmessed] tells — and shows — us how much noise can show up on a SDR setup and what simple things you can do to improve it, sometimes tremendously.

According to the video, the main culprit in these cases is the RF ground path. If you have a single antenna wire, there still has to be a ground path somewhere and that may be through the power line or through, for example, a USB cable, the host computer, and its power supply. Unsurprisingly, the computer is full of RF noise which then gets into your receiver.

Adding a counterpoise makes a marked difference. A low inductance ground connection can also help. The counterpoise, of course, won’t be perfect, so to further turn down the noise, ferrite cores go around wires to block them from being ground paths for RF.

The common cores you see are encased in plastic and allow you to snap them on. However, using a bare core and winding through it multiple times can provide better results. Again, thanks to the SDR’s display, you can see the difference this makes in his setup.

None of this is new information, of course. But the explanation is clear, and being able to see the results in a spectrum display is quite enlightening. Those cores essentially turn your wire into a choke. People think that grounding is simple, but it is anything but.

Continue reading “Quieting That Radio”