This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi there,
On my custom CC3120 board, instead of using the SDK provided by TI, I try to redesign a small library for communicate with CC3120. My purpose is to keep thing simple so that I can reuse the code for smaller MCU.
So far, the MCU can get INIT-COMPOETE message from CC3120. After that, it can get the acquired IP and also the leased IP when a STA is added (CC3120 is AP role). All these are RX only. To test TX, I try to send a command to get device version. It works as shown in the following log.
NWP::init() UART::open(UART2) 115200 8-N-1 CC3X20::onRxMsg() AP role NetApp::onRxMsg() IP acquired=10.123.45.1, Gateway=10.123.45.1 CC3X20::getVersion() CC3120 Chip: 0x31000000 CC3120 FW: 2.0.0.0 CC3120 PHY: 2.2.0.7 CC3120 NWP: 3.16.0.1 CC3120 ROM: 0 WLAN::onRxMsg() STA added, BSSID=fa:ca:00:00:00:00 NetApp::onRxMsg() IP leased=10.123.45.2
I can send the command to get version multiple times and they all return the same results. That means the host program is okay to deal with sending command and receiving response.
Now, I want to try HTTP POST/GET... because my first project needs to use RESTful APIs. According to the programmer guide, CC3120 should send the GET/POST request to MCU if it doesn't know how to handle the requests. For example, if I enter "10.123.45.1/myapi/test?x=5" in the browser, then the MCU should get a GET notification. But when I set a breakpoint at the interrupt handler, there is nothing. There is also no data at UART.RX.
So, my question is: do I need to send any particular command from MCU to CC310 so that CC3120 will send the POST/GET requests to MCU?
Hi Robert,
Are you using the NWP HTTP Server or a HTTP Client implementation on the apps processor?
BR,
Vince
Hi Vince,
I need the NWP HTTP server to handle some pages stored on serial flash. But I also need some URLs to be processed by the apps processor. For example, if users enter "10.123.45.1/index.html" in browser, I would like the page to be handled by NWP HTTP server. But when users enter "10.123.45.1/api/motor/move?x=5&y=10", I would like the NWP to forward the request to apps processor so that apps processor can active motor to move to location (5,10).
I think I found the bug which caused the situation. I have fixed the bug and now I can get
SL_OPCODE_NETAPP_REQUEST notification from CC3120.
Btw, I want to add a comment here. If the host had never send any command to CC3120 then CC3120 won't forward SL_OPCODE_NETAPP_REQUEST to host. In my case, I have to send at least a command to get device version after INIT-COMPLETE is received.
I want to check if any example in SDK has the same issue. So, I search all the example codes but find they all have the command to get device version. That means all the examples in SDK won't encounter the issue.
If you are cooking your own lightweight host driver, this comment should be helpful.