Wiznet W5500とGR-KURUMIで始めるお手軽ネットワーキング? [NETWORK]
Arduino互換?だよね、そのGR-KURUMIを搭載するネットワーク基板を作成してみました。多分Arduino Pro Miniでも同様に使える筈。
こんな感じでぐぐるのhtml文章をシリアルに出力できます。
/*GR-KURUMI Sketch Template Version: V1.04*/ #include <RLduino78.h> #include <SPI.h> #include <Ethernet.h> char server[] = "www.google.com"; // name address for Google (using DNS) // if you don't want to use DNS (and reduce your sketch size) // use the numeric IP instead of the name for the server: //IPAddress server(74,125,232,128); // numeric IP for Google (no DNS) IPAddress ip(192,168,100,177); byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; EthernetClient client; const int RSTn = 4; // LOW active // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. Serial.begin(9600); Serial.println("initialize w5500..."); pinMode(RSTn, OUTPUT); digitalWrite(RSTn, LOW); //w5500 reset start delay(10); digitalWrite(RSTn, HIGH); //w5500 reset end if (Ethernet.begin(mac) == 0) { Serial.println("Failed to configure Ethernet using DHCP"); // no point in carrying on, so do nothing forevermore: // try to congifure using IP address instead of DHCP: //Ethernet.begin(ip); Ethernet.begin(mac, ip); } delay(1000); Serial.println("connecting..."); // if you get a connection, report back via serial: if (client.connect(server, 80)) { Serial.println("connected"); // Make a HTTP request: client.println("GET /search?q=arduino HTTP/1.1"); client.println("Host: www.google.com"); client.println("Connection: close"); client.println(); } else { // if you didn't get a connection to the server: Serial.println("connection failed"); } } // the loop routine runs over and over again forever: 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: while(true); } }
ネットワークコントロールチップにはWiznetのW5500を採用。
かつてW5100とか使っていましたが、あれは熱かった(笑)。正常に動いているんだけれど物凄くその熱さに不安が、、、
ですがw5500はほんのり温かい程度で心理的に安心です(笑)。
多分w5200からだと思うけれどSPI廻りを刷新していて、データ転送の効率化が計られています。
GR-KURUMIにTCPのDISCARDのサーバーを仕立ててPC上のTera termから適当なファイルを転送した場合、120Kbyte/s程度で受信可能でした。
なかなか素晴らしいです。しかもw5500の受信バッファのチューニングをしたりせず、またネットワークは無線LANを有線に変換するコンバーター経由ですから。
w5500は今、ストロベリーリナックスさんから三百数十円で購入できますんで、みなさんもお試しを!。
2013-11-15 00:22
nice!(1)
コメント(2)
トラックバック(0)
はじめまして。WIZNETのKIMと申します
この度、弊社の製品を使ったプロジェクトを紹介するブログをはじめる予定なのですが
よろしければ、この投稿をWIZNETにほんブログの方に紹介することと画像の利用について許諾を頂けないでしょうか
ご検討頂き、ご返信頂けますよう、何卒、宜しくお願い致します。
doublesk@wiznettechnology.com
by SSKIM (2015-04-20 09:53)
はじめましてKIMさん、WIZNETの製品をいつも利用させていただいています。
御申し出の紹介の話ですが当方はまったく問題ありません。たいへん光栄です。
よろしくお願いいたします。
by hamayan (2015-04-20 23:05)