Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AT CMD In AP mode can not send UDP packets #10

Open
webrtcccccc opened this issue Mar 10, 2023 · 3 comments
Open

AT CMD In AP mode can not send UDP packets #10

webrtcccccc opened this issue Mar 10, 2023 · 3 comments

Comments

@webrtcccccc
Copy link

Dear newracom sir,

I use the AT CMD to enter the AP mode, but in AP mode it cannot be used to send UDP packets, the AT CMD is as follows.

AT
SEND: AT
RECV: OK

AT+WCOUNTRY="US"
SEND: AT+WCOUNTRY="US"
RECV: OK

AT+WSOFTAP=906,"MyWiFi","wpa2-psk","MyPassword"
SEND: AT+WSOFTAP=906,"MyWiFi","wpa2-psk","MyPassword"
RECV: OK

AT+WIPADDR="192.168.0.215","255.255.0.0","192.168.0.2"
SEND: AT+WIPADDR="192.168.0.215","255.255.0.0","192.168.0.1"
RECV: OK

AT+SOPEN="UDP",1000
SEND: AT+SOPEN="UDP",1000
RECV: +SOPEN:0
RECV: OK

AT+SSEND=0,"192.168.0.215",1000,10
SEND: AT+SSEND=0,"192.168.0.215",1000,10
RECV: OK

1234567890
SEND: DATA 0 10

RECV: +SEVENT:"SEND_IDLE",0,0

=========================================
But in STA mode, it can send UDP packets normally.

AT+WCOUNTRY="US"
SEND: AT+WCOUNTRY="US"
RECV: OK

AT+WSCAN
SEND: AT+WSCAN
RECV: +WSCAN:"2c:3b:70:00:00:12",915.0,-10,"[WPA2-PSK-CCMP][ESS]","MyWiFi"
RECV: OK

AT+WCONN="MyWiFi","wpa2","MyPassword"
SEND: AT+WCONN="MyWiFi","wpa2","MyPassword"
RECV: OK

AT+WIPADDR="192.168.0.215","255.255.0.0","192.168.0.1"
SEND: AT+WIPADDR="192.168.0.215","255.255.0.0","192.168.0.1"
RECV: OK

AT+SOPEN="UDP",1000
SEND: AT+SOPEN="UDP",1000
RECV: +SOPEN:0
RECV: OK

AT+SSEND=0,"192.168.0.215",1000,10
SEND: AT+SSEND=0,"192.168.0.215",1000,10
RECV: OK

0123456789
SEND: DATA 0 10

RECV: +RXD:0,10

@joej357
Copy link

joej357 commented Mar 21, 2023

webrtcccccc, are you using the AT-CMD Test Tool or pushing commands manually?

I am able to replicate a similar issue when using the Test Tool.

Steps:

  1. Start SoftAP and DHCPS
  2. Connect client to network and assign IP via DHCP

Resulting in -
(SoftAP) Send: AT+WIPADDR?
RECV: +WIPADDR: "192.168.50.1","255.255.255.0","192.168.50.1"

(Client) Send: AT+WIPADDR?
RECV: +WIPADDR: "192.168.50.2","255.255.255.0","192.168.50.1"

  1. Open UDP socket on each side both with local port 1000
  2. Attempt AT+SSEND (Continuous random data transfer) from SoftAP to Client with Socket ID 1, UDP, Repote IP = 192.168.50.2, Remote Port = 1000, Size = 256, Time = 10, Random Alphanumeric.

But, when I start the send, the Serial Monitor shows:
AT+SSEND=1,"192.168.200.1",8888,256

Which is not the correct Remote IP or Remote Port, and this incorrect IP and Port propagate through each attempted 256 Byte Transmission, resulting in the same SEND_IDLE. However, if I:

  1. Use the AT+SSEND Command with the word "HELLO" it properly shows:
    "HELLOAT+SSEND=1,"192.168.50.2",1000,5"
    and is received by the client.

After successfully sending the "HELLO" I can then use the AT+SSEND (Continuous random data transfer) without issue from both Client and SoftAP sides.

Overall, I have manage to send and receive UDP packets on a two-way Client/SoftAP connection, but it seems to be a bit finicky. And my issue seems to stem from using the AT+SSEND (Continuous random data transfer) tool within the AT-CMD Test Tool v1.3.0 so we may be experiencing separate problems.

@webrtcccccc
Copy link
Author

Thanks for the reply. I use the raspberry raspi-atcmd-cli app to test AT CMD.
https://github.com/newracom/nrc7292_sdk/tree/master/package/standalone/sdk/apps/atcmd/host/raspi-atcmd-cli

@webrtcccccc
Copy link
Author

My Scenario is below AT CMD:

--AP Side
AT
SEND: AT
RECV: OK

AT+WCOUNTRY="US"
SEND: AT+WCOUNTRY="US"
RECV: OK

AT+WSOFTAP=906,"MyWiFi","wpa2-psk","MyPassword"
SEND: AT+WSOFTAP=906,"MyWiFi","wpa2-psk","MyPassword"
RECV: OK

AT+WIPADDR="192.168.1.1","255.255.255.0","192.168.1.1"
SEND: AT+WIPADDR="192.168.1.1","255.255.255.0","192.168.1.1"
RECV: OK

AT+SOPEN="UDP",1000
SEND: AT+SOPEN="UDP",1000
RECV: +SOPEN:0
RECV: OK

AT+SSEND=0,"192.168.1.2",1000,10
SEND: AT+SSEND=0,"192.168.1.2",1000,10
RECV: OK

0123456789
SEND: DATA 0 10

RECV: +SEVENT:"SEND_IDLE",0,0
(Can not send to STA)

--STA side
AT+WCOUNTRY="US"
AT+WSCAN
AT+WCONN="MyWiFi","wpa2","MyPassword"
AT+WIPADDR="192.168.1.2","255.255.255.0","192.168.1.1"
AT+SOPEN="UDP",1000

(Can not receive from AP)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants