Any idea why my other pins are high? I can pop a led into any of my unused pins and the led lights up?

Very soon I'm going to buy another etherten and use the first one as a lightswitch that will send the status of the pins through to another etherten connected to my server. Server will use php to write values to a db, then switch relays accordlingly. As I'm not the best coder its a daunting task!

I have no idea why you unused pins are high, i have no experiance with the etherten. I'm an beginning amateur as well, i think a pro or more experianced dev will laugh about my arduino / android code.

Hi, I've been playing around with the Arduino code a little. I am using a DF Robot Relay Shield (has 4 relays)and 2 10K thermistors from adafruit to read temperature.After the code preforms your digitalWrite to operate the relay, the code will do a digitalRead to see what the current state of the relays are and an analogRead to get temperature data. From the android a "9" will turn On all the relays, a "0" will cause a 404 which I changed to a space "&nbsp;" to clear the Line of text "Turning on 1" etc,from the android screen leaving just the Read data. Color coded the relays red for off and green for on.

Looks good!

Quote

Couple of issues with the Android code, I can only send 0 thru 9, if I enter 10 it sends 1, enter 21 it sends 2, etc.

In the exapmle code the arduino looks for one digit after the questionmark, so you need to make a little change in the arduino code to make it look for two....change in the checkclient() part:

else { char carray[2]; readString.toCharArray( carray,3,(Iq+1)); RecievedString = atoi(carray); switch (RecievedString) {so it will look for two digit, but you need to send strings with two digits to make it work well (eg. 01, 02, 09, 10, 99)

Quote

Second the android controller keeps running after exit,draining my battery, so when I am done using the app I have to go to manage apps and forcestop the app.

I tink it's the way android is build but it should not drain your battery bacuase it is just some simple code.

Quote

Would like to be able to put in a URL address (i.e. myarduino.mysite.com) so I can use dynamic ip forwarding without having to know the IP address of the arduino.

Marque , Wow , I love the app ...I sent an email to you as well , but i also wanted to say THANK YOU! on the forum. I am now able to use your app to control my home audio system . I tried the Android tablet in my garage + outside and it works great ! I activated more buttons in the code and found it very straight forward . I have other code that I want to integrate as well as some low voltage lighting. Keep up the great work and MANY THANKS on a job well done!Build_it_Bob

finally.. i found the most important part of my project.. hehe thank you for this post.. uhmm marque can you post or share the codes from you android app? cause i want to see it.. i am really noob to making android app and i want to see hwo the code is constructed if you dont mind.. anyway thank you so much for this post.. i will try it tomorrow hehe

additional question.. uhmm can you tell me which part in your sketch the actions the arduino makes after recieving strings from the app? cause i want to insert ther actions like digitalwrite for my relays to turn on.. thank you

finally.. i found the most important part of my project.. hehe thank you for this post.. uhmm marque can you post or share the codes from you android app? cause i want to see it.. i am really noob to making android app and i want to see hwo the code is constructed if you dont mind.. anyway thank you so much for this post.. i will try it tomorrow hehe

additional question.. uhmm can you tell me which part in your sketch the actions the arduino makes after recieving strings from the app? cause i want to insert ther actions like digitalwrite for my relays to turn on.. thank you

The first piece of code looks for the recieved string and send it to the second piece of code where the action takes place.First piece of code:

i downloaded the app sir..i downlaoded it on my samsung galaxy tab.. how will i go to settings screen? i dont see other button that goes to settings screen?

You can find the settings in the menu. You do not have a standard menu button as such. What you have is a softkey which can be found in different places depending on which android version you are in. This softkey takes the form of OPTIONS or SETTINGS which can be selected like a menu. IT looks like 3/4 horizontal bars.

I hope that answers your questions and I'm more than happy to help you out again anytime.

in thise piece of code you can set two variable with you android app. In the settings screen you can set a prefix in the two textboxes top right. in the first one put a "b" and in the second one put a "c". on the main screen you can put a value in the two text views top left and hit the send button. the app will send a HTTP GET request in the following format: "http://yourip:yourport/?prefixvalue" , "http://192.168.1.120:80/?b2800". where the "b" is the prefix you have set in the settingsscreen and 2800 is the value you set in the main screen. The arduino sketch will look for a "b" or a "c" and sets the variable to the value that follows. I have commented the code above, hope it clears it up for you.

uhmm i send you a personal message.. hope you can help me with it.. thank you so much... anyways if you have not received it, i was asking for your sketch/code in the android app.. because i want to modify some parts from it because my professor ask me for some changes in the app for my project study.. im still new with android programming but your app will be a good start for me to work with.. hope you can help me..

I've set it to control a servo (which will be connected to a dimmer). I'm sharing the code below just in case anyone else wishes to control a servo with the app. The relays/switches part of the code below is still incomplete, but the servo part works perfectly. I've also applied the code change to allow 2-digit codes, so make sure they are all 01, 02, 03 in your android app settings.

Currently you have 2 buttons "dimmer down" (04) and "dimmer up" (14) that you can use to move the servo by a pre-defined angle. It also disconnects the servo after 1 second of no command, to avoid unnecessary current draw/vibrations, and also let it be freely moveable to allow manual control of the dimmer.

In the android app settingsscreen you can set up you IP and port.For this example you need to call prefix 1 "B" and prefix 2 "C".*/#include <Ethernet.h>#include <HTTPClient.h>#include <SPI.h>#include <Servo.h> // servo library added