Audio remote control via SMS using a Nokia smartphone

Although this page was written with reference to the E-Stim systems 2B electro box, it's applicable to any box that has an audio input. All you need is a spare old mobile phone, and you too can control the electro box remotely, via text message.

A piece of software on the mobile phone listens for commands in text messages. When it sees one, it then plays one of three different audio files stored on the phone - these are tracks taken from the CD that accompanies that 2B, but could be anything that works well for you. The box is set in audio mode, and so is triggered when the music is played.

I set up three trigger words - 'short' 'medium' and 'long'; the first corresponds to an audio track of about 18 seconds, the second around two minutes and the long track is about five minutes.

A cheap PAYG SIM is in the phone - an old Nokia N95 in my case, but any phone with Symbian will work - and when it receives a text message, it checks for the appopriate word; if found, it replies with the same word, so the controller has confirmation their message got through, then it starts playing the associated audio file. When the playback has finished, it sends the message "complete" and waits for another text message.

It's possible to send a series of messages, and the program will loop through them all one by one, so there wouldn't be much gap between playbacks.

Why?

Well, though not as compact as a dedicated remote-control e-Stim system, this also isn't limited by distance. If you could fit the phone and the estim unit in a backpack or pocket of some combats, you could use it in a club, allowing the controller to stimulate (or perhaps summon) the person wearing the unit. Or, as I've done before, if you're waiting for someone to arrive for a scene, you can get yourself ready, and they can send text messages along the way to warm you up, as it were.

Pros and cons

There are drawbacks to this, of course, as well as advantages. On the plus side, it means you don't need continuous connection to a network - as long as there's phone coverage you can do this. So it will work more or less anywhere. The main drawback is that, beyond selecting which audio file is played, and when, the controller doesn't have any more control - the person with the box could turn the levels right down, for example, which might rather defeat the point. But, if you trust them not to, then you can have a lot of fun with this.

How it works and what you need

First, get your stim unit, and experiment with the audio files that you like. Pick three of them of different lengths, or intensities, or whatever you like. I say three, because that's a handy number - you could change the software to have as many as you like.

Then, find a mobile phone. I'm using an old Nokia N95, which runs the Symbian OS. It's what I had lying around, and it's very flexible. My original thought was to simply have two sound files, using one for the ring tone, and one for the test message tone. That won't work satisfactorily, though, since ringing tones and message tones are always played through the speaker, even if you have headphones plugged in, and the volume through the headphone socket isn't as high as it needs to be. Play the sound through the phone's music player, though, and everything is perfect. So, the task is how to arrange that remotely.

The answer I've come up with is a programming system for Symbian called M-Shell. As of July 2017, it could still be downloaded here. This is a scripting language - you install it on your phone, then write scripts to control the phone's behaviour. My script is called AudioRemote, and it's pretty simple.


/*
 A very simple m SMS
 service to play audio files
*/
use sms
use audio

stim=["short" : "e:\\estim\\07.mp3",
      "medium" : "e:\\estim\\11.mp3",
      "long" : "e:\\estim\\06.mp3"];

while true do
 print "Waiting...";
 n=sms.receive();
 m=sms.get(n);
 t=lower(trim(m["text"]));
 if stim[t] #null then
   sms.send(m["sender"], t);
   audio.volume(100);
   audio.play(stim[t]);
   print  t, " trigger";
   while audio.busy() do
    sleep(500)
   end;
   print "complete";
   sms.send(m["sender"], "complete");
 end;
end      
      
      
      

It loops through text messages. The stim array has a list of keywords, and the matching files in the Nokia's storage. When a new message is found, the code trims spaces, converts to lower case, and looks for an entry in the stim array that matches. If it finds one if stim[t] #null then it responds to the sender with the same word, and plays the appropriate file, and displays "long trigger" or whatever on the display. The audio.busy loop checks to see if the file is still playing, and when it's complete, sends another message back to the sender.

As long as you don't get one word text messages from anyone else containing the words in the stim array, other messages will be ignored by the script.

There are some things to beware of - you should edit the phone settings substantially, for best effect - turn keypad tones, warning tones, ring tones and sms tones off. Although they won't all be very loud, they will cause unexpected audio, and you don't want that. Who wants a shock in their balls just because someone's trying to convince you to claim for an accident you didn't have, after all?

Back to the tech page