Show Posts
Pages: [1] 2 3 ... 404
1  Using Arduino / Programming Questions / Re: How to detect new WifiClient? on: Today at 07:26:39 am
I can't tell what is wrong with your code if you post pseudo-code. There is a bunch of things wrong with it.

I have an example for the ethernet shield in the playground.
http://playground.arduino.cc/Code/WebServerST

I use the same code changed only slightly for the WiFi shield, and it works. The WiFi server library has some pretty serious bugs, so be forewarned. It uses only one socket, so multiple client requests performed simultaneously can cause the incorrect or corrupted files to be returned by the server.
2  Using Arduino / Programming Questions / Re: How to detect new WifiClient? on: Today at 06:58:10 am
If you don't want to know what is wrong and just how to do it, then you apparently already know. Here it is:
Code:
  WifiClient client = server.available();
  if(client){
3  Using Arduino / Networking, Protocols, and Devices / Re: Does a slave on an SPI connection require a matching clock source? on: September 01, 2014, 01:59:03 pm
The SPI bus has its own timing (clock line is SCK) so it should work as long as the SPI master clock timing stays within the frequency that the SPI slave can handle.

FWIW: I haven't tried a SPI slave yet.
4  Using Arduino / Networking, Protocols, and Devices / Re: read data from SPI on: September 01, 2014, 01:21:19 pm
I don't think you are communicating with that IC correctly. Here is the online datasheet:
http://www.farnell.com/datasheets/1793816.pdf

Take a look at page 9. The communication requires 64 bits (8 bytes). The first 4 bytes are for the left channel, and the second 4 bytes are for the right channel, depending on the state of the WS line. The WS line is not the CS line. It should be a separate line. The CS line is not connected to the IC, only the WS line. The WS line should be LOW for the first 4 bytes and HIGH for the second 4 bytes.

edit: And how the IC responds depends on the state of the L/R line. If the L/R line is LOW, it responds during the WS line LOW (first 4 bytes), and if it is HIGH, it responds during the WS line HIGH (second 4 bytes).

If the slaveSelectPin (D10) is connected to the WS line of the IC, I would try this:
Code:
 digitalWrite(slaveSelectPin,LOW);  
  delayMicroseconds(1);              
  
  byte LeftOne = SPI.transfer(255);
  byte LeftTwo = SPI.transfer(255);
  byte LeftThree = SPI.transfer(255);
  byte LeftFour = SPI.transfer(255);
  
  digitalWrite(slaveSelectPin,HIGH);

  byte RightOne = SPI.transfer(255);
  byte RightTwo = SPI.transfer(255);
  byte RightThree = SPI.transfer(255);
  byte RightFour = SPI.transfer(255);
 
  
5  Using Arduino / Installation & Troubleshooting / Re: ARDUINO UNO, ETHERNET SHIELD AND 120 DEG FLAME SENSOR TROUBLESHOOTING on: August 31, 2014, 06:05:18 pm
First, if this is an Uno, you can't use the led on D13. That is the SPI bus clock.

Second, Twitter now requires SSL, and the ethernet library doesn't support SSL. You must use another server as a relay.
6  Using Arduino / Programming Questions / Re: Error Opening File on SD Ethernet Shield on: August 31, 2014, 02:31:29 pm
Right! I was unconsciously using pin 10 as an output to control electromagnet 5 (pulsed on and off). I had forgotten about that. So is pin 10 taken up by using the Ethernet shield? I could just reassign electromagnet to another pin output.
Yes. D10 is the SPI slave select for the w5100 ethernet controller. If you set D10 LOW, it activates the w5100 SPI MISO line (becomes a driving output rather than hi-z). That interferes with the SD MISO line, and could cause damage to one or both devices.

Use another pin.
7  Using Arduino / Programming Questions / Re: Error Opening File on SD Ethernet Shield on: August 31, 2014, 12:16:39 pm
You can't do this:
Code:
  digitalWrite(10, LOW);
...then try this:
Code:
File dataFile = SD.open("data.csv", FILE_WRITE);
D10 is the SPI slave select for the w5100. You do not want it LOW (active) while opening the SD file.
8  Topics / Home Automation and Networked Objects / Re: Safe way? on: August 31, 2014, 10:14:29 am
Considering you are asking the questions you are asking, the best tool you could have at this point is a friend who is familiar with the handling of 240 volt circuits and knows CPR.
9  Using Arduino / Storage / Re: simple temp logger, error with mini sd card on eth shield on: August 31, 2014, 08:04:01 am
Probably a soldering iron. Don't know if a cutter will do the job without damaging the board traces or the IC.

You may need a combination of both. The soldering iron to soften the bridges, and the cutter/knife to remove the excess solder. A solder wick would be best tho.
10  Using Arduino / Storage / Re: simple temp logger, error with mini sd card on eth shield on: August 31, 2014, 07:58:28 am
You can try removing them. Hopefully the solder bridges haven't caused any permanent damage to any ICs on the shield.
11  Using Arduino / Storage / Re: simple temp logger, error with mini sd card on eth shield on: August 31, 2014, 07:35:08 am
Have you tried any of the ethernet examples yet? There have been reports of faulty soldering on some ethernet shields. Check your w5100 for solder bridges. That could cause a fail on the SD starup if the w5100 has solder bridges on the SPI pins.

Here is a pic of a w5100 with solder bridges. The red arrows point to them. There should be none of those.
http://i681.photobucket.com/albums/vv178/grue2/Computers/pict10842.jpg
12  Using Arduino / Storage / Re: simple temp logger, error with mini sd card on eth shield on: August 31, 2014, 07:16:12 am
On a Mega 2560, the SD library will take care of pin 53 for you. It is only D10 that must be set to OUTPUT and HIGH to disable the w5100 SPI. This is not necessary on the Uno because the w5100 SPI is disabled "by accident" during the SPI.begin() function called by the SD.begin() function.

Are there any other devices connected to the Mega? Insure nothing connected to D4, D10, or D50 to D53.
13  Using Arduino / Storage / Re: simple temp logger, error with mini sd card on eth shield on: August 31, 2014, 06:48:53 am
BEER!! YUM!!  smiley-grin

Did you disable the w5100 SPI before starting the SD?
Code:
void setup()
{
  // disable w5100 SPI
  pinMode(10, OUTPUT);
  digitalWrite(10, HIGH);
 
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  // rest of your setup
14  Topics / Home Automation and Networked Objects / Re: possible networking problem with wifi shield and home network on: August 30, 2014, 07:09:05 pm
If the firmware is still showing 1.0.0, then the upgrade did not work.
15  Using Arduino / Networking, Protocols, and Devices / Re: [SOLVED ???] UDP.write always returns 0 on: August 30, 2014, 01:05:39 pm
Quote
I thought setting the CS pin to LOW enables the SPI communication...??????
It does. At least it is supposed to.
Pages: [1] 2 3 ... 404