server and client - AT commands

weeyoung
Posts: 1
Joined: Wed Nov 29, 2017 5:12 pm

server and client - AT commands

Postby weeyoung » Wed Nov 29, 2017 5:24 pm

Hi guys,

I'm working on an IOT device (using atmega1824p) and wanted to use AT commands.
It works as a client.. However, I also wanted it to use as a server (e.g. when I need to create/update ssid and password). I'm using ISR to get back replies.

Below is the flow:
1. initwifi -> 2. setCWMode=3 -> 3. APJoin with SSID and password (set CWDHCP=1,1) -> 4. setMux=1 -> 5. set softAP-> 6. create server (AT+CIPSERVER) -> 7. set IP (e.g. 192.168.4.1)

Is the flow right? If I want to check if there is a Ap is already joined (so i dont need to APJoin each time), after i set CWHDCP at 3., i do a query for getIP (AT+CIFSSR)?

For replies, i'm using interrupt (ISR). when I know im at the access point, I check ISR for '+IPD:connect_id,data', do a CIPSEND to connect_id for webpage? Is there a proper process.

I had the above working. but sometimes, i fail at set IP, anyone have anyidea? once i fail setting IP, i can't seem to receive ISR as a webserver (I do check for sei())

Any help is appreciated.

Her Majesty
Posts: 231
Joined: Mon Oct 27, 2014 11:09 am

Re: server and client - AT commands

Postby Her Majesty » Mon Dec 11, 2017 5:56 pm

Maybe you can try to move step 7. set IP to be between step 3 and step 4.
I think you should set IP first, then start a server.

Who is online

Users browsing this forum: No registered users and 4 guests