How has an understandable description of the ethercard library?
I tried www.aelius.com, but is completely not understandable for a beginner. Most of the examples are far away from practical requirements.
I am planning the follwing application:
A simple webpage which configures a hardware circuit with an ardnuino nano. I use the ethernet shield ENC28J60 wth the library ethercard. I like to enter integer values on a browser which must be read by the arduino.
How knows a very simple code, not a science dissertation.
Tom09:
I tried www.aelius.com, but is completely not understandable for a beginner. Most of the examples are far away from practical requirements.
It's not clear to me whether you're talking about some examples on that website or not. If you haven't already, take a look at the example sketches that come with the EtherCard library. You'll find them in the Arduino IDE under File > Examples > EtherCard after you install the library.
Hallo,
ich sende über die Ethercard Library UDP-Daten an einen LINUX-Server. Die Daten werden auf dem Server auch korrekt empfangen. Der Server sendet bei jedem empfangenen Telegramm ein Rücktelegramm.
Leider habe ich bisher weder ein funktionsfähiges Beispiel gefunden, mit welchen Befehlen man empfangene UDP-Programme von einem Webserver auslesen kann, noch eine aussagefähige Dokumenation von der Ethercard Library.
Falls jemand bereits ein derartiges Programm schon einmal geschrieben hat, dass auch wirklich funktioniert, würde ich mich über eine Rückmeldung freuen. Nach diversen Recherchen habe ich gesehen, dass dies anscheinend mit "ether.packetLoop(ether.packetReceive())" funktionieren soll.
Setze Deinen Code bitte direkt ins Forum. Benutze dazu Codetags (</>-Button oben links im Forumseditor oder [code] davor und [/code] dahinter ohne *). So ist er auch auf portablen Geräten lesbar.
Das kannst Du auch noch nachträglich ändern.
Warum benutzt Du nicht die EthernetUdp?
Dort ist für Dich intertessant (ungetestet):
char packetBuffer[UDP_TX_PACKET_MAX_SIZE];
// im Setup
EthernetUDP.begin(localPort);
// im loop
int packetSize = Udp.parsePacket();
if(packetSize)
{
Udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE);
}
Danke für die Hinweise,
leider bekomme ich bereits beim kompilieren der beiden Code-Beispiele zahlreiche Fehlermeldungen, wie
"die Klasse UDP wurde in Ethernet UDP umbenannt" oder dass irgenwelche Libraries fehlen.
Falls jemand einen vollständigen und wichtig f u n k t i o n i e r e n d e n Code hat, den man per Cut und Paste nutzen kann würde ich mich über ein Feedback freuen. Ich muss nur kurze UDP-Strings an einen Server mit einer festen IP-Adresse senden und der Server gibt mir ab und zu Steuermeldungen in Form von UDP-Strings.
Für eine derartige Anwendung hatte ich einen Raspery PI im Einsatz, wobei hierfür eine Socket-Verbindung entwickelt wurde, die sowohl auf dem Server als auch auf dem Rasperry lief. Der Raspery PI ist aber für diese Anwendung überdimensioniert. Ich hatte daher die Hoffnung diese Übertragung mit einem Microcontroller vom Typ ATMEL unter Verwendung eines Ethernet-Chips zu realisieren.
Warum muss das mit der Ethercard lib sein? Das ENC28J60 Modul habe ich wegen Unzuverlässigkeit pensioniert und gegen ein W5100 der gleichen Größe ersetzt.
Schau dir mal die EthernetUIP Lib an. Die ist befehlskompatibel mit der Standard Lib. Das verbessert die Probleme mit der Hardware etwas, aber nicht ganz.
@Tom09 I've merged your cross posts. Yes, this makes a huge mess of the thread in two languages, but that's what you get for cross posting.
Cross posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes writing a detailed answer on this thread, without knowing that someone else already did the same in the other thread.
Repeated cross posting will result in a suspension from the forum.
In the future, please take some time to pick the forum section that best suits the topic of your question and then only post once to that forum section. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum section. It contains a lot of other useful information. Please read it.