Standalone Arduino Server (ESP8266) with mobile client for iOS and Android

Hello,

I was wondering if you could help me finding the right solution for the problem I have.

I would like to be able to see on my phone (Android and iOS) some data (temperature, water flow etc.) coming from sensors. Sensors are connected to the arduino and will be located in a boat with no internet connexion.

Constraints:

  • No Internet connexion
  • Works on both Android and iOS
  • No Mobile Data disruption while checking sensors values
  • Working Wirelessly

Solutions that I have in mind:

  • ESP8266 in Soft Access point mode capable of handling Rest calls in Wifi
    This is a working solution as it will work on both Android and iOs with the usual browser. However, the problem I have is that whenever I connect the phone to the Arduino's WiFi network, Android stops using the data connection and tries to use the local WiFi to serve internet pages and applications, which doesn't work because the Arduino is not connected to the internet. Is there a way to be connected to a limited WiFi network and still use the mobile carrier's data connection? If not, do I have to forget about connecting via WiFi and live to e.g. Bluetooth between my phone and the Arduino?
  • Usage of an app like Blynk or Virtuino. I think Blynk would work. However, it required a Local server to install Blynk Server. Virtuino only works on android :frowning: Maybe you have any other app in mind ?
  • Develop an app with Unity capable of sending request(in Bluetooth?) to the arduino App. However I am not sure we can develop a iOS Unity App without a Mac
  • Develop two clients for both android and iOs using Bluetooth. Hard work and probably need a Mac

I would love to have your feedback

Thank you very much

I've found this to be really useful http://remotexy.com/, it has a graph function now which has made it even better.

Supports Android and Ios, and supports bluetooth, wifi access point or local router (internet or non-internet connected), otg, or a cloud server (haven't tried), with a wide variety of mcu/hardware configurations

When using an ESP as an access point, the phone doesn't seem to try and take over the connection and one of my recent experiments was graphing battery voltage for days without a dropout. Remote xy has bidirectional control too, so has buttons and text fields that can send off commands/messages to the micro. I really do like it!

The gui/panels are designed on pc via the website, which makes designing front panels nice and easy, and embedded in the mcu code. Ok, one is limited by their objects and methodology (unless one knew how to do something similar), but makes getting something simple up and running quite quickly, fairly easy.

Or maybe this https://guide.openenergymonitor.org/ may be useful as a template or for certain aspects including wireless sensor transmission, and serving up webpage dashboards from rPi or ESP8266 locally. edit - incorrect, after a bit of refreshing, more correct to say use of ESP to communicate with local or remote server.

florentval:
Develop two clients for both android and iOs using Bluetooth. Hard work and probably need a Mac

I don't have experience with this, but I'm sure there are plenty of existing apps for this. No need to write your own.

Thanks a lot Azeo for your feedback. I will give a go with Remote XY

No worries, hope it's of use. One disadvantage though if using two or more concurrent phones to view the same data/gui, is the connection can't be shared, so each phone/tablet needs a corresponding ESP.

Not a problem though if data is shared between the ESPs or Arduino -ESPs by various means (udp say if separated by distance, or any method of choice, or serial if close) if any sensors are duplicated.

As an aside, but you're probably already aware, Esp's make Arduino/s redundant in many cases, and if several (and better) ADC's or more IO required, I2C ADC's and port expanders can be used.

The issue with phones switching from provider data connection to access point seems to be a common problem though when connecting to ESPs for configuration/web pages (I've seen mention of Android 6 and above?).

It hasn't been an issue for me as I'm using an old phone for telecom service, wifi and remotexy no problem, and newer phones (which are still old!) on wifi only as smart devices. I wonder if configuring ESPs as clients instead and using a wireless hub/limited network as you've suggested would help prevent this - it may be a good topology to use anyway, if the ESPs need help to extend their range on a vessel, or share data, or the other devices share data or act as a web server. Possibly the wireless network could just be used as an extender to serve up bluetooth closer to the mobile devices if they are usually beyond range of the sensor devices.

I just got a wemos d1 board with a esp8266 chip a while back and have been playing with it. The I/O capabilities seem somewhat limited, but it works. Below is basic example code that is both an access point, and a web server. When it is running, it appears as an access point on my android phone, I connect to it, and using chrome on the phone I can get the “You are connected” displayed on my phone. With this you should be able to develop a web page that will display what ever you can get the board to input. The board only has one A0 pin, and I think it is to 0.0-1.0v. That being said, ha better board with more input possibilities might fit your needs.

/*
   Copyright (c) 2015, Majenko Technologies
   All rights reserved.

   Redistribution and use in source and binary forms, with or without modification,
   are permitted provided that the following conditions are met:

 * * Redistributions of source code must retain the above copyright notice, this
     list of conditions and the following disclaimer.

 * * Redistributions in binary form must reproduce the above copyright notice, this
     list of conditions and the following disclaimer in the documentation and/or
     other materials provided with the distribution.

 * * Neither the name of Majenko Technologies nor the names of its
     contributors may be used to endorse or promote products derived from
     this software without specific prior written permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
   ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
   ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/* Create a WiFi access point and provide a web server on it. */

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>

#ifndef APSSID
#define APSSID "ESPap"
#define APPSK  "thereisnospoon"
#endif

/* Set these to your desired credentials. */
const char *ssid = APSSID;
const char *password = APPSK;

ESP8266WebServer server(80);

/* Just a little test message.  Go to http://192.168.4.1 in a web browser
   connected to this access point to see it.
*/
void handleRoot() {
  server.send(200, "text/html", "<h1>You are connected</h1>");
}

void setup() {
  delay(1000);
  Serial.begin(115200);
  Serial.println();
  Serial.print("Configuring access point...");
  /* You can remove the password parameter if you want the AP to be open. */
  WiFi.softAP(ssid, password);

  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);
  server.on("/", handleRoot);
  server.begin();
  Serial.println("HTTP server started");
}

void loop() {
  server.handleClient();
}

The D1 mini boards especially are quite neat, my programming abilities are quite limited so I head off to sites like this web server | Random Nerd Tutorials which has some great examples, and A Beginner's Guide to the ESP8266 to get going. Good to see some more example code.

Not sure exactly, but it sounds like the OP has got to some testing stages at least, to find an issue using sensors as access points.

Is there a way to be connected to a limited WiFi network and still use the mobile carrier's data connection?

Another thought struck me about this, it could be turned around, one of the phones (or both if point-point to each wifi device was used) could be configured as a wifi hotspot, and an ESP connects as a station. Then it's just a matter of connecting to the stations IP address, either to it's webserver, or a Remotexy port, and the phone retains it's carrier data connection instead of thinking a sensor's access point is internet connected.
There may be other ways, such as 3rd party apps, some kind of advanced setting, firewalls etc. to prevent the unwanted behaviour.

Mobisoft Infotech is Houston based mobile application development company specialize in iOS, Android and BB Enterprise app development and our portfolio comprises of more than 240+ applications delivered so far. Our team has great experience in Mobile Application Development along with creative and Market specific product development. It comprised of highest caliber software designers and developers versed in development standards, best practice methods and most popular as well as cutting edge development platforms and technologies.

To know more about it please visit:iOS App Development Company | iOS App Development Services