Arduino Nano mit Ethernet Modul an fhem anbinden

Begonnen von Ralf9, 08 Juli 2015, 23:02:38

Vorheriges Thema - Nächstes Thema

Ralf9

Hallo,

ich möchte mit dem Arduino Nano und der HM485-Lib ein Homematic Wired kompatibles Modul zusammenbauen.
Die Anbindung an das HM-wired Modul (00_HM485_LAN.pm) von fhem möchte ich über Ethernet realisieren.

Als Ethernet Modul habe ich an das "Mini W5100 LAN Ethernet Shield Network Modul" gedacht.
http://www.ebay.de/itm/New-Mini-W5100-LAN-Ethernet-Shield-Network-Module-board-Fur-Arduino-DE-TE230-/261950470314?pt=LH_DefaultDomain_77&hash=item3cfd76f8aa

Kann ich diese Ethernet library auch für das obrige Modul verwenden?
https://www.arduino.cc/en/reference/ethernet

Bei dieser Ethernet library habe ich unter "Server class" das folgende Beispiel gefunden:

#include <Ethernet.h>
#include <SPI.h>

// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
//the IP address for the shield:
byte ip[] = { 10, 0, 0, 177 };   
// the router's gateway address:
byte gateway[] = { 10, 0, 0, 1 };
// the subnet:
byte subnet[] = { 255, 255, 0, 0 };


// telnet defaults to port 23
EthernetServer server = EthernetServer(23);

void setup()
{
  // initialize the ethernet device
  Ethernet.begin(mac, ip, gateway, subnet);

  // start listening for clients
  server.begin();
}

void loop()
{
  // if an incoming client connects, there will be bytes available to read:
  EthernetClient client = server.available();
  if (client) {
    // read bytes from the incoming client and write them back
    // to any clients connected to the server:
    server.write(client.read());
  }
}


Hier wird ganz unten "client.read()" verwendet obwohl es unter der "Server class" kein read gibt.
Dies verstehe ich nicht.

Danke und Gruß Ralf
FHEM auf Cubietruck mit Igor-Image, SSD und  hmland + HM-CFG-USB-2,  HMUARTLGW Lan,   HM-LC-Bl1PBU-FM, HM-CC-RT-DN, HM-SEC-SC-2, HM-MOD-Re-8, HM-MOD-Em-8
HM-Wired:  HMW_IO_12_FM, HMW_Sen_SC_12_DR, Selbstbau IO-Module HBW_IO_SW
Maple-SIGNALduino, WH3080,  Hideki, Id 7