Get WiFi Bot Control on Google Play

Wifi Bot ControlMasterFeatureGraphic1024x500New is an Android app that allows you to remotely control a robot (or other device) via WiFi.  You can also (optional) view a video stream from an IP camera mounted to the robot.  WiFi Bot Control also provides up to 8 additional customizable command buttons that allow you to perform additional tasks on your robot / device.  You could use these commands to initiate other activities such as enabling/disabling sensors, moving other servos / arms / picking something up, turning a LED on/off etc.  With the provided sample sketch, you can customize the robot to do what you want.  Note: WiFiBot Control is no longer available or supported.  There are other options that can serve a similar purpose.  Have a look at Blynk.  Thanks for those that supported in the past.



  • Uses WiFi only to control the robot and view the IP Camera stream
  • Configurable camera URLs (up to 3)
  • 3 Joystick Modes: Default, Simple Mode and Orientation Sensor
  • Supports up to 8 additional commands via Command Buttons.
  • Configurable WiFi packet interval.
  • Supports a number of micro controllers – requires WiFi module/capabilities.
  • Sample Arduino sketch provided (below link).
  • Screen automatically re-sizes for smaller phones.
  • Works with most any microcontroller that is WiFi capable (shields, Spark Core (in testing), etc)

Update March 2017:  I’ve posted how to get WiFi Bot Control working with a NodeMCU (ESP8266). This removes the need for a separate webserver and JSON data. Check it out.  

What You Need

WiFi Bot Control is an Android app that allows you to control a device, presumably a robot.  For the sake of this write-up, it’s an Arduino robot using an Adafruit CC3000 WiFi module and a Digistump + Motor Shield.  However, you should be able to use most other WiFi shields and motor drivers.    WiFi Bot Control is pretty much useless on it’s own, but if you’ve read this far, you probably understand that this is a purpose-specific app.  Essentially, the system consists of the controlling device (your Android phone + WiFi Bot Control), an intermediate data interpreter/server (a webserver – or your local computer) and a robot of course.  Details on the different pieces are documented below.  This should provide you with sufficient info should you want to build one yourself.  Details on where to source the components are also below.

** If you are looking to use Bluetooth to control your robot, also check out BT Bot Control.  Also note that because the Android app links directly to your robot via Bluetooth,this is a faster method of control.  However, it is limited to approx 10 meters (Bluetooth limitation).

How to Use It

WiFi Bot Control consists of 3 main components:

  1. The WiFi Bot Control Android application for your tablet/phone.
  2. A robot – this could be anything as long as it has WiFi capability. For the purpose of this tutorial / build, I used an Arduino Nano with an Adafruit CC3000.  All samples are based on these components.
  3. A webserver.  The purpose of the webserver is to act as a go between the robot and WiFi Bot Control.  It interpretss the commands sent by WiFi Bot Control, and provide a file by which the robot can read to determine commands being sent to it.    This webserver can be part of your robot, or can be a separate server. However update speed becomes an issue if this server is remote, so keep this in mind.  By now, it may be possible that the Adafruit CC3000 libraries have enabled the local webserver and you can modify the code to allow for the updating of the files within the robot.  Drop me a line if you managed to get this working and I can add details for others to follow.  Note:  You have to have access to a webserver.  References to “” should be replaced with the URL of your server.

WiFi Bot Control – Joystick Modes:

Default Joystick Mode:

When you move the joystick, x and y coordinates are packaged into a configurable URL string and transmitted. The following is a sample URL where the x value is 22 and y value is 44. Note the URLmode value is 1. This information is parsed into a json file and then read from the Arduino robot / device.

Simple Joystick Mode:

In Simple mode, the joystick has 4 arrows representing Forward (U), Reverse (D), Left (L) and Right (R). When you tap the arrows, the respective character is packaged into the URLudlr value and the URL string is transmitted. Tapping the center or releasing a button sends an S value (stop). Tapping the Up arrow would look like this:

Command Mode:

