Flexy 205 fail to send data by TCP/UDP

Hi, I am trying to send some data through UDP socket using ewon basic IDE, but I am unable to send anything because runtime fails every time on line with “PUT” with error “operation failed”. I have tried different IP adressed, different ports, both UDP and TCP, with connection to the internet and without. I have no other issues with connections or anything else. My device is Flexy 205 and it is using 14.4s1 firmware. I have tried to do the same with file, which worked. I tried as well example from ewon basic documentation, which is very similiar to my code, with same error. Could you please help me solve this issue or get more informations about this error. I have no idea where the problem could be.

Code:
OPEN “udp:192.168.0.123:3333” FOR BINARY OUTPUT AS 1
PUT 1, “ABCDEFGH”
CLOSE 1

Error:
Operation failed (28) 12: PUT 1, “ABCDEFGH”

To clear things out, I tried to save the value into file, not send any file. I run basically the same code but inside open command was path to file - and that worked.

Hi Martin!

If you used the Open Command before for File stuff it is possible 1 is still Open and used for that.
You could try to Close “1” before opening it for UDP communication.
CLOSE 1

It might also take a little bit of time to Open the socet before you can ‘put’ something.
For this you can use the code here:

https://developer.ewon.biz/content/develop-your-own-client-protocol-based-tcp-or-udp
There is a loop to “WaitConnect” before the PUT is tried.

Hope this helps!

br
Franziska

Waiting for opening socket (your sample code) worked. Consider inserting simpler version of this code into documentation. Thank you for your help!