Estim Control 4 iOS

e4i logoWhile my app for Android is a powerful and flexible way to control your 2B, and can even work as a server, when it comes to the iPhone, things are rather different. It's not possible to connect an iPhone directly to a 2B, because iPhones don't support USB serial accessories in the same way as Android. Nor is it as simple to use a Bluetooth connection, becase again, Apple doesn't support the traditional Serial Port Profile (SPP) used by many low cost Bluetooth adaptors, like the one I talk about here. The iPhone does have Bluetooth, but it's Bluetooth LE, which communicates in a completely different way. And while there are adaptors that you could use to link to a 2B, each one works slightly differently, and so if I built an app around one, you'd only be able to build an 2B Bluetooth adaptor using the same chip from the same manufacturer. If you found a different chip, it wouldn't work, unless I made an adapted version of the app for it. In short, it's a massive pain.

So, bearing that in mind, Estim Control 4 iOS is a much smaller project than my Android app. It is not designed to connect directly to a 2B at all; instead it is designed as a client app that can talk to one of my others, and through that to a 2B. So, in addition to an iPhone and the app, it also needs

  • An Estim Systems 2B, connected to
  • a PC running Windows, Mac, or Linux, running Estim Control/Server version 2.4.5 or above OR
  • an Android device, running estim4android version 2.45 or above

So far, the app has the following functionality (as of 28th Sept 2017)

  • Discover a 2B on the same network, provided it's in slave mode and connected to version 2.45 or above of one of my apps
  • Connect to StimBroker and display available users, to request a connection
  • Control basic functions (output levels, mode, power) of a 2B via StimBroker or a direct connection on the local network
  • Tested on iOS 10

Potential future enhancements

  • Access stored favourites on the app connected to the 2B
  • Save favourite settings
  • Add timers for ramping up / down over a specifie period
  • Messaging between master & slave users
  • Access the random and sequence playback features of ECS
  • Automatically detect StimBroker LiveStim links, so the app can connect by following a link, eg on Twitter
  • Compatibility with iOS 11

The app is not yet available in the App Store, as it is very much a work in progress. If you are interested in finding out more, please get in touch. I'm keen to hear what other features you might like, and how you would envisage using an app like this. Note that if you want to test, you need to really test - the number of devices I can add as testers is limited by Apple. I will also need to know the unique identifier of your device, so it can be added to the test list.

A quick guide to the iPhone app so far

Connection settings

The first image shows the Connection Settings screen of the app, reached via the cog at top right of the main screen.. I've made this as simple as possible. There's no need to worry about things like IP addresses. The WiFi option is for connecting to an app running on the same network. Either ECS or estim4android will be automatically detected when you tap the Connect button.

If you want to use StimBroker, you just need to enter your user ID and PIN in the boxes provided, then click Connect.

Connection accepted

When the connection to a remote estim unit has been made, you'll see this notifcation pop-up, and the screen will change to the main one, which you can see behind the notification. The pop-up will disappear after a few seconds, or it you tap the OK button. To close the connection, long tap on the STOP button. The connection will be closed, but the estim unit will carry on at the previously selected settings - if you want to turn the outputs off, tap STOP first, then long tap to disconnect. Otherwise, it will continue until the timeout period is reached.

If a connection can't be made, you'll see a similar notification, with the reason, and the colour will be either amber or red, depending on the warning.

Connected

This shows the main screen when you're connected, in this case via a StimBroker connection. For now, the controls are limited, essentially to what you have on the box itself - power, A and B channel levels, plus the feel of the pulses. The display will usually update in real time too - if the user with the 2B turns the knobs, you should see the iPhone update.

When you're not connected, the STOP button is labelled Connect, and will attempt to reconnect using whatever has been set on the Connection Settings page

 

StimBroker users

If the connection type is StimBroker, then when you tap Connect, the list of currently available users will be displayed, like this - or, if there are none signed on, a pop-up alert will invite you to try later. Otherwise, just tap on a name to request a connection. Depending on their settings, the remote user will either see a prompt asking if they want to accept your connection, or they may accept or reject it automatically.

If I add link detection to the app, for StimBroker links, those will bypass this screen, and connect you directly to the person who sent the link, if they're available.

Mode selection

To change the program mode of the connected 2B, tap the mode name between the two level indicators; the other controls will be hidden, and this picker will appear, so you can scroll through the choices. When you've selected one, then the mode will be changed and the controls will re-appear, labelled appropriately for the program.

Scanning for Estim

This is what you'll see if you're using the WiFi connection mode. The app will scan for 90 seconds, before reporting that it couldn't find an Estim server. To enable the server in ECS, just make sure the mode is set to Slave in the preferences, and the option to use StimBroker is unticked. Clicking Connect to link to the 2B automatically starts advertising the server.

In estim4android, you need to set the Connection type to USB and tick the 'Enable control via' box, then select Network. Tap Save on the settings page. The app will advertise when you tap on the Online button to link to the 2B.