You can add custom features to your robot / device with additional commands and customize the sample sketch provided. When a Command button is clicked, a value (1-8) is passed to the URLcmdVal variable. (i.e. Command Button #4 sends URLcmd=4) Also note the URLMode value passed is 3. Below is a sample URL string:

WiFi Bot Control – Settings Screen:

  • You can set the WiFi send delay in the settings.  The default of 200 ms is sufficient.
  • Enter the URL that points to the server and location of the php file that updates the state of the json file (updatestatenew.json)  Here’s a sample of the URL with the part you enter in orange:
  •  (enter the orange part in WiFi Bot Control and the rest of it is created by WiFi Bot Control)
  • Debug: Show URL Data String Being Sent allows you to see the content being parsed into the URL on the main screen (at the top).
  • The other features are pretty self-explanatory.

WiFi Bot Control – IP Cam Config Screen:

This app uses the same approach for viewing an IP Camera stream as BT Bot Control.  Detail can be found in the instructions. Also see the FAQ section below.

Server Components & 

At the time of this writing, there wasn’t a library to allow the Adafruit CC3000 to act as a server and process data requests directly.  Instead, I implemented a fork of this sample (thanks and credit Marc-Olivier Schwartz).  The basic idea is that when using WiFi Bot Control, the app constantly sends a URL request to a PHP file on a server (or a computer with a webserver on it).  The request contains updates to the x/y/command values (samples below).  The PHP file is called and populates the data file.  This is whole process is done rapidly from WiFi Bot Control.  At the same time the robot (sketch sample below) is constantly polling the server and calling a PHP file that parses the JSON file for the data contents.  It extracts the variables and uses them to drive the motors or act on commands.

You can host the server locally or remotely.  It must also have PHP on it, and write permissions to the JSON file(s).  On the Arduino side, the sketch points to the server IP address.  On the Android side, it can be the URL or the IP address of the server.  Note, if you are doing this within your own personal environment, you will have to ensure that the necessary port (usually 80) is open.  Also, the PHP file needs write permission on the json file(s).

Remote Control Only Files (can be downloaded below):

  • updatestate.php – this file is called from WiFi Bot Control to update robotstate.json with updated values from the joystick / command buttons
  • robotstate.json – this file contains the actions for the robot.  This file must be writeable by the IUSR web account of your webserver.  Example contents:  {“mode”:”1″,”xval”:”0″,”yval”:”0″,”udlr”:””,”cmdVal”:””}
  • server.php – this file is called from the Arduino robot and parses the json file (robotState.json for this example)
  • Be sure to check out the demo from the Adafruit Learning System.
  • Server files for this sample can be downloaded at the bottom of this post.

Remote Control & Read Arduino Data Files (download at bottom):

WiFi Bot Control has a feature (in Settings) to enable reading of data pushed from your Arduino device.  In addition to the above files, use the below files for reading sensor data.  The latest sketch (below) has a sample to show how to do this.  The below files are needed on the server to receive the request from the Arduino, process the results and also allow WiFi Bot Control to request them.  Details:

  • arduinoPush.php – This file is called from the sketch and populates the results in the json file (below).  You can add as many fields as you like here.  You must also update the URL request in the sketch to match.  The current sample is setup to write numeric values (i.e  {“result1″:null,”result2”:3333}).  To write text values, arduinoPush.php has to be modified to write value as text (i.e. {“result1″:”testA”,”result2″:”testB”})
  • arduinoPushResults.json – This file contains the sensor and other readings from the Arduino device.  Note – this file must be writable by the IUSR web account of your webserver.  The file also read from WiFi Bot Control.
  • androidPull.php – WiFi Bot Control uses this file to parse and read the json file (above) and use it to display sensor and other reading results.

To use this feature, go to Settings and select Enable Sensor / Data Polling.  Then, configure if you want to use manual or timer-based polling.  The value for Polling URL tells WiFi Bot Control where the androidPull.php file is.  You can also configure custom titles for each data element passed.  To do this, enter the titles you want to use in the Result Titles box with a comma “,” separating each.  For example, if you have 2 values that you want to display, you could enter:   “Temperature C =, Humidity =” (without the quotes).  If you choose not to enter any values, it will simply display as “Result1= Result2= etc“.

Arduino Robot – Say Hi to Eddie

Eddie is comprised of a mix of Arduino Nano, LEGO components as well as an IP Camera.  The Nano uses the Adafruit CC3000 WiFi unit to talk to the server. Buried below is a power supply drive by 2x 18650 LiIon batteries (series @ 7.2v) as well as a power supply that drops the power to 3.5v for the IPCam and 5V for the Nano and CC3000.

What equipment is needed?

WiFi Bot Control talk to a robot that you can build.  Here’s a breakdown of the main parts required:

  • Arduino Nano (or other Arduino controller with sufficient Analog and Digital ports – i.e. the Uno)
  • Voltage Regulator Module
  • Adafuit CC3000 WiFi module, Spark Core**, or Arduino WiFi shield.  (** – will need to validate this once my Spark arrives).
  • Digistump Motor Shield (most any motor controller will work).
  • Robot
  • IP camera (optional).
  • Motors – I used a set of these cheap servo’s.  You will have to mod them by removing the position sensor tabs on one of the gears inside. An easy mod for most. There are also continuous rotation servo’s out there if you are not into modding.  
  • Batteries – for the robot, I used 2x 18650 batteries wired in series to provide 7.2V to the voltage regulator. From there, I push 5V to the various Arduino components, motor shield and the CC3000.  The motor shield provides the power to the servos. The Digistump unit supports up to 15V 3.x Amps combined, so you can use more powerful motors.
  • I also added a small blue LED to serve as a status light.  It blinks with data communications between the robot and the server.  I also suggest another LED that comes on once the CC3000 has established a connection. Maybe muti-coloured to show different connection states as the unit takes some time to get connected initially.
  • You will need a webserver as well.

The CC3000 and motor shield are connected to the Arduino Nano (pinouts below). The sample Arduino sketch provides a fully functioning application based on the base build. You can also add customize the sketch to your liking as well as enable features that can be used by the 8 custom command buttons.

Arduino Controller Pin-outs

Connections between the various modules and the Arduino Nano are as follows.   Not shown are the DC step down linear regulator.



Arduino Sketch:

The below Arduino sketch is based on the original robot used with WiFi Bot Control.  It can be used as-is if you build the same controller and want the same functionality as described here.  However, the expectation is you have experience with Arduino coding and plan on customizing it to suit your needs.  

** be sure to subscribe for update as the below sample code may change. See top right.

Latest Jan 2 2014:  WiFi Bot Control Sketch

  • If you downloaded the above sketch before Dec 10/13 and are having issues, download this one and try it. It has an Idle Time-out parameter that provides stability of your server closes it’s connection too fast.
  • Simplified motor driving function – (can do with further tweaking)
  • Added sample to demonstrate sending sensor and other data to WiFi Bot Control (must have the latest version of WiFi Bot Control)

Earlier Version: WiFi Bot Control Demo Sketch

Server Files:

Download these files if you are only using WiFi Bot Control as a remote:  ServerFiles

Download these files if you are using WiFi Bot Control as both a remote and also reading data from your robot:  ServerFilesSensorRead

WiFi Bot Control - FAQ

BT Bot Control vs WiFi Bot Control – Which is faster?

Although the function of both these apps is the same, there are some underlying differences that are important to making your decision on which route to go.  In general, BT Bot Control is faster in getting joystick commands to the robot. This is inherent in the design as it uses a direct link over Bluetooth between the Android device and your robot.  WiFi Bot Control is slower as the commands have to a) share traffic with your WiFi network (this includes your IP camera stream), and b) are first sent to a server, and then to the robot.  This is mitigated somewhat with the introduction of WiFi-enabled Arduino devices such as the Spark Core and Adafruit CC3000).   However, if you do not have one of these devices, you would need to use a server with a webserver.   BT Bot Control is also easier to set-up and configure.  Once you have a Bluetooth connection, the sketch can interpret the commands.  With WiFi Bot Control, there is the intermediary JSON configuration on the server side.

