Show Posts
Pages: 1 [2] 3 4 ... 409
16  Using Arduino / Networking, Protocols, and Devices / Re: Help with port forwarding on: September 15, 2014, 03:03:31 pm
The way it works is if the destination IP address is not localnet, then the packets are passed to the gateway, which is your dsl router. Since 192.168.100.x net is not a network on the gateway dsl router, it doesn't know where to send the packets. You would have to route the 192.168.100.0/24 net to the 192.168.1.47 IP in the dsl router.

17  Using Arduino / Networking, Protocols, and Devices / Re: GET function not working as expected. PHP setting issue. on: September 15, 2014, 11:12:20 am
Then how do you expect that to work?

Does your ISP allow you to host a website with your current plan? If so, set up your own LAMP server. Do you have an old computer you can set up with some flavor of Linux? Your friend that does your php programming should be able to help you with that.
18  Using Arduino / Networking, Protocols, and Devices / Re: GET function not working as expected. PHP setting issue. on: September 15, 2014, 11:00:27 am
Finally thats what I have decided to do.  And believe me GET request is  working with full link! smiley
So can we conclude that there is no problem with arduino but some problem with php setting on server side?
If that is your domain (suyogtechnologies.com), it is not working. Your site is down.
19  Using Arduino / Networking, Protocols, and Devices / Re: Help with port forwarding on: September 15, 2014, 10:08:12 am
If you expect to access the Arduino from the internet, that won't happen. The dsl modem must port forward the public IP to your pivate IP.

If you are trying to access it from the 192.168.1.x network, that would probably require a port forward in the dsl modem also.
20  Using Arduino / Networking, Protocols, and Devices / Re: Issue with serial communication on: September 15, 2014, 08:54:46 am
Is the machine power supply using TTL or RS232 for the serial interface? If it is RS232, you must use a TTL to RS232 converter, like a MAX232.

21  Using Arduino / Installation & Troubleshooting / Re: MEGA 2560 No Longer Seen on USB but is not completely bricked on: September 14, 2014, 05:13:53 pm
How are you powering the Mega when the USB is not plugged in?
22  Using Arduino / Networking, Protocols, and Devices / Re: Change SS pin on Ethernet Shield on: September 14, 2014, 03:48:13 pm
Thanks Scott. Do you mean the new SS pin (D8), or the default SS pin (D10) must be set to OUTPUT?

edit: You should not have to set the default SS to OUTPUT and HIGH. That is done when the Ethernet.begin() function calls W5100.init(), which calls SPI.begin(). The SPI.begin() function sets the default SS pin to OUTPUT and HIGH.

You must mean the new slave select pin. The files I posted earlier are missing that update. My newer updated code does that for you. I attached the new files to this post just to insure all my recent changes are included.

For anyone else wanting to try this, insure you rename your original w5100.h, w5100.cpp, Ethernet.h, and Ethernet.cpp files before overwriting them with these. That way if all goes wrong, you have your old code to fall back on.

23  Using Arduino / Storage / Re: Reading from SD card overwrite values on: September 14, 2014, 03:38:41 pm
I store my network settings on a SD card now and then. I use a file called network.txt to store the settings in this order and format. There must be a newline character at the end of each line, including the last line (dns).
mac address
IP
netmask
gateway
dns

Code:
12:34:56:78:90:AB
192.168.2.2
255.255.255.0
192.168.2.1
192.168.2.1

I use this code.
Code:
#include <SD.h>
#include <SPI.h>
#include <Ethernet.h>

byte myMac[6];
byte myIP[4];
byte myNM[4];
byte myGW[4];
byte myDNS[4];

