Show Posts
Pages: 1 [2] 3 4 ... 359
16  Using Arduino / Programming Questions / Re: GSM 900 sms ÿÿ0€ error reading sms messages on: April 16, 2014, 08:30:20 am
I don't know about the GSM, but normally, Arduino functions return -1 when no characters are available from that device. That will display the funny y.
Funny y = ÿ = 255 = -1 = no characters available
17  Using Arduino / Networking, Protocols, and Devices / Re: Testing Ethernet shield example on: April 16, 2014, 06:43:48 am
Try this sketch. It tests the SPI bus and the SPI end of the w5100. Does it show 192.168.2.2 on the serial monitor? If it shows anything else, like 0.0.0.0, then check the shield connection to the Arduino. Insure all pins are inserted into the sockets.
Code:
#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,2,2);

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

  // disable SD card if one in the slot
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  Serial.println("Starting w5100");
  Ethernet.begin(mac,ip);
  Serial.println(Ethernet.localIP());
}

void loop() {
}

BTW, the dhcp example I posted in Programming wouldn't work if you are connected directly to your PC. It doesn't have a dhcp server set up on that interface. That would have been helpful to know.
18  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield Coding on: April 16, 2014, 06:37:14 am
I will reply to the post you started in Networking. It belongs there.
edit: I see a moderator merged both subjects. Thanks!  smiley
19  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield Coding on: April 15, 2014, 08:17:03 am
Try this test code. It uses dhcp to get an ip and the other network stuff. If you don't understand the results, post them here and I'll see if I can help you.
Code:
#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {  0x00, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

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

  // disable SD SPI
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  Serial.print(F("Starting ethernet..."));
  if(!Ethernet.begin(mac)) Serial.println(F("failed"));
  else {
      Serial.print(F("IP: "));
      Serial.println(Ethernet.localIP());
      Serial.print(F("Subnet: "));
      Serial.println(Ethernet.subnetMask());
      Serial.print(F("Gateway: "));
      Serial.println(Ethernet.gatewayIP());
      Serial.print(F("DNS server: "));
      Serial.println(Ethernet.dnsServerIP());
}

void loop() {
}

edit: My bad. I forgot the includes. I added them.
20  Using Arduino / Programming Questions / Re: DHCP Lease renewal on: April 15, 2014, 06:11:03 am
Return values 1 and 3 indicate the renew failed, and the lease was not renewed. As I recall, maintain will reattempt to renew the lease at 3/4 the lease time, and again when the lease expires. edit: In the mean time, it will continue to use the ip it was last assigned.

Normally return values 2 or 4 indicate the lease was renewed successfully, usually indicating your device got the same ip as before, but not guaranteed you got the same ip. That depends on the router running the dhcp server.
21  Using Arduino / Networking, Protocols, and Devices / Re: Using Arduino UNO and WIZ550io - crashes when using ethernet.begin(macData) on: April 15, 2014, 06:05:46 am
Post the code or a link to that example code.
22  Using Arduino / Networking, Protocols, and Devices / Re: Arduino wiznet5100 and remote ip trougth http service on: April 15, 2014, 06:03:03 am
Post the code you tried to get the remote ip or links to that code. The "Tinywebserver" may be so small it doesn't include the low level functions required to use the mods.
23  Using Arduino / Programming Questions / Re: DHCP Lease renewal on: April 15, 2014, 05:27:47 am
You must call Ethernet.maintain() in the loop function. You can call it as often as you want, like every iteration of the loop because it does nothing until half the lease time has expired.

edit: I use this. Ethernet.maintain() returns 0 if no action was taken, so nothing is printed for  a zero return value.
Code:
     byte rtnVal = Ethernet.maintain();
      switch(rtnVal) {
        case 1: Serial.println(F("\r\nDHCP renew fail"));        
                break;
        case 2: Serial.println(F("\r\nDHCP renew ok"));        
                break;
        case 3: Serial.println(F("\r\nDHCP rebind fail"));        
                break;
        case 4: Serial.println(F("\r\nDHCP rebind ok"));        
                break;
      }
     
24  Using Arduino / Networking, Protocols, and Devices / Re: Why can't I assign my Ethernet shield and IP address? on: April 14, 2014, 08:26:10 am
I think this should be the warning:
DO NOT USE SD CARD IF USING ETHERNET COMMUNICATION UNLESS YOU UNDERSTAND HOW TO USE BOTH TOGETHER

edit: Or considering the number of SPI problems posted here, how about this warning?
DO NOT USE MULTIPLE SPI DEVICES UNLESS YOU UNDERSTAND HOW TO USE THE SPI BUS
25  Using Arduino / Networking, Protocols, and Devices / Re: Communicate between microcontrollers: Automatic address and request-less send? on: April 14, 2014, 08:04:00 am
Is there something wrong with using digital pins for the button presses? Use one digital pin from each remote microcontroller to the core Arduino to determine "first press" and use the serial for transferring stuff like scores, etc.

26  Using Arduino / Networking, Protocols, and Devices / Re: RFID Reader + Ethernet Shield on: April 14, 2014, 07:24:58 am
The Ethernet Shield has a hardware flaw. The MOSI line is active the whole time. It ignores it's chip select signal. FIX: I bought a new Ethernet shield that included a fix.
The MOSI line (Master Out, Slave In) should be active the whole time. It would be the MISO line (Master In, Slave OUT) that would cause problems.

Which ethernet shield model had the flaw? Which model did you replace it with?
27  Using Arduino / Networking, Protocols, and Devices / Re: Mega 2560 and Ethernet dose not work. Please help me. on: April 13, 2014, 06:25:38 am
1) That disables the SPI interface on the w5100. The Ethernet.begin() call has a bug that leaves the w5100 slave select LOW (active) when the function is complete. If you try to use any other SPI device, that would cause problems. If you read or write to the w5100 first, those functions leave the w5100 SPI disabled like they should.

2) Sounds like the delay is caused by your server.

3) Open an SD file and write the response to it the same way you write it to the serial monitor.
28  Using Arduino / Networking, Protocols, and Devices / Re: Seeed Ethernet + Mega 2560 ICSP on: April 12, 2014, 08:01:32 pm
The W5100 slave select for that unit is D10.
http://www.seeedstudio.com/wiki/Ethernet_Shield_V1.0
The default slave select for the SPI on the Uno is D10. The default slave select for the Mega is D53. But that does not change the slave select for the W5100. It is still D10 on that shield.

29  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet + 2 SPI devices on: April 12, 2014, 06:12:11 pm
Same as above. Use a slave select for the RC522 that is not D10 or D4. The solution for adilutan was using D7.

30  Using Arduino / Networking, Protocols, and Devices / Re: Seeed Ethernet + Mega 2560 ICSP on: April 12, 2014, 06:09:06 pm
If you are using the ICSP pins for the SPI data lines, then all should be the same as the Uno. D10 is still the w5100 slave select.
Pages: 1 [2] 3 4 ... 359