Posted in: BTBotControl - FAQ, WiFi Bot Control - FAQ

Configure IP Camera for Viewing

If you are having issues viewing a direct video stream from your IP camera  (i.e. is not working), have a look at this site to see what varying modes your IP Camera has (be sure to search for your camera).   If none of these work, you can setup a webpage to auto-refresh your camera in snapshot mode and then use the URL to the website in BT Bot Control / WiFi Bot Control.  First, you must find the URL that your camera uses to view a snapshot.


  1. You need a website – either a personal or access to a remote webserver / website where you can put some files.  In this case, we will assume you have a personal webserver and use the following URL
  2. Note:  If you are setting this up on an internal server, you can refer to internal IP addresses (i.e. 192.168.x.x). However, if you are hosting the page externally, you will have to a) enable port forwarding from an external IP to your camera and b) refer to the camera (within the file below) by your network’s external IP and port #.  For this example, all references will assume you have a personal webserver and the IPs are internal.
  3. Download these files and place at the root of the website you want to use.
  4. Open default.htm.
  5. You will need to change only the highlighted parts to the full URL that will be used to take a single snapshot image from your IP Camera.  Before moving on, be sure that you are able to see a snapshot within your PC’s browser window.
  6. Once complete, call the file in your web browser (not BT Bot Control / WiFi Bot Control).  Make sure you see the snapshot image and it should be refreshing.  The refresh rate is configurable at the bottom (currently set to 100 ms). If it works here, then you can plug this URL into BT Bot Control / WiFi Bot Control and you should be able to see the video stream.
  7. Note – don’t expect fluid video here folks. This is a crude approach to getting video streaming working in these apps.  Also note that this is not a limitation of BT Bot Control / WiFi Bot Control but rather the web control implementation from Android.

Video Stream Sample HTML

Posted in: BTBotControl - FAQ, WiFi Bot Control - FAQ

Adding IP Camera URLs

Camera Options:

