EspressifApp / EsptouchForIOS

EspTouch is one way for iPhone to tell the connected Router's Ssid, Password and etc. to make IOT devices to connect to the same Router. EspTouch is developed and maintained by Espressif Corp.
Other
410 stars 166 forks source link

stuck on sending gc code #28

Open fburel opened 6 years ago

fburel commented 6 years ago

Hello,

I've try running this code on different iOS devices

Each time I try, iOS send the GC packet, but never receive any answer back. So it keeps sending packet until timeout. Note that it works perfectly on android.

At first I thought it came from the tryOpenNetworkPermission that used to fail due to NSURLErrorDomain Code 1202, but I replaced https://8.8.8.8 by https://www.apple.com. That fixed the NSURLError, but I still cannot perform SmartConfig.

Here are the log : 2018-10-15 10:26:28.196824+0200 EspTouchDemo[1843:1298898] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2018-10-15 10:26:28.198957+0200 EspTouchDemo[1843:1298898] [MC] Reading from public effective user settings. 2018-10-15 10:26:37.376372+0200 EspTouchDemo[1843:1298898] ESPViewController do confirm action... 2018-10-15 10:26:37.377263+0200 EspTouchDemo[1843:1298942] ESPViewController do the execute work... 2018-10-15 10:26:37.377931+0200 EspTouchDemo[1843:1298942] Welcome Esptouch v0.3.7.0 2018-10-15 10:26:37.378046+0200 EspTouchDemo[1843:1298942] ESPTouchTask init 2018-10-15 10:26:37.386114+0200 EspTouchDemo[1843:1298942] ##########################client init() _sck_fd4=9 2018-10-15 10:26:37.386502+0200 EspTouchDemo[1843:1298942] ##########################client init() _sck_fd6=10 2018-10-15 10:26:37.386910+0200 EspTouchDemo[1843:1298942] ##########################server init(): _sck_fd4=11 2018-10-15 10:26:37.388276+0200 EspTouchDemo[1843:1298942] ##########################server init(): _sck_fd6=12 2018-10-15 10:26:37.388540+0200 EspTouchDemo[1843:1298942] ESPTouchTask app server port is 18266 2018-10-15 10:26:37.388840+0200 EspTouchDemo[1843:1298942] ESPTouchTask executeForResult() localInetAddr: 192.168.15.88 2018-10-15 10:26:37.395191+0200 EspTouchDemo[1843:1298942] ESPTouchTask __execute() send gc code 2018-10-15 10:26:37.396707+0200 EspTouchDemo[1843:1299015] ESPTouchTask beginBackgroundTask() entrance 2018-10-15 10:26:37.400304+0200 EspTouchDemo[1843:1299015] ESPTouchTask __listenAsyn() start an asyn listen task, current thread is: <NSThread: 0x106d33710>{number = 5, name = (null)} 2018-10-15 10:26:37.400468+0200 EspTouchDemo[1843:1299015] ESPTouchTask __listenAsyn() expectOneByte: 35 2018-10-15 10:26:43.425974+0200 EspTouchDemo[1843:1298942] ESPTouchTask __execute() send gc code 2018-10-15 10:26:49.436464+0200 EspTouchDemo[1843:1298942] ESPTouchTask __execute() send gc code 2018-10-15 10:26:55.436540+0200 EspTouchDemo[1843:1298942] ESPTouchTask __execute() send gc code 2018-10-15 10:27:01.457864+0200 EspTouchDemo[1843:1298942] ESPTouchTask __execute() send gc code 2018-10-15 10:27:07.479764+0200 EspTouchDemo[1843:1298942] ESPTouchTask __execute() send gc code 2018-10-15 10:27:13.502603+0200 EspTouchDemo[1843:1298942] ESPTouchTask __execute() send gc code 2018-10-15 10:27:19.511518+0200 EspTouchDemo[1843:1298942] ESPTouchTask __execute() send gc code 2018-10-15 10:27:22.417219+0200 EspTouchDemo[1843:1298942] ESPTouchTask __sleep() start server: receiveOneByte4 fail : Resource temporarily unavailable 2018-10-15 10:27:37.402694+0200 EspTouchDemo[1843:1299015] ESPTouchTask __listenAsyn() receive rubbish message, just ignore 2018-10-15 10:27:37.420947+0200 EspTouchDemo[1843:1298942] ESPTouchTask __sleep() end, receive signal is NO 2018-10-15 10:27:37.421280+0200 EspTouchDemo[1843:1298942] ###################server close() fd4=11 server: receiveOneByte4 fail : Bad file descriptor 2018-10-15 10:27:37.421645+0200 EspTouchDemo[1843:1299015] ESPTouchTask __listenAsyn() receive rubbish message, just ignore 2018-10-15 10:27:37.421919+0200 EspTouchDemo[1843:1298942] ###################server close() fd6=12 2018-10-15 10:27:37.422080+0200 EspTouchDemo[1843:1298942] ESPTouchTask __notify() 2018-10-15 10:27:37.422935+0200 EspTouchDemo[1843:1298942] ESPViewController executeForResult() result is: ( "[isSuc: NO,isCancelled: NO,bssid: (null),inetAddress: (null)]" ) 2018-10-15 10:27:37.439471+0200 EspTouchDemo[1843:1299015] ESPTouchTask __notify() 2018-10-15 10:27:37.439619+0200 EspTouchDemo[1843:1299015] ESPTouchTask __listenAsyn() finish 2018-10-15 10:27:37.439699+0200 EspTouchDemo[1843:1299015] ESPTouchTask endBackgroundTask() entrance

XuXiangJun commented 6 years ago

If smartconfig failed with broadcast, you can try multicast.

macaronpark commented 5 years ago

I had same issue and error and it turns out it's my USBhub that what problem was. When I connected the module cable to USBhub, I couldn't get any result but only time-out. As soon as I connected it to Mac, the problem solved, even though NSURLError is still there.

dilip907 commented 5 years ago

Hi I am facing issue here is the response. [isSuc: NO,isCancelled: NO,bssid: (null),inetAddress: (null)] getting this one can please any one suggest me what I am doing wrong.