Arduino Controller android app

marque:
Now there is a free version with ads as well.

On rooted phones it is already possible to back up your settings by backing up the XML file in data/data/com.marquesoft.arduinocontroller/shared_prefs

I received a question in my mail, but i prefer to give support in this forum.

Hey,

Thanks for making the app I just have one quick question. I was looking at your example sketch (http://dl.dropbox.com/u/29369544/Arduino%20Controller/ArduinoController/ArduinoController.ino) and I am confused as to where you are sending an html line back to the app? Can you please point me to the line of code where you send the simple html line that you can view in the browser on the phone?

Thanks, W

Hi W,
Just above setup are the html lines that are send to the android aplication;

char content_main_top[] = "<body bgcolor=black><font color=white><center>";
char S1[] = "1 is on" ;
char S2[] = "1 is off" ;
char S3[] = "2 is on";
char S4[] = "2 is off";
char S5[] = "up";
char S6[] = "down";
char S404[] = "Not Found";

The first line sets background black, text white and allignment centered. The last line is the defaul one so when there is no command recognized.
The rest of the lines can be customised.

They are send in the following code;

if (x == 1) 
  {client.print (content_main_top);
   client.println(S1);
   Serial.println(S1);

You don´t need to use the static references, you can do the following as well;

if (x == 1) 
  {client.print (content_main_top);
client.print(" Software version: ");
    client.print(sketchname);
    client.print("
 ");
    client.print("Free Ram: ");
    client.print(freeRam());
    client.print("
 ");
    client.print(" System time: ");
    client.print(time);

I hope you get it working! Else, please let me know.

Now there is a updated version available in Google play.
Changes made to this version:

  • complete new layout
  • three different profiles
  • example layout on profile 3 set up for the arduino example sketch
  • password protected login

Next version will have a customisable widget and can save and restore profiles.

Well, my news does not actually relates to this app, but i believe it will be interesting for those who love Arduino and Android.
Please welcome ArduinoDroid - Arduino IDE for Android:
https://play.google.com/store/apps/details?id=name.antonsmirnov.android.arduinodroid

Now there is a new tutorial in the first post.

this system is amazing man!very great work!
if it helps,i noticed something to fix or at least check:
1-sometimes the switch from an example to other,need 2\3 taps,it doesn't refresh how it would
2-i have third and second colomns names inverted in the settings (only names)

After that,the application is great!
can you point me out what kind of use i can do with b and c square box?what do i have to write there?
thanks for the work,very appreciated!

sert00:
this system is amazing man!very great work!
if it helps,i noticed something to fix or at least check:
1-sometimes the switch from an example to other,need 2\3 taps,it doesn't refresh how it would
2-i have third and second colomns names inverted in the settings (only names)

After that,the application is great!
can you point me out what kind of use i can do with b and c square box?what do i have to write there?
thanks for the work,very appreciated!

Hi Sert00,
Great to hear you like the Arduino Controller and thanks for giving me the feedback so I can make it even better.
Problem "1" you are mentioning should be solved from version 2.0.8. Problem "2" I was not aware of that yet, so I will fix it in the next update.
If you have more suggestions, tips or bugs please let me know.

Hi marque! :slight_smile:
i'm trying the new update.what i see at first look is that:

  1. in settings,every profile has a little typo in adress name (adres)
    2.in settings,the name "application settings has a little typo (aplication)and also in the box inside when you click
  2. the previous release problem of name inverted is still here.i mean,when you want to write a label on buttons for each coloumn(3 in total)you have:
    first coloumn parameters..and is ok
    second coloumn parameters---and it's ok because it act directly to second coloumn's settings,but it's labelled third colomn instead of second.
    of course also the third is switched,you have only to switch 2 name.
    Like you see i reported only very little bugs related only to grammatical and logic things.
    I'll report as well if find something wrong!thanks for the hard work XD
    ps--can you reply on what i asked you 2 post ago?here below pasted :

"can you point me out what kind of use i can do with b and c square box?what do i have to write there?"

sert00:
Hi marque! :slight_smile:
i'm trying the new update.what i see at first look is that:

  1. in settings,every profile has a little typo in adress name (adres)
    2.in settings,the name "application settings has a little typo (aplication)and also in the box inside when you click
  2. the previous release problem of name inverted is still here.i mean,when you want to write a label on buttons for each coloumn(3 in total)you have:
    first coloumn parameters..and is ok
    second coloumn parameters---and it's ok because it act directly to second coloumn's settings,but it's labelled third colomn instead of second.
    of course also the third is switched,you have only to switch 2 name.
    Like you see i reported only very little bugs related only to grammatical and logic things.
    I'll report as well if find something wrong!thanks for the hard work XD

Hi,
Thanks for point out the typo's, everything should be fixed now.

ps--can you reply on what i asked you 2 post ago?here below pasted :

"can you point me out what kind of use i can do with b and c square box?what do i have to write there?"

I explaned the use of these boxes in the message below:

thanks Marque,i didn't see that post!

Hallo Marque,
Do You know why the light version works on my galaxy S7500, and the other versions(pro ad and pro)are not compatible ?(according to google play).

Great program.
Nico

Hello Marque

First of all i would like to thank you for this great application you have no idea how helpful it is with my project, to begin with my project is a multi-axis sun tracking system that uses mathematical models to calculate the suns position and then send the servo motors to the the calculated angles. The program starts with a simple user interface where it asks the user to enter the location as (Longitude/ latitude) then the date and time, this is done by using an attached keypad and an lcd screen. To not take any longer of your time here is my question can i use the arduino application as the other alternative for the data input and for feed back; for example i can add a temperature sensor and use it for feedback in case of extreme temperatures, if this is possible please let me know how and also i would like to know what level of programing it needs because am still a beginner and have limited information on arduino programing. Thank you very much and i appreciate you work.

Negmy..

vadeveni:
Hallo Marque,
Do You know why the light version works on my galaxy S7500, and the other versions(pro ad and pro)are not compatible ?(according to google play).

Great program.
Nico

Hi,

This is because the pro versions are designed for android 3.0+

Guys I have a problem in my code, it shows no error but does not work as I wanted.
I'm putting the system to 32 outputs and had trouble setting from 5 out, because sending cmd "9" to turning on and cmd "10" to turning off it only sends the first character "1" and so turning on output 1 instead of turning off the 5.
Can someone help me and understand my mistake!
Follows the code

/

int ledPin2 = 22;
int ledPin3 = 23;
int ledPin4 = 24;
int ledPin5 = 25;
int ledPin6 = 26;
int ledPin7 = 27;
... continue
int ledPin32 = 52;
int ledPin33 = 53;
int ledPin34 = 6;
int ledPin35 = 7;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
EthernetServer server(80); // port to listen on
EthernetClient client;

char content_main_top[] = "";
char S1[] = "Externa 1 is on " ;
char S2[] = "Externa 1 is off" ;
char S3[] = "Externa 2 is on";
char S4[] = "Externa 2 is off";
char S5[] = "Externa 3 is on";
char S6[] = "Externa 3 is off";
char S7[] = "Portaria is on";
char S8[] = "Portaria is off";
char S9[] = "Reunião 1 is on";
char S10[] = "Reunião 1 is off";
char S11[] = "Fish Pump is on";
... continue
char S65[] = "Fish Pump is on";
char S66[] = "Fish Pump is off";
char S67[] = "Fish Pump is on";
char S68[] = "Fish Pump is off";
char S404[] = "Not Found";

void setup()
{
Serial.begin(9600);
Serial.println("Getting IP......");
Ethernet.begin(mac);
Serial.print("My IP address: ");
Ethernet.localIP().printTo(Serial);
Serial.println();
Serial.print("Gateway IP address is ");
Ethernet.gatewayIP().printTo(Serial);
Serial.println();
Serial.print("DNS IP address is ");
Ethernet.dnsServerIP().printTo(Serial);
Serial.println();
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
pinMode(ledPin6, OUTPUT);
pinMode(ledPin7, OUTPUT);
pinMode(ledPin8, OUTPUT);
pinMode(ledPin9, OUTPUT);
pinMode(ledPin10, OUTPUT);
pinMode(ledPin11, OUTPUT);
pinMode(ledPin12, OUTPUT);
pinMode(ledPin13, OUTPUT);
... continue
pinMode(ledPin33, OUTPUT);
pinMode(ledPin34, OUTPUT);
pinMode(ledPin35, OUTPUT);
Serial.print("Initialising ledPin2 ");
Serial.println();
Serial.print("Initialising ledPin3 ");
Serial.println();
Serial.print("Initialising ledPin4 ");
Serial.println();

}
void loop()
{

checkclient();
}

void checkclient()
{
EthernetClient client = server.available();
if (client)
{
boolean sentHeader = false;
while (client.connected())
{
if (client.available())
{
if(!sentHeader){
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
sentHeader = true;
}
char c = client.read();
if (readString.length() < 20)
Serial.print(c);
{readString.concat(c);}
if (c == 'H')
{
Serial.println();
int Is = readString.indexOf("/");
int Iq = readString.indexOf("?");
int Ib = readString.indexOf("b");
int Ic = readString.indexOf("c");
if(readString.indexOf("?") > 1)
{
if (Ib == (Iq+1))
{
char carray[5];
readString.toCharArray( carray,5,(Ib+1));
Serial.println(carray);
valueB = atof(carray);
Serial.print("B is now: ");
Serial.println(valueB);
client.print (content_main_top);
client.print("B is now: ");
client.print(valueB);
}
else if (Ic == (Iq+1))
{
char carray[5];
readString.toCharArray( carray,5,(Ic+1));
Serial.println(carray);
valueC = atof(carray);
Serial.print("C is now: ");
Serial.println(valueC);
client.print (content_main_top);
client.print("C is now: ");
client.print(valueC);
}
else
{
char carray[2];
readString.toCharArray( carray,2,(Iq+1));
RecievedString = atoi(carray);
switch (RecievedString) {
case 1: action(1, client);digitalWrite(ledPin2, HIGH);break;
case 2: action(2, client);digitalWrite(ledPin2, LOW);break;
case 3: action(3, client);digitalWrite(ledPin3, HIGH);break;
case 4: action(4, client);digitalWrite(ledPin3, LOW);break;
case 5: action(5, client);digitalWrite(ledPin4, HIGH);break;
case 6: action(6, client);digitalWrite(ledPin4, LOW);break;
case 7: action(7, client);digitalWrite(ledPin5, HIGH);break;
case 8: action(8, client);digitalWrite(ledPin5, LOW);break;
case 9: action(9, client);digitalWrite(ledPin6, HIGH);break;
case 10: action(10, client);digitalWrite(ledPin6, LOW);break;
case 11: action(11, client);digitalWrite(ledPin7, HIGH);break;
case 12: action(12, client);digitalWrite(ledPin7, LOW);break;
... continue
case 67: action(67, client);digitalWrite(ledPin35, HIGH);break;
case 68: action(68, client);digitalWrite(ledPin35, LOW);break;

default: action(404, client);
}
}
delay(1);
client.stop();
readString="";
client.read(); client.read();
}
if (Iq < 0)
{
action(404, client);
delay(1);
client.stop();
readString="";
client.read(); client.read();
}
delay(1);
client.stop();
readString="";
client.read(); client.read();
}
}
}
}
}

void action(int x, EthernetClient client)
{
if (x == 1)
{client.print (content_main_top);
client.println(S1);
Serial.println(S1);
}
if (x == 2)
{client.print (content_main_top);
client.println(S2);
Serial.println(S2);
}
if (x == 3)
{client.print (content_main_top);
client.println(S3);
Serial.println(S3);
}
if (x == 4)
{client.print (content_main_top);
client.println(S4);
Serial.println(S4);
}
if (x == 5)
{client.print (content_main_top);
client.println(S5);
Serial.println(S5);
}
if (x == 6)
{client.print (content_main_top);
client.println(S6);
Serial.println(S6);
}
if (x == 7)
{client.print (content_main_top);
client.println(S7);
Serial.println(S7);
}
if (x == 8)
{client.print (content_main_top);
client.println(S8);
Serial.println(S8);
}
if (x == 9)
{client.print (content_main_top);
client.println(S9);
Serial.println(S9);
}
if (x == 10)
{client.print (content_main_top);
client.println(S10);
Serial.println(S10);
}

if (x == 404)
{client.print (content_main_top);
client.println(S404);
Serial.println(S404);
}
x=0;
}

esfernando:
I'm putting the system to 32 outputs and had trouble setting from 5 out, because sending cmd "9" to turning on and cmd "10" to turning off it only sends the first character "1" and so turning on output 1 instead of turning off the 5.

See Reply #17 on page 2 of this thread. It has the answer you're looking for. I've used that and it works perfectly.

cya
R

Hi,

nice application, can you control more than one arduino node or is planned this for next releases?

Regards,
Dario.

veseo:
nice application, can you control more than one arduino node or is planned this for next releases?

I don't know about the lite versions - you'll have to check.

The Pro version allows you to control 8 different arduinos (8 different profiles, each one can take a different web address/IP and port #).

cya
R

Now there is a new version with three seekbars. With these seekbars it is easier to control RGB leds, motors and servo's.

marque:
Now there is a new version with three seekbars.

Awesome!

Question: will upgrading delete/overwrite all my existing profiles?

Thanks,
R

Question: will upgrading delete/overwrite all my existing profiles?

No, but........
I recommend a backup. 8)
On uninstall / reinstall your settings will be deleted.
On rooted phones, your settings are saved in the XML file in data/data/com.marquesoft.arduinocontroller/shared_prefs.

I am looking for a way to import / export profiles, but it need some more testing and debugging.