전체상품목록 바로가기

본문 바로가기


현재 위치
  1. home
  2. community
  3. 기술문의 :)

기술문의 :)

기술문의 게시판 입니다.

상품 게시판 상세
subject 안녕하세요 문의드립니다.
writer 이진해 (ip:)
  • date 2014-08-20 09:10:51
  • like 추천하기
  • view 116
rating 0점

 지금 현재 아두이노 우노 R3에 이더넷 쉴드 E형을 부착해서 사용 중인데요.

 아두이노 우노를 클라이언트로 두고 PC를 서버로 뒀을 때 서버 접속을 했다가 못했다가 정도가 너무 크게 나타납니다. 이더넷 쉴드가 문제가 있는 건지 궁금합니다.

소스입니다. 예제소스에서 살짝 수정했습니다.
#include <DhcpV2_0.h>
#include <DnsV2_0.h>
#include <EthernetClientV2_0.h>
#include <EthernetServerV2_0.h>
#include <EthernetUdpV2_0.h>
#include <EthernetV2_0.h>
#include <utilV2_0.h>

#include <SPI.h>

int led = 6;  // led 6 pin

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress server(192,168,0,11); // Google
IPAddress ip(192,168,0,2);
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
  Ethernet.begin(mac,ip);
 // Open serial communications and wait for port to open:
  Serial.begin(9600);


  // start the Ethernet connection:

  pinMode(led, OUTPUT);

  // give the Ethernet shield a second to initialize:
  delay(1000);
  Serial.println("connecting...");

  // if you get a connection, report back via serial:
  if (client.connect("192.168.0.11", 80)) {
    Serial.println("connected");

    client.println("GET /update.php HTTP/1.0");
    client.println();
  }
  else {
    // kf you didn't get a connection to the server:
    Serial.println("connection failed");
  }
}

void loop()
{
  // if there are incoming bytes available
  // from the server, read them and print them:
  if (client.available()) {
    char c = client.read();

    Serial.print(c);

  }
  }

  // if the server's disconnected, stop the client:
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();

    // do nothing forevermore:
    for(;;)
      ;
  }
}

file
password 삭제하려면 비밀번호를 입력하세요.
댓글 수정

password :

/ byte

비밀번호 : 확인 취소

댓글 입력

commentsname : password : 관리자 답변 보기

/ byte

왼쪽의 문자를 공백없이 입력하세요.(대소문자구분)

회원에게만 댓글 작성 권한이 있습니다.

관련 글 보기

관련글 모음
번호 상품명 제목 작성자 작성일 조회
12321 단종 - 제품사용문제 미취급 [TE91000PSLD] 아두이노 이더넷 쉴드 E형 (W5200 Ethernet Shield) 이더넷 실드 연결 문제 이부형 2014-11-04 5
12329 단종 - 제품사용문제 미취급 [TE91000PSLD] 아두이노 이더넷 쉴드 E형 (W5200 Ethernet Shield) 이더넷 실드 연결 문제 아트로봇 2014-11-05 8
12436 단종 - 제품사용문제 미취급 [TE91000PSLD] 아두이노 이더넷 쉴드 E형 (W5200 Ethernet Shield) 이더넷 실드 연결 문제 이부형 2014-11-11 8
12599 단종 - 제품사용문제 미취급 [TE91000PSLD] 아두이노 이더넷 쉴드 E형 (W5200 Ethernet Shield) 이더넷 실드 연결 문제 아트로봇 2014-11-20 3
11362 단종 - 제품사용문제 미취급 [TE91000PSLD] 아두이노 이더넷 쉴드 E형 (W5200 Ethernet Shield) 안녕하세요 문의드립니다. 이진해 2014-08-20 116