Go Down

Topic: Arduino Controller android app (Read 63116 times) previous topic - next topic

BobbyD

RichieC,
I noticed that in case 9 where you switch everything on , you don't have a  ;break:

case 9: digitalWrite(GasBoiler, HIGH);digitalWrite(HeatPump, HIGH);digitalWrite(UndFlor, HIGH);
/* Basically a call for all Heating on */

Should it be:
case 9: digitalWrite(GasBoiler, HIGH);digitalWrite(HeatPump, HIGH);digitalWrite(UndFlor, HIGH);break;
/* Basically a call for all Heating on */

Just wondering if things may hang after a case 9 is issued ?
Bob

Frit

Hi Marque.

Any chance of a sketch for a wifi connection?

RichieC

Thanks I'll change this today and see if it helps.

Thanks

Rich

marque


Hi Marque

I still using your app to control my heating but I'm having trouble. The server side of my program doesn't run for very long before stopping. The main part of my program still contuines to run but my devices won't connect to the Arduino Board.

I have attached my code for you to see if there is anything obvious.

Thanks

Richard


At the end of the sketch i see a strange part. maybe it is causing the trouble.

Code: [Select]
x=0;
if (x == 0)
{
  client.println(" ");
}
}


In my own programs i try to contact google.com every hour. When it fails, the arduino resets itself.

marque



Here are examples of what I see in the serial monitor no matter what buttons I press on the Android app:
Droid 4:
*CLOS**OPEN*GET /?1 HTTP/1.1
Host: 192.168.43.38:2000
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
X-Requested-With: com.marquesoft.ArduinoControllerPro
User-Agent: Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; DROID4 Build/9.8.2O-72_VZW-18) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
Accept-Encoding: gzip,deflate
Accept-Language: en-US
Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7

Acer A500:
*CLOS**OPEN*GET /?1 HTTP/1.1
Host: 192.168.43.85:2000
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; A500 Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
Accept-Encoding: gzip,deflate
Accept-Language: en-US
Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7
x-wap-profile: http://support.acer.com/UAprofile/Acer_A500_Profile.xml




The "OPEN*GET /?1 HTTP/1.1" part looks Ok. The 1 after the ? should change for each button you programmed.

RichieC

Thanks I'll check my code


Quote
in my own programs every hour I try to contact google if it fails the arduino resets itself


How do you do that? Could you paste the code here please?

Thanks

Rich

marque



How do you do that? Could you paste the code here please?

Thanks

Rich


Use rtc or millis to execute a networkcheck(); every hour.

Declare:
Code: [Select]
IPAddress ServerToCheck (74,125,228,32 );         //IP adress of google
char dnsServerToCheck[] = "google.com";             // set the name of the server to check
boolean networkonline = false;
boolean DNS = false;


Code: [Select]

void networkcheck()
{
Serial.println ("Network check");
 if (client.connect(dnsServerToCheck, 80))
 {
   delay(300);
   Serial.print("connected to ");
   Serial.println(dnsServerToCheck);
   client.println("GET / HTTP/1.1");
   client.println();
   while (client.connected())
   {
     if (client.available())
     {
       char c = client.read();
       if (readString.length() < 20)
         Serial.print(c);
       {
         readString.concat(c);
       }
       if (c == '\n')
       {
         client.stop();
         Serial.println();
        Serial.println("DNS OK");
         DNS = true;
         networkonline = true;
         readString="";
       }
     }
     if (!client.connected())
     {
       client.stop();
       readString="";
     }
   }
 }
 if (!DNS)
 {
    Serial.println("DNS Error");
   Serial.println("Check for IP");
   if (client.connect(ServerToCheck, 80))
   {
     delay(300);
      Serial.print("connected to ");
      Serial.println(ServerToCheck);
     client.println("GET / HTTP/1.1");
     client.println();
     while (client.connected())
     {
       if (client.available())
       {
         char c = client.read();
         if (readString.length() < 20)
            Serial.print(c);
         {
           readString.concat(c);
         }
         if (c == '\n')
         {
           client.stop();
          Serial.println();
           Serial.println("IP lookup OK");
           Serial.println("DNS not available");
           networkonline = true;
           readString="";
         }
       }
       if (!client.connected())
       {
          Serial.println("Disconnecting");
         client.stop();
         readString="";
       }
     }
   }
   else
   {
     Serial.println("Network Error");
   resetFunc();
   }
 }
}
void(* resetFunc) (void) = 0; //declare reset function @ address 0

JessieLee

Hi will this be able to work with a WIFI shield instead of an Ethernet shield?

marque


Hi will this be able to work with a WIFI shield instead of an Ethernet shield?


Can you give me a example of a wifiserver code so i can modify it to work with the controller app.

Is it possible to import custom buttons for the app,

I use it to control a bank of relays that control various pumps / filters on my Koi pond,  a toggle button rather than one for on and another for off would be much better, giving visual feedback of the relays current state (high/low).

thanks

Ian

marque


Is it possible to import custom buttons for the app,

I use it to control a bank of relays that control various pumps / filters on my Koi pond,  a toggle button rather than one for on and another for off would be much better, giving visual feedback of the relays current state (high/low).

thanks

Ian


This is already possible but you see the feedback in a line in the browserview and no indication on the button itself.

marque

#101
Aug 21, 2014, 11:09 am Last Edit: Aug 21, 2014, 11:26 am by marque Reason: 1
Coming soon!
For the Pro versions you can expect home screen Widgets very soon. There will be five different layouts:

  • horizontal

  • vertical

  • directional pad

  • up / down

  • one button


Features:

  • Resizable

  • Reconfigurable

  • Status indicator

  • Value indicator

  • last update time

  • auto update


At first widget will be a beta feature.


ruli00

Hi,

Will this app work with the enc28j60 controller? I understand that the example sketch using the w5100 will not work.


Thanks

ruli00

ruli00


Hi,

Will this app work with the enc28j60 controller? I understand that the example sketch using the w5100 will not work.


Thanks

ruli00


After tinkering all day I've answered my own question. I replaced the standard Ethernet library with UIPEthernet.h and all is well.

ambroz666

Hi,

How can I write program where turnig on and turnig off is controlled by one button (not two buttons ON and OFF)?
My program is in supplement.

Go Up