mongoose-os-libs / rpc-service-wifi

Other
2 stars 1 forks source link

Browser not getting any response from Wifi.SetupSTA #7

Open fabiohmantelli opened 3 years ago

fabiohmantelli commented 3 years ago

I was trying to make and embedded webpage server to connect to receive the local WiFi network credentials and connect to it. I was able to use Config.Set to achieve this with no problems. However, for security reasons, I would not like to allow Config.Set RPC calls through ws, so I was looking for an alternative and bumped in the Wifi RPC library implemented, but not properly documented, in this library. The problem is that I was no able to do so. The browser was not able to receive the responses sent by the Wifi.SetupAP and Wifi.SetupSTA calls, and any other responses of any functions after I called Wifi.SetupSTA. The browser logs accused a timeout while waiting for the response, but the device logs showed the frames being queued and sent. I have no problem to setup wifi using the Config.Set or using the RPC.List method, so I think this is something library-specific.

I ended up adding a new RPC handler that uses the api_config.js function, which worked fine, but it still looks like there is an issue with this library.

Device log logg.txt

Browser log 192.168.4.1-1610978916690.log