Good day to all! I know it's been discussed many times, but I used a search and did not find anything similar to my situation. I need to send and receive a byte array by the UDP packet. For this I use simple program:
UIPEthernet library https://github.com/UIPEthernet/UIPEthernet
Compiles without any errors, but I do not receive or send data. When I looked at traffic using Wireshark I saw only ARP requests from ethernet module with reversed IP addresses but normal mac. E.g. he is trying to send to 168.192.200.111 from 168.192.100.111. If I manually reverse sndIP in code like uint8_t sndIP[] = { 168, 192, 200, 111}; I can receive UDP packet from teensy. But if I reverse myIP in Wireshark it becomes as 192.168.1.100 but even on this IP ethernet module do not reply to ping or receive any data.
I used different ethernet module, different UIPEthernet library, different ArduinoIDE and Teensyduino versions, different OS and PC, all the same. Examples from library also working with the same effect. But a month or two ago everything worked fine. The same library, the same code or any other examples.
Has anyone encountered such behavior or can give any advice? Thanks!
Code:
#include <UIPEthernet.h>
#include <SPI.h>
uint8_t myIP[] = { 192, 168, 111, 100 };
uint8_t sndIP[] = { 192, 168, 111, 200 };
uint8_t myMAC[] = { 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };
uint16_t rcvPort = 27000;
uint16_t sndPort = 27000;
byte sndBuffer[256];
byte rcvBuffer[256];
EthernetUDP udp;
void setup()
{
Serial.begin(115200);
Ethernet.begin(myMAC, IPAddress(myIP));
udp.begin(rcvPort);
for(int i=0; i<sizeof(sndBuffer); i++)
{
sndBuffer[i] = i; // just to see something in Wireshark;
}
}
void loop()
{
udp.beginPacket(IPAddress(sndIP), sndPort);
udp.write((byte *)sndBuffer, sizeof(sndBuffer));
udp.endPacket();
Serial.println("Packet Sent");
int packetSize = udp.parsePacket();
if(packetSize > 0)
Serial.println("Something Received");
}
UIPEthernet library https://github.com/UIPEthernet/UIPEthernet
Compiles without any errors, but I do not receive or send data. When I looked at traffic using Wireshark I saw only ARP requests from ethernet module with reversed IP addresses but normal mac. E.g. he is trying to send to 168.192.200.111 from 168.192.100.111. If I manually reverse sndIP in code like uint8_t sndIP[] = { 168, 192, 200, 111}; I can receive UDP packet from teensy. But if I reverse myIP in Wireshark it becomes as 192.168.1.100 but even on this IP ethernet module do not reply to ping or receive any data.
I used different ethernet module, different UIPEthernet library, different ArduinoIDE and Teensyduino versions, different OS and PC, all the same. Examples from library also working with the same effect. But a month or two ago everything worked fine. The same library, the same code or any other examples.
Has anyone encountered such behavior or can give any advice? Thanks!