Hello, I try to create a communication between my pc and an UC5550 by wifi and udp. I have read this example: Network samples? for setup the wifi. my UC5550 is corectly connected to my network but when I try to open a socket that generate an exception :
#### Exception System.Exception - 0x00000000 (1) ####
#### Message: Request failed
#### GHIElectronics.TinyCLR.Networking.SPWF04Sx.SPWF04SxInterface::OpenSocket [IP: 0083] ####
#### TestApli.Program::Main [IP: 00a5] ####
Exception levée : 'System.Exception' dans GHIElectronics.TinyCLR.Networking.SPWF04Sx.dll
Une exception non gérée du type 'System.Exception' s'est produite dans
GHIElectronics.TinyCLR.Networking.SPWF04Sx.dll
Informations supplémentaires : Request failed
my code:
I don’t know if I use correctly the method OpenSocket.
var id = wifi.OpenSocket("192.168.43.3", 52592, SPWF04SxConnectionyType.Udp, SPWF04SxConnectionSecurityType.None);'
I know in the DNMF there were events to notify the app layer when the network/wifi was ready, and when it was connected/disconnected. Not sure about TinyCLR
The spwf04 keep in memory the wifi settings so we can use only one JoinNetwork(“ssid”, “password”). I see the connection is OK on the console and I see too my UC5550 is a connected device on my wifi.
Try using the address “192.168.43.255”. This is the broadcast UDP address, and should work. If that works, you can try the address of what ever device you’re trying to send data to (if you don’t want the data broadcast to everyone on the network).
Is it the address of the SPWF04Sx, or a pc or something else on the network?
Your code looks correct. We do have another release coming soon that you may want to try. In the mean time, you can always add the code for the SPWF04SA to your project from our GitHub and step through the OpenSocket call to see what result you get back from the device. You may need to update a few bits of the code to use the current preview 1 release if you don’t want for preview 2.