ความรู้แน่น ฟรีสำหรับชุมชน ArduinoAll ที่นี่เท่านั้น

ฟรีและดีที่สุด คอร์สอบรม Arduino + NodeMCU
ทำเพื่อแบ่งปัน ห้ามนำไปจำหน่าย หรือเก็บเงินค่าเรียน
  !!!


  


AllNewStep รับประกันคุณภาพทุกชิ้น วันจันทร์-ศุกร์แจ้งชำระสินค้าก่อน 14.00 จัดส่งทันทีวันนี้ค่ะ

กรุงเทพ /ภาคกลาง ได้พรุ่งนี้


*** สินค้าทุกชิ้น ถ้าสามารถทำรายการสั่งซื้อได้ แสดงว่ามีครบทุกรายการค่ะ *** 

พิมพ์ค้นหาบทความ หัวข้อกระทู้ และสินค้าในเว็บ AllNewStep ได้ที่นี่
QUOTE 

ardunio W5100

muxmonster

รบกวนสอบถามหน่อยครับว่า W5100 ที่ผมซื้อมา มัน Fix Ipaddress ไปแล้ว เครื่องในวงแลน ping หาเจอ แต่ W5100 ติดต่อกับ webserver ไม่ได้ ทั้งที่ webserver อยู่ในวงแลนเดียวกันและใช้ example ของโปรแกรม Arduino ในการ Compile ขอบคุณครับ

QUOTE 
ความคิดเห็นที่ #1
เจ้าของร้าน

ถ้า ping เห็นอุปกรณ์แล้ว w5100 น่าจะทำงานได้ปกติ

อาจเป็นที่ network ติด firewall หรือบางจุด ถ้ามีเราเตอร์ลองต่อโดยตรงกับ w5100 แล้วทดลองใหม่ครับ

QUOTE 
ความคิดเห็นที่ #2
muxmonster

#include "SPI.h"

#include "Ethernet.h"

 

/*

  Web client

 

 This sketch connects to a website (http://www.google.com)

 using an Arduino Wiznet Ethernet shield.

 

 Circuit:

 * Ethernet shield attached to pins 10, 11, 12, 13

 

 created 18 Dec 2009

 by David A. Mellis

 modified 9 Apr 2012

 by Tom Igoe, based on work by Adrian McEwen

 

 */

// Enter a MAC address for your controller below.

// Newer Ethernet shields have a MAC address printed on a sticker on the shield

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

//byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x76, 0x09 };

//byte mac[] = { 0x00, 0x19, 0xE0, 0x60, 0x02, 0xAD };

// if you don't want to use DNS (and reduce your sketch size)

// use the numeric IP instead of the name for the server:

//char server[] = "www.google.com";    // name address for Google (using DNS)

// Set the static IP address to use if the DHCP fails to assign

IPAddress server(192,168,2,29);  // numeric IP for Google (no DNS)

//char server[] = "banmihospital.moph.go.th";

 

//IPAddress server(172, 217, 31, 99);

IPAddress ip(192, 168, 2, 30);

//byte ip[] = { 192, 168, 0, 30 };

IPAddress nsk(255, 255, 252, 0);

IPAddress gw(192, 168, 2, 40);

//byte gw[] = { 192, 168, 2, 40 };

IPAddress d(8, 8, 4, 4);

// 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;

int port = 80;

void setup() {

  // Open serial communications and wait for port to open:

  Serial.begin(9600);

  // start the Ethernet connection:

/*

  if (Ethernet.begin(mac) == 0) {

    Serial.println("Failed to configure Ethernet using DHCP");

    // try to congifure using IP address instead of DHCP:

    Ethernet.begin(mac,ip,d,gw,nsk);

  }

 */

  Ethernet.begin(mac,ip,gw,nsk);

  // give the Ethernet shield a second to initialize:

  delay(1000);

  //Serial.println(Ethernet.localIP());

  Serial.println("connecting...");

  /*

  Serial.println(ip);

  Serial.println(nsk);

  Serial.println(gw);

  */

}

void loop() {

  //Serial.println(client.connect(server,80));

 

  Serial.println(client.status());

  

  if (client.connect(server, port)) {

    Serial.println("connected");

    // Make a HTTP request:

    client.println("GET /program/cc/arduinopj/index.php HTTP/1.1");

    //client.println("GET /search?q=arduino HTTP/1.1");    

    client.println("Host: bmh_arduino_project");

    client.println("Connection: close");

    client.println();

  

  } else {

    // if you didn't get a connection to the server:    

    Serial.println("connection failed");

  }

    Serial.println("<<goto Exit>>");

    client.stop();

    delay(2000);

}

เครีื่อง pc เข้าใชงานหน้าเว็บได้ อ่ะครับ ไม่ทราบว่าผม Code ตรงไหนผิดหรือเปล่าครับ

QUOTE 
ความคิดเห็นที่ #3
เจ้าของร้าน

โคดไม่น่าผิด มีตัวอย่างในหน้าบทความ

น่าจะผิดที่เครือข่ายหรือ firewall ตรงนี้ต้องเช็คที่หน้างานครับ

QUOTE 
ความคิดเห็นที่ #4
muxmonster

ออครับ รบกวนถามอีกเรื่อง พอดีผมเปลี่ยนมารับ ip จาก Router แล้วพอเปิด serial.print ดูพบว่าไม่มีอะไรเกิดขึ้นเลยครับ สาย lan อันใหม่ครับ ส่วน Router แจก ip ให้กับ pc ได้ตามปกติครับ

QUOTE 
ความคิดเห็นที่ #5
เจ้าของร้าน

ได้ซื้อกับทางร้านมั้ยครับ ขอเลขที่สั่งซื้อด้วย จะได้ตรวจสอบได้ครับ

แสดงความคิดเห็นที่ 1-5 จากทั้งหมด 5 ความคิดเห็น
ขาย ARDUINO
คุณภาพ อันดับ 1

ได้รับรางวัลร้านยอดเยี่ยม
ตั้งแต่ปี 2558
ขาย Arduino
วีดีโอสอน Arduino

สอน esp8266

สอน Arduino IoT
สอน Arduino แบบเร็ว

สอน NodeMCU

อุปกรณ์ Arduino

MEMBER ZONE

พูดคุย-สอบถาม