cancel
Showing results for 
Search instead for 
Did you mean: 

no data on udp

patrick2399
Associate
Posted on October 08, 2015 at 12:08

Hello,

i have a device, thats streaming data on udp Port 23. I want to read this data with a SPWF01S.

The device creates a Network with no encryption in adhoc-mode (channel 11)

I used the following to get a connection:

  • AT+S.SCFG=wifi_mode,0
  • AT+S.SCFG=wifi_priv_mode,0
  • AT+S.SSIDTXT=test
  • AT+S.SCFG=wifi_mode,2
  • AT+S.SCFG=ip_ipaddr,192.168.0.111
  • AT+S.SCFG=ip_gw,192.168.0.1
  • AT+S.SCFG=ip_dns,192.168.0.1
  • AT+S.SCFG=ip_netmask,255.255.255.0
  • AT+S.SCFG=ip_use_dhcp,0
  • AT+S.SCFG=wifi_channelnum,11
  • AT&W
  • AT+CFUN=1
(i also tried it without the manuell ip-settings)

on a browser on a pc i can reach the website of the SPWF01S if i type in the ip-adress,

so there is a connection.

Now i open a socket like this:

  • AT+S.SOCKON=192.168.0.74,23,u,ind
but if i use  AT+S.SOCKQ=00 to see if there are any data, it is always empty (but the device is sending some, i see them on the pc)

I also tried AT+S.SOCKD=23, with the same result.

What am i doing wrong?

Kind Regards

Patrick

#udp
3 REPLIES 3
Posted on October 08, 2015 at 16:29

Hi Patrick,

a couple of questions:

1 - where is the socket server? if socket server is into the device, module should open a socket client (SOCKON=ip,port,u); if device is a socket client, module should open a socket server (SOCKD=23,u)

2 - if you open a socket client using '',ind'' parameter, then SOCKQ is useless. When some bytes are received, and indicator (+WIND:55) is automatically provided. simply call SOCKR to read received data.

3 - are you able to ping module from the device, and the device from the module?

Regards

jerry

patrick2399
Associate
Posted on October 19, 2015 at 14:10

Hello Jerry,

im sorry im writing this late. Thank You for your reply, everything works fine.

Regard

Patrick

emerson
Associate
Posted on December 14, 2015 at 15:19

Hi.

I am trying to listen udp broadcast packets from server but no data received.

My st module is station configured and its possible to ping in both direction.  

Server Wireshark frame :

 IP Source       IP Destination       Protocol

192.168.33.2   192.168.33.255     UDP   60   Sourceport: 44219  Destination port: 4999

 

Data packet: 00544f54485356523132

c0a821020fa1

My question is, how configure the module to listen this packets?

I try this ''AT+S.SOCKON=192.168.33.255,4999,u'' , but not work.

Somebody can help me please.

Regard.

Emerson.