Show Posts
Pages: 1 ... 179 180 [181] 182 183 ... 408
2701  Using Arduino / Networking, Protocols, and Devices / Re: Send OSC messages through W5100 ethernet shield on: May 10, 2013, 03:30:52 pm
I don't see a UDP.begin(localPort) call in setup. That will cause a fail.
http://arduino.cc/en/Reference/EthernetUDPBegin
2702  Topics / Home Automation and Networked Objects / Re: POST request on a webserveur using Arduino Ethernet shield on: May 10, 2013, 10:24:06 am
Quote
I already tested this and I know that it is working. But for my project I use a temperature sensor connected to the Arduino. So I don't know the temperature value in advance, and it's not my job to "complete a form".
It isn't your job to "complete a form". The Arduino/ethernet shield is doing that for you. It sounds to me like it is working, and that is good. Much better than not working.

Quote
Actually I would like something which send the data automatically to my server and after that (next step) I will be able to gather a database (MySql or Sqlite for instance).
It sounds like the Arduino is already doing that. Now you need to regulate how often you send that to your server. I use this kind of stuff with Apache/PHP/MySQL all the time.
2703  Topics / Home Automation and Networked Objects / Re: POST request on a webserveur using Arduino Ethernet shield on: May 10, 2013, 09:40:37 am
You can't directly with a URL in the address bar. You need a form with a METHOD=POST to do that.

If you want to test it, add this to your php page.
Code:
<?php
    
echo 'POST Temperature = ' htmlspecialchars($_POST["data"]) . '!<br>';
    echo 
'GET Temperature = ' htmlspecialchars($_GET["data"]) . '!';
?>
Then use this in your browser address bar
http://192.168.0.55/test.php?data=5
2704  Using Arduino / Storage / Re: Arduino Mega 2560 R3 with Official Ethernet Shield R3 on: May 09, 2013, 07:42:46 pm
Quote
I have searched the internet and found that the shield does sit on top of the Mega, but I can't find out how to reassign the pins to the Mega's 50, 51, 52, 53 SPI pins?
That is because you don't need to reassign, jumper, or pin bend anything to use the shield on the Mega. The SPI data lines are on the ICSP pins. Just connect it and go.
2705  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield failing? on: May 09, 2013, 01:39:09 pm
Try this server code. Insure to change the network settings to suit your network.
http://playground.arduino.cc/Code/WebServerST

Here is NTP client code. Checks NTP time every 10 minutes.
http://arduino.cc/forum/index.php/topic,137789.msg1038071.html#msg1038071

Both show how to initialize or disable a SD card to work with the w5100.
2706  Using Arduino / Networking, Protocols, and Devices / Re: PHP data transfer with official Wifi shield on: May 09, 2013, 10:26:34 am
Quote
HTTP/1.1 404 Not Found
It did not find that file. What happens if you use this in a web browser address bar?
http://my_website.com/my_folder/hello_world.php?ID=0

Is your site being hosted on a virtual server? If so, like billroy said, you must send a Host parameter. I also use a "Connection: close" and "HTTP/1.1".
Code:
     // Make a HTTP request:
      client.println("GET /my_folder/hello_world.php?ID=0 HTTP/1.1");
      client.println("Host: my_website.com\r\nConnection: close\r\n");
I eliminated the last client.println() by putting it in the Host send (\r\n). That way, it all goes in one packet.
2707  Using Arduino / Storage / Re: Hello and Help! SD card initialised indication... on: May 08, 2013, 06:35:44 pm
This is not needed either, but if I do one, I do both. Just a habit.
Code:
  // make sure that the default chip select pin is set to
  // output, even if you don't use it:
  pinMode(10, OUTPUT);
If it makes no difference, then the rest is up to you.  smiley-wink
2708  Using Arduino / Storage / Re: Hello and Help! SD card initialised indication... on: May 08, 2013, 05:52:01 pm
Intermittently the w5100 SPI is trashing up the SPI bus unless you disable it during your SD tests. Add the line below to your setup function.
Code:
Serial.print("Initializing SD card...");
  // make sure that the default chip select pin is set to
  // output, even if you don't use it:
  pinMode(10, OUTPUT);
  // Add this line. It disables the w5100 SPI
  digitalWrite(10, HIGH);

  // now SD.begin()
How does that do?
2709  Using Arduino / Storage / Re: sd.open returns '0' ? on: May 08, 2013, 11:40:29 am
SRAM is data memory. The memory reported after a compile is program memory only. They are separate. An Uno has 2K SRAM. A Mega has 8K SRAM.

You can save SRAM (data memory) by keeping static strings in program memory instead of copying to SRAM. That is what the F() function does. You can see how to use it in the freeRam example above.
2710  Using Arduino / Storage / Re: sd.open returns '0' ? on: May 08, 2013, 10:55:29 am
I didn't count every byte, but if that is an Uno, I suspect you are running out of SRAM. You might be able to eliminate some SRAM usage by using the F() function on those static strings.

This function works for me to check SRAM remaining. This is how to use it. If you run out of SRAM, it does not show zero. It shows a negative number or a very large number.
Code:
int freeRam() {
  extern int __heap_start,*__brkval;
  int v;
  return (int)&v - (__brkval == 0 ? (int)&__heap_start : (int) __brkval); 
}

void setup() {
  Serial.begin(9600);
  // all your setup stuff, then

  Serial.print(F("SRAM = "));
  Serial.println(freeRam());
}
2711  Using Arduino / Storage / Re: sd.open returns '0' ? on: May 08, 2013, 10:21:39 am
SD.open() will also fail if you run out of SRAM. I see you are using some network device that uses a client.print() call. You should post your entire sketch.
2712  Using Arduino / Programming Questions / Re: can the arduino start up when solar panels get light. on: May 07, 2013, 06:39:39 am
Yes. The feature is called Low Voltage Disconnect (LVD). Not all solar chargers have it.

Here is a PWM model:
http://www.solar-electric.com/ss-20l.html

Here is a MPPT model:
http://www.solar-electric.com/mosumpsochco.html
2713  Using Arduino / Installation & Troubleshooting / Re: Ethernet shield not connecting to the Webserver - new to Arduino on: May 06, 2013, 06:00:02 am
Your shield is connecting and getting this as a return from the php server:
Code:
        echo '@'.$tttb1.'&tttb2='.$tttb2.'$';//response
It apparently is printing the "@" and the two values ("01") with the "$", but I don't know why it is not printing the "&ttb2=" part in the middle though.

You should start another topic in networking.
2714  Topics / Home Automation and Networked Objects / Re: Problems with Arduino DUE and ENC28J60. on: May 05, 2013, 06:46:28 am
This will probably cause problems with SPI devices connected to a Due.
http://arduino.cc/en/Reference/SPITransfer
The Due needs an additional parameter to continue sending additional bytes over the SPI. Otherwise, it deactivates the SPI slave select after each call to SPI.transfer().
2715  Using Arduino / Networking, Protocols, and Devices / Re: DHCP Address Printer Sketch not responding on: May 05, 2013, 06:10:32 am
Sounds right. Are you getting an ip from the laptop when you start the Arduino connected to the laptop ethernet port?
Pages: 1 ... 179 180 [181] 182 183 ... 408