Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: Arduino WIFI on: March 31, 2013, 01:43:38 pm
Sorry to interupt but I m kind in the same situation smiley-razz I have created a sketch that works perfectly if I connect directly the ethernet shield to my computer. I have bought a TL-WR703N and flushed a modified english firmware to be able to use it properly. I set it up as a client and connected it to my computer and configured it to connect to my Home Router to be able to access the internet. I disabled my laptop's wifi card and only by using the WR703N as a client I was able to access the internet. Then I assigned a static IP address to the WR703N from my main Home Router and port forwared TCP-UDP ports from 80-5881 for the specific static IP. Then I plugged the WR703N to arduino and tried to reach the server locally but I couldn't. The WR703N was pingable at the local IP but I just couldn't reach the arduinos server. What did I miss?

smiley-confuse)
2  Using Arduino / Programming Questions / Re: Help for a simple for loop on: March 27, 2013, 03:25:08 am
I did it by using the String(n) function to read the integer as a string. Thanks everyone for your help

SOLVED
3  Using Arduino / Programming Questions / Re: Help for a simple for loop on: March 26, 2013, 05:43:51 am
Thanks for your answer smiley The on1, on2, on3 etc are address bar queries for switches so that's what I m trying to read. I m not sure how to use sprintf() to achieve that (noob alert smiley-grin). Can you make a proper synstax on this if(readString.indexOf("on"i) >0) with i being the int? Thanks again
4  Using Arduino / Programming Questions / Help for a simple for loop on: March 26, 2013, 05:26:19 am
Hi guys. I want to make my code a bit more robust and light because I have a little bit of trouble with the amount of data the ethernet shield can handle. If I am near 16kb of code, it crashes, although the arduino has 32kb. Anyway... To the point smiley

I want to substitute the following piece of code and make a "for loop" for the pins 2-9  but I don't know how to make it read the ("on1"), ("off1), with 1 being an int i.

Quote
     if(readString.indexOf("on1") >0)//checks for on
          {
            digitalWrite(2, HIGH);    // set pin 2 high
//            Serial.println("Led On");
            //client.println("Light 1 Is On");
            //client.println("<br />");
          }
          else{
            if(readString.indexOf("off1") >0)//checks for off
            {
              digitalWrite(2, LOW);    // set pin 2 low
//              Serial.println("Led Off");
              //client.println("Light 1 Is Off");
              //client.println("<br />");
            }
          }

          if(readString.indexOf("on2") >0)//checks for on
          {
            digitalWrite(3, HIGH);    // set pin 3 high
//            Serial.println("Led On");
          }
          else{
            if(readString.indexOf("off2") >0)//checks for off
            {
              digitalWrite(3, LOW);    // set pin 3 low
//              Serial.println("Led Off");
            }
          }



I want it to be something like but obviously doesn't work because its wrong syntax.


Code:
for (int i=1; i<9;i++)
if(readString.indexOf("on"i) >0)//checks for on
          {
            digitalWrite(i+1, HIGH);    // set pin i+1 high

          }
          else{
            if(readString.indexOf("off"i) >0)//checks for off
            {
              digitalWrite(i+1, LOW);    // set pin i+1 low

            }
          }
}


5  General Category / General Discussion / Re: Ethernet relay project on: March 22, 2013, 04:03:40 pm
No... My problem is when I have 2 leds on for example, and then I try to hit the 192.168.1.30 again in the URL bar. All the leds turn off again. I see that there is a void setValuesFromParams() function but doesn't seem to work properly... That means that if I have 5 lights on for two hours for example, and then try to open the browser and hit the ip, the lights will turn off, regardless of their state at the time smiley-sad Any help would be appreciated. Thanks
6  General Category / General Discussion / Re: Ethernet relay project on: March 21, 2013, 04:38:42 am
Hey guys... This is a very nice piece of code. I run it locally on my machine and while the LED works properly, the client side of the code isn't working and always says "connection failed". That means that I can't read the state of the LED, right? What am I possibly doing wrong? Can I expand the code for 8 on-off buttons? Any help would be greatly appreciated. Have a nice day smiley
Pages: [1]