For this project, I used the Ai-Ball tiny IPCam.  However, take my word for it, it’s a waste of money and a battery pig. It’s only advantage is that it’s small.    If you are using the Ai-Ball or other similar webcam, the configuration is as noted below.  If you have a spare phone laying around that has a camera,  I suggest you get IP Webcam from Google Play.  This  great little app allows you to turn your mobile phone into a webcam and access its video stream.  The full screen streaming Javascript seems to work best.  Give it a try – use your local IP address:  http://192.168.x.x:8080/jsfs.html (check IP Webcam settings).


  • You have an IPCamera that is configured and can be viewed in your web browser.
  • You have the URL, username and password (if necessary) to access the IP camera.
  • If you are viewing your IP camera outside your network, you will have to setup a dynamic DNS service and/or port forwarding to remotely access it. 
  • Click the Camera settings icon in the menu and setup your camera URL (see below)
  • Enter the camera URL, click add, and check the button beside the camera you want to view.
  • You can enter and store up to 3 cameras.

IP Cam Setup

Posted in: BTBotControl - FAQ, WiFi Bot Control - FAQ

Configure IP Camera – Alternate Approaches

If you are having troubles setting up your IP Camera,the following are some approaches that may (or may not) work for your camera.  Some of these are specific to certain camera manufacturers:

1) Generic interface to Foscam IP Cameras.  You could build a webpage that displays the camera and then refer to the webpage URL in WiFi Bot Control / BT Bot Control.  Once done, then use the URL you use to access the webpage in the apps.

2) Interface to Foscam H.264 Cameras.  .. Right click this link, save to your website folder and edit the IP/PORT, user and password. Test in your browser befor adding the URL to the apps.

3) Check this site and search for your camera.  It will show you various ways to get access to direct stream and snapshot modes for IP Cameras

Posted in: BTBotControl - FAQ, WiFi Bot Control - FAQ

How to tell if WiFi Bot Control is sending data correctly?

WiFi Bot Control sends joystick and command data through a configurable URL.  You configure the main part of the URL (ie.  Don’t forget the “?”, as it won’t work without it.  To test this out, there is a really easy solution.  

  • Open robotstatenew.json (or whatever you called the file that is written to by updatestatenew.php) in a text editor such as Notepad++.  Ensure that your Android device is connected to the network and proceed to use the joystick.
  • WiFi Bot Control should return a status of 200 (bottom) constantly. This means its reaching the PHP file (updatestatenew.php) based on the server URL you defined.  
  • Next step is to look at the json file in Notepad++.  If you click another window, then click back to Notepad++, it should alert you that the file contents have changed and ask you to reload it. Do it, and you should see the values have changed.  

Also note, that you should see the values for x and y go back to 0 if you remove your finger from the joystick.  This is by design.  To see actual values, keep moving the joystick while performing the above activities.

Posted in: WiFi Bot Control - FAQ

Understanding the Refresh and Connection Status Buttons

WiFi Bot Control has 2 may web components:

** This page is outdated.  Update coming.


There’s  the IP Camera Viewer that you see on the main screen to the left, and then there’s a Web Component that is a background service that processes the joystick and command buttons.  The Web Component is not visible and has nothing to do with the IP Camera Ciewer, so don’t get them confused – they are completely separate.

IP Cam Viewer – Use the Settings to setup a pointer to your IP Camera.  Once this is done, you should see the video stream in the viewer.  The Cam URL button (shown bottom left in picture below) simply refreshes the Camera URL.  

The Web Component sends commands to the robot.   This value is set in the Settings, and the rest of it is constructed to make a complete URL (see above for samples).  When moving the joystick or sending commands, the values are parsed into the URL string and a background call is made to the Web Component.  You can view real-time update of this by going into Settings and checking the option (“Debug….”) to view the URL as its being created and sent.  It will appear at the top.  If there is a problem with the URL, the Response Code value (shown at the bottom – pic below) will update with an error code (usually 1101).  Clicking the [view] link will pop up a message showing you the last URL that was sent. Note – you should expect to see 0’s in X and Y values as the joystick always moves back to zero.  If you are experiencing errors and you have verified that your devices is connected, check your URL carefully.  You may even want to re-create the same URL on your PC browser to test it to ensure it is correct. It’s most likely that something is wrong with the core URL part you set in Settings.

The Connection Status button at the top (pic below) is simply to test your Internet connection.  It tries to connect to  If it fails, there will be an error in the Response Code section at the bottom that you can view. If this is failing, its most likely your WiFi connection is down.  Also note that clicking this button will not load into the IP Cam viewer as this is configured to point to the URL you defined for your IP Camera. It a completely separate component.  Note, if it fails the first time, give it a few more tries as sometimes it has a brain fart.

URL and Cam Responses

Posted in: WiFi Bot Control - FAQ