Show Posts
Pages: [1] 2
1  Using Arduino / Networking, Protocols, and Devices / Re: School Proxy server problems. on: September 21, 2012, 06:09:10 pm
As Pylon said it is highly likely to be your network configuration. If your network admin at school told you the addresses were in  10.2.X.X then the mask is likely to be 255.255.0.0, but you definitely need to find the gateway address and put both of those pieces of information into the Ethenet.begin.

Paul
2  Using Arduino / Programming Questions / Re: Simple code crashes with no apparent cause on: September 06, 2012, 05:03:42 pm
Unless you have applied a patch to the memory handling (the free function iirc) you will probably be suffering from the bug that shows up through use of String. Avoid using String and stick to char and you wil avoid the memory handling bug. That said, there is limited memory as Nick has reffered you to.

Paul
3  Using Arduino / Storage / Re: Small SDCard library on: September 06, 2012, 02:24:40 pm
Exactly which library are you using? If using the SD try switching to SDfat (leaner faster and better supported).

Paul
4  Using Arduino / Networking, Protocols, and Devices / Re: i2c communication problem with two arduinos on: September 05, 2012, 11:56:45 am
You dont' say what actually happens or what does not happen that you expect to.

Code:
for (int i= 0; i< (sizear); i++){   
     
     Wire.write(arr);   
     delay(500);
   }

looks wrong as you are constantly sending the same byte. I suspect you want something like

Code:
Wire.write(arr[i]);

Paul
5  Using Arduino / Project Guidance / Re: loop only runs once on: September 05, 2012, 11:14:49 am
Using sizeof (tile) will surely return the number of bytes in tile and since it is an integer array twice the value you want.

Paul
6  Using Arduino / Networking, Protocols, and Devices / Re: Arduino send WOL message on: September 03, 2012, 08:51:19 am
Have you checked the contents of the packet that is being sent?
From hte code you posted I can't see how sizeof can return the size of 6 bytes for the mac address as it can only see that it is a byte array that is passed in. Check that size of is giving the right value.

I'm thinking that sizeof may be giving you a sizeof the pointer which I am assuming is 2 bytes on the Arduino.

Paul
7  Using Arduino / Networking, Protocols, and Devices / Re: Arduino gives up / Flooding ethershield? on: August 30, 2012, 06:41:59 pm
I notice that you are using the String class in the ServerComms routine. The String class can cause problems with random hang ups etc. due to an error in the Free routine. There is a patch available I believe, but in most casses coding without using the String class is a better approach.

Paul
8  Using Arduino / Storage / Re: Naming Files Sequentially? on: August 30, 2012, 06:26:42 pm
Another solution may be to keep an extra file on the SD card that has the name of the last used datafile - that way you won't end up scanning for the last file to work out which one it is. Just an idea - I haven't tried it on an Arduino.

If the Arduino powers off when you swtich off the ignition do you have plans to ensure that any data not yet written to the SD card is written before power is lost?

Use of String is somewhat hazardous at present due to a bug in the heap memory managment. You can obtain a patch to correct the problem, but may be better off not using Strings at all just use normal character strings.

Paul
9  Using Arduino / Programming Questions / Re: PROGMEM char array on: August 29, 2012, 07:09:59 am
So ff should be an unsigned char  as in?

Code:
unsigned char ff;

Paul
10  Using Arduino / Programming Questions / Re: PROGMEM char array on: August 29, 2012, 06:05:40 am
Surely you want Serial.print(ff, HEX); rather than just Serial.print(ff);
 if you want the output to look the same.

Having said that, it looks like serial.print is assuming you have passed a long rather than a char, which I don't understand yet.

Paul
11  Using Arduino / Programming Questions / Re: reducing the amount of code in ram to free up space on: August 29, 2012, 04:48:26 am
Which version of the IDE is in use?

Some simple things such as replacing

 
Code:
lcd.setCursor(0,0); 
  lcd.print("Saving.     ");
  delay(500);
  lcd.setCursor(0,0);
  lcd.print("Saving..    ");
  delay(500);
  lcd.setCursor(0,0);
  lcd.print("Saving...   ");
  delay(500);
  lcd.setCursor(0,0);
  lcd.print("Saving....  ");
  delay(500);
  lcd.setCursor(0,0);
  lcd.print("Saving..... ");
  delay(500);
  lcd.setCursor(0,0);
  lcd.print("Saving......");
  lcd.setCursor(0,0);
 

with a loop that adds the requisite numbre of dots/spaces will mean you only need 3 string ("Saving","."and," ") so using 1/6 of the storage you currently use might help.
12  Using Arduino / Networking, Protocols, and Devices / Re: UDP receiving packets inside TImer Routine on: August 28, 2012, 06:45:55 pm
Is teh timer routine you refer to an interupt? I just wondered as receiving an ethnet packet presumably uses an interupt, and therefore are you trying to interupt during an interupt which doesn't work and just loses everything?

Only a suggestion/guess as I  have seen references to not using serial print commands in interupt routines.

Paul
13  Using Arduino / Storage / Re: sd with serial communication, how do? on: August 25, 2012, 05:30:08 pm
Be careful using Strings as these are prone to causing memory problems - and many say best avoided.

Paul
14  Using Arduino / Storage / Re: sd with serial communication, how do? on: August 24, 2012, 06:06:23 pm
Code:
while(mySerial.available())
  {
    Serial.println(mySerial.read());
  } 
 
  mySerial.println("fcreate test3.txt\r\n");
  delay(50);

With this code you are sending "fcreate test3.txt" for every character recieved over mySerial. Is this really what you want to do?

Code:
while(mySerial.available())
  {
    Serial.println(mySerial.read());
  }
 

You then exit the first loop when mySerial.available() returns false and enter try and enter the second loop above expecting mySerial.available() to return something different.

Can you explain what you are tyring to achieve, then maybe someone will be able to give you more helpful advice?
15  Using Arduino / Storage / Re: Sd card data loging for rfid on: August 23, 2012, 04:43:44 am
Not sure if this will solve your problem, but you don't appear to be NULL terminating your code string anywhere. Depending on what is in the string the println may work or may run off through memory and hang. Try adding a
code[bytesread] = 0;
after your while loop (and check that bytesread is still <10 to avoid overflow).
Pages: [1] 2