void setup() {
  Serial.begin(9600);  

  pinMode(10,OUTPUT);
  digitalWrite(10,HIGH);

  if(!SD.begin(4)) Serial.println("SD fail");
  else Serial.println("SD ok");

  File fh = SD.open("network.txt",FILE_READ);
  char netBuffer[32];
  
  if(!fh)
  {
    Serial.println("SD open fail");
    return;    
  }

  int chPos = 0;
  int lineNo = 0;
  
  while(fh.available())
  {
    char ch = fh.read();
    if(ch == '\n') {
      chPos = 0;

      switch(lineNo) {
        case 0:
//          Serial.print("mac ");        
  sscanf(netBuffer,"%2x:%2x:%2x:%2x:%2x:%2x",&myMac[0],&myMac[1],&myMac[2],&myMac[3],&myMac[4],&myMac[5]);  
        break;

        case 1:
//          Serial.print("ip ");        
  sscanf(netBuffer,"%u.%u.%u.%u",&myIP[0],&myIP[1],&myIP[2],&myIP[3]);  
        break;

        case 2:
//          Serial.print("netmask ");        
  sscanf(netBuffer,"%u.%u.%u.%u",&myNM[0],&myNM[1],&myNM[2],&myNM[3]);  
        break;

        case 3:
//          Serial.print("gateway ");        
  sscanf(netBuffer,"%u.%u.%u.%u",&myGW[0],&myGW[1],&myGW[2],&myGW[3]);  
        break;

        case 4:
//          Serial.print("dns ");        
  sscanf(netBuffer,"%u.%u.%u.%u",&myDNS[0],&myDNS[1],&myDNS[2],&myDNS[3]);  
        break;
      }

//      Serial.println(netBuffer);
      lineNo++;
    }
    else if(ch == '\r') {
      // do nothing
    }
    else if(chPos < 31) {
      netBuffer[chPos] = ch;
       chPos++;
      netBuffer[chPos] = 0;
    }
  }
  
  fh.close();

  int x;
  
  Serial.print("\r\nmac ");
  for(x=0;x<6;x++) {
    Serial.print(myMac[x],HEX);
    if(x<5) Serial.print(":");
  }

  Serial.print("\r\nip ");
  for(x=0;x<4;x++) {
    Serial.print(myIP[x],DEC);
    if(x<3) Serial.print(".");
  }

  Serial.print("\r\nnetmask ");
  for(x=0;x<4;x++) {
    Serial.print(myNM[x],DEC);
    if(x<3) Serial.print(".");
  }

  Serial.print("\r\ngateway ");
  for(x=0;x<4;x++) {
    Serial.print(myGW[x],DEC);
    if(x<3) Serial.print(".");
  }

  Serial.print("\r\ndns ");
  for(x=0;x<4;x++) {
    Serial.print(myDNS[x],DEC);
    if(x<3) Serial.print(".");
  }

  Serial.println("\r\nStarting ethernet");
  Ethernet.begin(myMac,myIP,myDNS,myGW,myNM);
  
  Serial.println(Ethernet.localIP());
}

void loop() {
}

edit: Note I do not use the SDFat library. I use the SD library.
24  Using Arduino / Networking, Protocols, and Devices / Re: Change SS pin on Ethernet Shield on: September 14, 2014, 01:25:50 pm
I'm using a Mega 2560, but that shouldn't make a difference if the DHCP sketch is working for you.


25  Using Arduino / Networking, Protocols, and Devices / Re: Change SS pin on Ethernet Shield on: September 14, 2014, 01:20:17 pm
I just tried a static IP and dhcp. Both worked.
26  Using Arduino / Networking, Protocols, and Devices / Re: GET function not working as expected. PHP setting issue. on: September 14, 2014, 01:17:45 pm
Are you using a web proxy server?

27  Using Arduino / Networking, Protocols, and Devices / Re: Change SS pin on Ethernet Shield on: September 14, 2014, 01:02:54 pm
Are you bending the D10 pin on the ethernet shield so it doesn't insert into the Arduino?
Are you jumpering the D10 pin on the shield to the new slave select?
Are you calling Ethernet.select() before Ethernet.begin() to select the new slave select? I just changed mine to D8 and this worked.
Code:
Ethernet.select(8);
28  Using Arduino / Programming Questions / Re: I am receiving error with unusual characters using Adafruit Wifi shield on: September 14, 2014, 09:38:37 am
I didn't notice this:
Quote
I really want it to use with 12v power supply alone without the usb cable because it is brighter with it.
What is brighter? The USB cable should provide 5 volts. The barrel connector input voltage should be regulated to 5 volts. Nothing should be brighter either way.
29  Using Arduino / Networking, Protocols, and Devices / Re: GET function not working as expected. PHP setting issue. on: September 14, 2014, 09:35:11 am
In addition to PaulS, what ethernet shield are you using? That example in the link you posted is for a ENC28J60 ethernet controller, not a W5100 IC like the official Arduino models.
30  Using Arduino / Installation & Troubleshooting / Re: TROUBLESHOOTING ON ETHERNET SHIELD on: September 14, 2014, 09:16:26 am
Do you have the shield connected to a router with a dhcp server active?

Your question is loud. Try releasing the caps lock.  smiley-wink
Pages: 1 [2] 3 4 ... 409