i am trying to communicate with FPGA board, on which basic UDP protocol was implemented. i use windows 7 PC, python 2.7.6 32 bit.
my computer is connected to LAN network. automatically receives this IP (from ipconfig): IP 192.168.2.1, Subnet mask: 255.255.255.0
my board is connected to to my computer with a switch. IP of the board is fixed (in hardware code) - 192.168.4.10.
if i understand currectly - my computer and my board are on different subnets, because 2 of the 4 right ip sub-numbers are different.
when i send UDP packet - card does not receive it. when i manually force my computer to be the same ip (192.168.2.1) but 255.255.0.0 subnet mask, it does receive.
python code i use for sending is something like this:
import socket
UDP_IP = "192.168.4.10"
RECEIVE_PORT = 5005
SEND_PORT = 5005
MESSAGE = "Hello, World!"
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock .bind(('', SEND_PORT))
sock.sendto(MESSAGE, (UDP_IP, RECEIVE_PORT))
what could be the reason? is there any way i can fix this in code? is there any way i can change my subnet mask in code? what should i read to understand my problem?