Show Posts
Pages: 1 ... 182 183 [184] 185 186 ... 400
2746  Using Arduino / Programming Questions / Re: The Ethernet Shield on Arduino Due hang up after parsing a string using sscanf on: April 15, 2013, 09:50:18 am
Everything looks good until here:
Quote
ip 0.0.0.60
and here:
Quote
Starting ethernet
0.0.0.0
??  smiley-sad
2747  Using Arduino / Project Guidance / Re: Send sms from arduino ethernet webserver on: April 15, 2013, 08:02:59 am
I found a way.  smiley

I used the info from this page:
http://computer.howstuffworks.com/e-mail-messaging/how-to-send-text-messages-computer.htm
and the email client code here:
http://playground.arduino.cc/Code/Email

You need to do a nslookup for the email text message server name. The servers for most carriers are listed on the howstuffworks page above. I use Verizon, and its email text message domain is vtext.com, so mine went something like this at a command prompt:
Code:
nslookup
set query=mx
vtext.com
It showed the mail exchanger "smtp-sl.vtext.com". That is what I used for the email server.

For the "RCPT To:" and "To:", I used my phone number and the domain. If my phone is 123-456-7890, then
<1234567890@vtext.com>

I press the 'e', and a few seconds after the "Email sent" message, I hear "DING!" from my phone. I have a sms waiting.  smiley
2748  Using Arduino / Programming Questions / Re: Sending an Email on: April 15, 2013, 07:05:07 am
You need a network device.

For the ethernet shield:
http://playground.arduino.cc/Code/Email

For the WiFi shield:
http://playground.arduino.cc/Code/WiFiEmailClient

They work with gmail if you are sending to a gmail account and you are not blocked by gmail's spam filter.
2749  Using Arduino / Networking, Protocols, and Devices / Re: HTTP GET Request results in 400 Bad Request on: April 15, 2013, 03:51:16 am
You must should send the GET request line in one packet. You are sending it in two.
Code:
String headerTwo = "GET /test/php/Arduino.txt";
String footerOne = " HTTP/1.0";

  // here is one packet
  client.print(headerTwo);
  Serial.print(headerTwo);

  // here is a second packet
  client.println(footerOne);
  Serial.println(footerOne);

Try this instead:
Code:
String headerTwo = "GET /test/php/Arduino.txt HTTP/1.0";

  client.print(headerTwo);
  Serial.print(headerTwo);

edit: Some servers will take the GET request in two packets, and some won't.
BTW, I tested that page with my client code and got this page:
THIS IS A TEST GET REQUEST...TEXT DOC
2750  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet to Internet ??? Addressing problem. on: April 14, 2013, 02:38:21 pm
Your challenge is due to this:
Code:
byte ip[] = { 192, 168, 0, 198 };   //Manual setup only
byte gateway[] = { 173, 242, 209, 65 }; //Manual setup only
byte subnet[] = { 255, 255, 255, 224 }; //Manual setup only
On this localnet, your gateway is unreachable. Since it works localnet, I presume the ip is correct, but the subnet mask and/or gateway is incorrect.

edit:
Code:
// this
Ethernet.begin(mac, ip, gateway, subnet);
// should be this
Ethernet.begin(mac, ip, gateway, gateway, subnet);
2751  Using Arduino / Networking, Protocols, and Devices / Re: Arudino Ethernet R3 + other devices on: April 14, 2013, 02:09:20 pm
The Wiznet W5100 has no problem with the MISO line. I use it with the uSD card interface all the time. You have a uSD slot on your Arduino Ethernet board, don't you? That is SPI. Why would they put both those devices on the same board if they could not be used together?
2752  Using Arduino / Networking, Protocols, and Devices / Re: Arudino Ethernet R3 + other devices on: April 14, 2013, 01:52:23 pm
Quote
Arduino Ethernet doesn't allow multiple SPI slave usage, so I can't connect my energy IC to it.
What gave you that idea? There is a default SPI slave select, but that does not limit it to one SPI slave. I use 2 SPI devices on a Mega2560.
2753  Using Arduino / Networking, Protocols, and Devices / Re: Network on: April 14, 2013, 11:49:34 am
...or once the connection to the server is ok, then you can use the server as a message board. PHP and MySQL handle that ok if your server has that capability. One page for the Arduino to retrieve "messages", and another for the PHP/MySQL interface for your web browser to leave "messages" for the Arduino. Not real time, but for most stuff, it is ok.

