AmirV
If the device is ping-able, that would suggest it is located outside of the subnet, or that multiple interfaces are active (like both WIFI and ETH on the RPI).
Have you read the docs for troubleshoot? I'd recommend manually specifying the IP of the device in the constructor.
Thanks,
Jaka