new library UIPEthernet: uIP adapted to Arduino for ENC28J60

So, to answer myself -

I redid the code with the Ethercard library and now it's working smoothly, no dropped UDP packages so far.

I was worried that it might have been the ENC28J60 or the cheap fake 4 euro "arduino pro mini" I'd gotted over ebay that was causing the dropouts, but no! So now I'm really happy that I have a fully working 7 euro ethernet arduino :smiley:

Here's the code in case anyone else is in the same situation:
(but beware, its using the Ethercard lib)

// Modified from the Ethercard udpServer example
// This code takes simple strings like SR145 where SR1 means "servo 1" and 45 is the value
// I use pin 10 for CS from the ENC28J60. Pin 8 is default in the Ethercard library. This has to be defined in ether.begin


#include <EtherCard.h>
#include <IPAddress.h>
#include <Servo.h>        // Servo library

// ethernet interface ip address
static byte myip[] = { 172,16,3,10 };
// gateway ip address
static byte gwip[] = { 172,16,3,17 };


// ethernet mac address - must be unique on your network
static byte mymac[] = { 0x70,0x69,0x69,0x2D,0x30,0x05 };

byte Ethernet::buffer[500]; // tcp/ip send and receive buffer

// Servo init
Servo Servo1;  // Servo 1 on pin 7
Servo Servo2;  // Servo 2 on Pin 6  



//callback that prints received packets to the serial port
void udpSerialPrint(word port, byte ip[4], const char *data, word len) {
  
  char command[4];      // commandstring
  unsigned int vnumber; // the value as integer
  
  //IPAddress src(ip[0], ip[1], ip[2], ip[3]);
  //Serial.println(src);
  //Serial.println(port);
  //Serial.println(data);
  //Serial.println(len);
  
  if (len > 0) {
    
        //Serial.print("received: ");
        Serial.println(data); // print all received data
        
          // store SR1 in command
          command[0]=data[0];
          command[1]=data[1];
          command[2]=data[2];
          command[3]='\0';
          
          // store value here
          vnumber = atoi(&data[3]); // convert to integer
    
        //Serial.print("command: ");
        //Serial.println(command);
        //Serial.print("value: ");
        //Serial.println(vnumber);
    
    // write to the servos
    if (String(command) == "SR1")
    {
      Servo1.write(vnumber);
      Serial.println("servo 1 go!");
    }

    if (String(command) == "SR2")
    {
      Servo2.write(vnumber);
    }

  }
}

void setup(){
  Serial.begin(9600);
  Serial.println("\n[backSoon]");

  if (ether.begin(sizeof Ethernet::buffer, mymac, 10) == 0) // the 10 because I use pin 10 for CS, not 8 as is default in Ethercard
    {Serial.println( "Failed to access Ethernet controller"); };

  Serial.println("ether begin ok");

  ether.staticSetup(myip, gwip);

  Serial.println("static ip set");
  //ether.printIp("IP:  ", ether.myip);
  //ether.printIp("GW:  ", ether.gwip);
  //ether.printIp("DNS: ", ether.dnsip);

  //register udpSerialPrint() to port 8888
  ether.udpServerListenOnPort(&udpSerialPrint, 8888);
  
  Servo1.attach(7);  // Servo 1 on pin 7
  Servo2.attach(6);  // Servo 2 on Pin 6
  Serial.println("setup ok");
}

void loop(){
  //this must be called for ethercard functions to work.
  ether.packetLoop(ether.packetReceive());
}