This is not for the technologically faint of heart.
2754  Using Arduino / Networking, Protocols, and Devices / Re: Network on: April 14, 2013, 06:38:10 am
Same way. Some virtual hosting servers require more in the request than that GET code sends. Take a look at the POST code example. I modified it a bit here so you can see where to remove the "Content-Length" if you require a GET request.
Code:
   // send the header
    sprintf(outBuf,"GET %s HTTP/1.1",page);
    client.println(outBuf);

    // this is required for a virtual server
    sprintf(outBuf,"Host: %s",domainBuffer);
    client.println(outBuf);

    // send blank (empty) line after this send
    client.println(F("Connection: close\r\n");

edit: I suggest using a simple request/response sketch until you get it working reliably with your server.
2755  Using Arduino / Networking, Protocols, and Devices / Re: Network on: April 14, 2013, 06:20:56 am
This web client code works well for me with my Apache web server.
http://playground.arduino.cc/Code/WebClient
2756  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield stop responding after some hours on: April 14, 2013, 04:58:49 am
Thanks for that info. That timeout code is the latest change I made just a few days ago.
2757  Community / Website and Forum / Re: Code example not complete on http://arduino.cc/en/Reference/EthernetUDPWrite on: April 13, 2013, 08:22:38 pm
Quote
On the following page : http://arduino.cc/en/Reference/EthernetUDPWrite  there seems to be a wrong use of the functions Udp.remoteIP and .remotePort().
That is the correct use if you are sending a response packet to a device that initially sent a UDP packet to you. That is how you find out the address and port to respond to.

If you want to initiate the packet, then use this:
Code:
IPAddress remoteIP(192,168,2,25);
int remotePort = 8888;
Udp.beginPacket(remoteIP, remotePort);
2758  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield R3 + Mega, can't get it to work on: April 13, 2013, 08:14:32 pm
If I am going to use the w5100 and SD together, this is the best way to get both started.
Code:
void setup(){
  Serial.begin(9600);
  Wire.begin(MY_ADDRESS);

  // disable w5100 while starting SD
  pinMode(chipSelect_W5100, OUTPUT);
  digitalWrite(chipSelect_W5100, HIGH);

  Serial.print(F("Starting SD..."));
  if(!SD.begin(chipSelect_SD)) Serial.println(F("failed"));
  else Serial.println(F("ok"));

  Serial.print(F("Starting W5100..."));
  Ethernet.begin(mac,ip);
  Serial.println(Ethernet.localIP());
  server.begin();
}
Here is a link to my server code. It works good for me.
http://playground.arduino.cc/Code/WebServerST
2759  Using Arduino / Programming Questions / Re: The Ethernet Shield on Arduino Due hang up after parsing a string using sscanf on: April 13, 2013, 04:28:37 am
Quote
why does the (255.255.255.0) is more correct than (255.255.0.0)?
Because one is correct, and the other isn't. You must figure out which. That depends on your current network setup in the localnet gateway router.

This is incorrect.
Code:
Ethernet.begin( { 0xAA, 0xBB, 0xCC, 0x11, 0x11, 0x11 }, {172.24.0.1}, {172.24.0.1}, {172.24.0.1}, {255.255.0.0});
This is the format.
Ethernet begin(mac, ip, dns, gateway, subnet);
Do not use your shield ip as the dns and gateway. Bad idea. Use valid network settings here.

Quote
SurferTim, ok. Using the "atoi" and building the string pieces as you made it's another good alternative. I could try.
atoi? Where did you see that in my code? I use sscanf also.

Did you try my code?
2760  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield stop responding after some hours on: April 12, 2013, 09:32:21 pm
Quote
is there any example?
Yes. Did you try my code in the link I posted above? It should close the sockets correctly.
Pages: 1 ... 182 183 [184] 185 186 ... 400