SimVimCockpit Interface Baron-58 sim Blog About/Donate

One of the first successful test to receive UDP packets from X-Plane. X-Plane UDP Data Structure analysis.(May 2012)
It receives UDP packets from X-Plane and show it in the terminal in the raw view.

X-Plane UDP Data Structure 

Test sketch that receives UDP packets from X-Plane in the raw view.
and prints to Serial terminal  data of the group #131 ("ground location") 
Check this group in the Data Input & Output Screen of the X-Plane for sending.

Packet size: 41
Xplane Data:

May 2012
Vlad S

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

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 1, 6);    // local IP - address of my Arduino 
unsigned int localPort = 49001;      // local port to listen - default X-Plane port 
byte buf = 00;   // buffer for  UDP packet (BYTE, not char)

EthernetUDP Udp; // An EthernetUDP instance to send and receive packets over UDP


void setup() 
  Ethernet.begin(mac,ip);   // start the Ethernet 
  Udp.begin(localPort);     //..and UDP:

  Serial.begin(9600);       // init serial port
void loop() {
  int packetSize = Udp.parsePacket();   //  Checks for the presence of a UDP packet, and returns its size
  if(packetSize)                        //  UDP packet was received and its size defined
    Serial.print("Packet size: ");
    Serial.println(packetSize);         // Packet Size in bytes

 // When used without parameters, it returns next char (byte in this case) :
      Serial.println("Xplane Data:");  
        for (int i =0; i < packetSize; i++)
          buf =;


© Copyright 2012-2016 - SimVim