Thank you for your reply,
the first part of your reply is exactly what we want to do.
As I understand it: The device wants to send an message. It checks with the subnet mask, wether the destination is in the same subnet. If not, like in our case, it puts the message in an "envelope" and sends the complete thing to the gateway address, the gateway will know where to find the external recipient.
And exactly that is not working. The device does not send the message to the gateway, it does nothing, sendto() returns with -1.
We are using static adresses to keep things simple and I've double-checked, that there is a valid gateway address and mask in the NVrams.
What could be the reason, that this gateway-function is not working?
Thank-you for your help