Other Parts Discussed in Thread: CC3200, CC3100
HI all, I have a Launchpad LAUNCH-CC3220MODASF loaded with the FreeRTOS/CCS Provisioning example. I am using sp_3.9.0.6_2.0.0.0_2.2.0.6
When I start the launchpad, i get this on the terminal:
==================================
Provisioning Example Ver. 01.00.00.14
==================================
CHIP 0x31000019
MAC 31.2.0.0.0
PHY 2.2.0.6
NWP 3.9.0.6
ROM 0
HOST 3.0.1.41
MAC address: 50:f1:4a:61:48:e8
Starting Provisioning! mode=2 (0-AP, 1-SC, 2-AP+SC, 3-AP+SC+EXT)
so far, so good. I open a browser on my android tablet (Android 7.1.1) and browse to 10.123.45.1/index.html
I go to the "Profiles" tab, and enter the SSID and password for my network. I get this on the terminal:
[Provisioning] Profile Added: SSID: RND_EE
Now, in the browser, I tap the "confirm" button. I get this on the terminal:
[Provisioning] Profile confirmation: WLAN Connected!
[Provisioning] Profile confirmation: IP Acquired!
Sweet. The device connects to the SSID, and I can connect to it at 192.168.1.100 -- so that's happy. But after a bit, the device times out and I see this on the terminal:
[Provisioning] Profile Confirmation failed (Connection Success, feedback to Smartphone app failed)
the simplelink app "sees" the device on my network, but it just opens index.html on the device. so it doesn't seem to be doing anything fancy.
According the programmer's guide, SWRU455G, Section 16.8, "Delivering Feedback to the User", page 239:
"To get the confirmation result, the smartphone app may disconnect from the configured wireless network and try to directly connect the SimpleLink device AP (possible only if AP-provisioning or AP+SC-provisioning configuration modes are used). If the smartphone app was able to connect to the SimpleLink AP, it sends an HTTP GET request to the device internal HTTP server, to retrieve the confirmation result.
So how to to send the confirmation?
I started at section 9.4.6, "Provisioning Confirmation" on 163 of SWRU55G:
Posts to /api/1/wlan/en_ap_scan/confirm_req are handled as described in Chapter 16.
but I get a 404 when I try to post to that url. Looking at he index.html page's "confirm" button tries to send a GET to http://10.123.45.1/api/1/wlan/confirm_req
(by the way, my browser is telling me that it can't find user.js (gets a 404) -- perhaps this is a problem?)
I tried this from the command line (using httpie):
$ http -v GET 192.168.1.100/api/1/wlan/confirm_req
but I get a 404:
GET /api/1/wlan/confirm_req HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: 192.168.1.100
User-Agent: HTTPie/1.0.2
HTTP/1.0 404 Not Found
on the other hand, in SWRU472, section 7.2 "Android AP Provisioning Mode", page 18, I find the following:
After finding the IP address of the new device, the getCGFResultFromDevice API should be activated to fetch the result and indicate that provisioning is done.
ok, so in the android source code of the android app, i navigate to getCGFResultFromDevice:
I see this line (line 1083 in NetworkUtil.java):
url += "/__SL_G_MCR";
and a little below on line 1108:
HttpGet cfgResult = new HttpGet(url);
so, it appears it's attempting to do a GET 10.123.45.1/__SL_G_MCR
I don't think this is what I'm looking for, because in table 9-19, section 9.5.8, page 170 of SWRU455G, I find this description of the __SL_G_MCR token:
Returns a number code of the provisioning status
But wait, section 2.2.4, "Step 4: Connecting to the DEvice and Getting Feedback" on page 5 of SWRU472 has the following:
The final step is to check if the device completed provisioning successfully. This is done by sending a query from the mobile app to the device, asking for the provisioning results.
aaah, so the /api/1/wlan/en_ap_scan/confirm_req API initiates the process -- and triggers the NWP to connect to the SSID. unfortunately, that same doc (SWRU472) only has detailed instructions for the smart config process and not the AP process, so I have no idea if I'm missing a step.
any help is appreciated.