wifi test
Dependencies: X_NUCLEO_IKS01A2 mbed-http
README.md@0:24d3eb812fd4, 2018-09-05 (annotated)
- Committer:
- JMF
- Date:
- Wed Sep 05 14:28:24 2018 +0000
- Revision:
- 0:24d3eb812fd4
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JMF | 0:24d3eb812fd4 | 1 | These files allow you to build a simple HTTP/HTTPS application that will exchange data with httpbin.org and ensure the BG96 hardware/driver is working correctly. |
JMF | 0:24d3eb812fd4 | 2 | |
JMF | 0:24d3eb812fd4 | 3 | # Note |
JMF | 0:24d3eb812fd4 | 4 | -The following firmware version was used in testing: |
JMF | 0:24d3eb812fd4 | 5 | Modem SW Revision: BG96 Rev:BG96MAR02A04M1G |
JMF | 0:24d3eb812fd4 | 6 | |
JMF | 0:24d3eb812fd4 | 7 | |
JMF | 0:24d3eb812fd4 | 8 | |
JMF | 0:24d3eb812fd4 | 9 | # Required tools |
JMF | 0:24d3eb812fd4 | 10 | 1. mbed-cli (version 1.3.0 or later) |
JMF | 0:24d3eb812fd4 | 11 | 2. latest version of GNU ARM Embedded Toolchain: **https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads** |
JMF | 0:24d3eb812fd4 | 12 | |
JMF | 0:24d3eb812fd4 | 13 | # Create Project |
JMF | 0:24d3eb812fd4 | 14 | 1. Import the BG96_Example project: **mbed import http://github.com/Avnet/BG96_Example** |
JMF | 0:24d3eb812fd4 | 15 | |
JMF | 0:24d3eb812fd4 | 16 | 2. Goto the BG96_Example folder, Then edit mbed_settings.py and add the path to your compiler using GCC_ARM_PATH |
JMF | 0:24d3eb812fd4 | 17 | |
JMF | 0:24d3eb812fd4 | 18 | # Build Application |
JMF | 0:24d3eb812fd4 | 19 | 1. Build the program by executing **'mbed compile -t GCC_ARM -m NUCLEO_L476RG'** |
JMF | 0:24d3eb812fd4 | 20 | |
JMF | 0:24d3eb812fd4 | 21 | 2. When building the tests, it is possible to enable varying amounts of debug information to be output by the |
JMF | 0:24d3eb812fd4 | 22 | Network driver. These settings are located in the 'mbed_app.json' file (the bg96_config.json file is used when |
JMF | 0:24d3eb812fd4 | 23 | building for Green Tea). To enable or disable WNC Debug output, set the 'bg96_debug' flag to 'true' (or 1) or |
JMF | 0:24d3eb812fd4 | 24 | to 'false' (or 0) to disable. |
JMF | 0:24d3eb812fd4 | 25 | |
JMF | 0:24d3eb812fd4 | 26 | The amount of debug information output is controlled by the 'bg96-debug-setting' flag in the 'mbed_app.json' file. |
JMF | 0:24d3eb812fd4 | 27 | The values for this flag enabled debug output to trace various activities (see mbed_app.json for detailed settings). |
JMF | 0:24d3eb812fd4 | 28 | |
JMF | 0:24d3eb812fd4 | 29 | 3. Verify operation of the basic application program by executing it on the target hardware. This is done by monitoring |
JMF | 0:24d3eb812fd4 | 30 | the program operation using a teminal program (ex. minicom or hyperterm), with settings of 115200-N81. Program output |
JMF | 0:24d3eb812fd4 | 31 | should resemble: |
JMF | 0:24d3eb812fd4 | 32 | |
JMF | 0:24d3eb812fd4 | 33 | ``` |
JMF | 0:24d3eb812fd4 | 34 | Test HTTP and HTTPS interface |
JMF | 0:24d3eb812fd4 | 35 | [EasyConnect] Using BG96 |
JMF | 0:24d3eb812fd4 | 36 | [EasyConnect] IPv4 mode |
JMF | 0:24d3eb812fd4 | 37 | [EasyConnect] Connected to Network successfully |
JMF | 0:24d3eb812fd4 | 38 | [EasyConnect] MAC address 37:67:61:79:08:72:30 |
JMF | 0:24d3eb812fd4 | 39 | [EasyConnect] IP address 10.192.139.159 |
JMF | 0:24d3eb812fd4 | 40 | |
JMF | 0:24d3eb812fd4 | 41 | Modem SW Revision: BG96 Rev:BG96MAR02A04M1G |
JMF | 0:24d3eb812fd4 | 42 | |
JMF | 0:24d3eb812fd4 | 43 | >>>>>>>>>>>><<<<<<<<<<<< |
JMF | 0:24d3eb812fd4 | 44 | >>> TEST HTTPClient <<< |
JMF | 0:24d3eb812fd4 | 45 | >>>>>>>>>>>><<<<<<<<<<<< |
JMF | 0:24d3eb812fd4 | 46 | |
JMF | 0:24d3eb812fd4 | 47 | Connected over TCP to developer.mbed.org |
JMF | 0:24d3eb812fd4 | 48 | |
JMF | 0:24d3eb812fd4 | 49 | >>>First, lets get a page from http://developer.mbed.org |
JMF | 0:24d3eb812fd4 | 50 | |
JMF | 0:24d3eb812fd4 | 51 | ----- RESPONSE: ----- |
JMF | 0:24d3eb812fd4 | 52 | Status: 200 - OK |
JMF | 0:24d3eb812fd4 | 53 | Headers: |
JMF | 0:24d3eb812fd4 | 54 | Server: nginx/1.11.10 |
JMF | 0:24d3eb812fd4 | 55 | Date: Wed, 28 Mar 2018 12:58:12 GMT |
JMF | 0:24d3eb812fd4 | 56 | Content-Type: text/plain |
JMF | 0:24d3eb812fd4 | 57 | Content-Length: 14 |
JMF | 0:24d3eb812fd4 | 58 | Connection: keep-alive |
JMF | 0:24d3eb812fd4 | 59 | Last-Modified: Fri, 27 Jul 2012 13:30:34 GMT |
JMF | 0:24d3eb812fd4 | 60 | Accept-Ranges: bytes |
JMF | 0:24d3eb812fd4 | 61 | Cache-Control: max-age=36000 |
JMF | 0:24d3eb812fd4 | 62 | Expires: Wed, 28 Mar 2018 22:57:52 GMT |
JMF | 0:24d3eb812fd4 | 63 | X-Upstream-L1-next-hop: 217.140.101.34:8080 |
JMF | 0:24d3eb812fd4 | 64 | X-Upstream-L1: developer-sjc-indigo-border-nginx |
JMF | 0:24d3eb812fd4 | 65 | |
JMF | 0:24d3eb812fd4 | 66 | Body (14 bytes): |
JMF | 0:24d3eb812fd4 | 67 | |
JMF | 0:24d3eb812fd4 | 68 | Hello world! |
JMF | 0:24d3eb812fd4 | 69 | |
JMF | 0:24d3eb812fd4 | 70 | Connected over TCP to httpbin.org |
JMF | 0:24d3eb812fd4 | 71 | |
JMF | 0:24d3eb812fd4 | 72 | |
JMF | 0:24d3eb812fd4 | 73 | |
JMF | 0:24d3eb812fd4 | 74 | >>>Post data... ** |
JMF | 0:24d3eb812fd4 | 75 | |
JMF | 0:24d3eb812fd4 | 76 | ----- RESPONSE: ----- |
JMF | 0:24d3eb812fd4 | 77 | Status: 200 - OK |
JMF | 0:24d3eb812fd4 | 78 | Headers: |
JMF | 0:24d3eb812fd4 | 79 | Connection: keep-alive |
JMF | 0:24d3eb812fd4 | 80 | Server: meinheld/0.6.1 |
JMF | 0:24d3eb812fd4 | 81 | Date: Wed, 28 Mar 2018 12:58:04 GMT |
JMF | 0:24d3eb812fd4 | 82 | Content-Type: application/json |
JMF | 0:24d3eb812fd4 | 83 | Access-Control-Allow-Origin: * |
JMF | 0:24d3eb812fd4 | 84 | Access-Control-Allow-Credentials: true |
JMF | 0:24d3eb812fd4 | 85 | X-Powered-By: Flask |
JMF | 0:24d3eb812fd4 | 86 | X-Processed-Time: 0 |
JMF | 0:24d3eb812fd4 | 87 | Content-Length: 335 |
JMF | 0:24d3eb812fd4 | 88 | Via: 1.1 vegur |
JMF | 0:24d3eb812fd4 | 89 | |
JMF | 0:24d3eb812fd4 | 90 | Body (335 bytes): |
JMF | 0:24d3eb812fd4 | 91 | |
JMF | 0:24d3eb812fd4 | 92 | { |
JMF | 0:24d3eb812fd4 | 93 | "args": {}, |
JMF | 0:24d3eb812fd4 | 94 | "data": "{\"hello\":\"world\"},{\"test\":\"1234\"}", |
JMF | 0:24d3eb812fd4 | 95 | "files": {}, |
JMF | 0:24d3eb812fd4 | 96 | "form": {}, |
JMF | 0:24d3eb812fd4 | 97 | "headers": { |
JMF | 0:24d3eb812fd4 | 98 | "Connection": "close", |
JMF | 0:24d3eb812fd4 | 99 | "Content-Length": "33", |
JMF | 0:24d3eb812fd4 | 100 | "Content-Type": "application/json", |
JMF | 0:24d3eb812fd4 | 101 | "Host": "httpbin.org" |
JMF | 0:24d3eb812fd4 | 102 | }, |
JMF | 0:24d3eb812fd4 | 103 | "json": null, |
JMF | 0:24d3eb812fd4 | 104 | "origin": "205.197.242.109", |
JMF | 0:24d3eb812fd4 | 105 | "url": "http://httpbin.org/post" |
JMF | 0:24d3eb812fd4 | 106 | } |
JMF | 0:24d3eb812fd4 | 107 | |
JMF | 0:24d3eb812fd4 | 108 | |
JMF | 0:24d3eb812fd4 | 109 | |
JMF | 0:24d3eb812fd4 | 110 | >>>Put data... |
JMF | 0:24d3eb812fd4 | 111 | |
JMF | 0:24d3eb812fd4 | 112 | ----- RESPONSE: ----- |
JMF | 0:24d3eb812fd4 | 113 | Status: 200 - OK |
JMF | 0:24d3eb812fd4 | 114 | Headers: |
JMF | 0:24d3eb812fd4 | 115 | Connection: keep-alive |
JMF | 0:24d3eb812fd4 | 116 | Server: meinheld/0.6.1 |
JMF | 0:24d3eb812fd4 | 117 | Date: Wed, 28 Mar 2018 12:58:03 GMT |
JMF | 0:24d3eb812fd4 | 118 | Content-Type: application/json |
JMF | 0:24d3eb812fd4 | 119 | Access-Control-Allow-Origin: * |
JMF | 0:24d3eb812fd4 | 120 | Access-Control-Allow-Credentials: true |
JMF | 0:24d3eb812fd4 | 121 | X-Powered-By: Flask |
JMF | 0:24d3eb812fd4 | 122 | X-Processed-Time: 0 |
JMF | 0:24d3eb812fd4 | 123 | Content-Length: 312 |
JMF | 0:24d3eb812fd4 | 124 | Via: 1.1 vegur |
JMF | 0:24d3eb812fd4 | 125 | |
JMF | 0:24d3eb812fd4 | 126 | Body (312 bytes): |
JMF | 0:24d3eb812fd4 | 127 | |
JMF | 0:24d3eb812fd4 | 128 | { |
JMF | 0:24d3eb812fd4 | 129 | "args": {}, |
JMF | 0:24d3eb812fd4 | 130 | "data": "This is a PUT test!", |
JMF | 0:24d3eb812fd4 | 131 | "files": {}, |
JMF | 0:24d3eb812fd4 | 132 | "form": {}, |
JMF | 0:24d3eb812fd4 | 133 | "headers": { |
JMF | 0:24d3eb812fd4 | 134 | "Connection": "close", |
JMF | 0:24d3eb812fd4 | 135 | "Content-Length": "19", |
JMF | 0:24d3eb812fd4 | 136 | "Content-Type": "application/json", |
JMF | 0:24d3eb812fd4 | 137 | "Host": "httpbin.org" |
JMF | 0:24d3eb812fd4 | 138 | }, |
JMF | 0:24d3eb812fd4 | 139 | "json": null, |
JMF | 0:24d3eb812fd4 | 140 | "origin": "205.197.242.109", |
JMF | 0:24d3eb812fd4 | 141 | "url": "http://httpbin.org/put" |
JMF | 0:24d3eb812fd4 | 142 | } |
JMF | 0:24d3eb812fd4 | 143 | |
JMF | 0:24d3eb812fd4 | 144 | |
JMF | 0:24d3eb812fd4 | 145 | |
JMF | 0:24d3eb812fd4 | 146 | >>>Delete data... |
JMF | 0:24d3eb812fd4 | 147 | |
JMF | 0:24d3eb812fd4 | 148 | ----- RESPONSE: ----- |
JMF | 0:24d3eb812fd4 | 149 | Status: 200 - OK |
JMF | 0:24d3eb812fd4 | 150 | Headers: |
JMF | 0:24d3eb812fd4 | 151 | Connection: keep-alive |
JMF | 0:24d3eb812fd4 | 152 | Server: meinheld/0.6.1 |
JMF | 0:24d3eb812fd4 | 153 | Date: Wed, 28 Mar 2018 12:58:04 GMT |
JMF | 0:24d3eb812fd4 | 154 | Content-Type: application/json |
JMF | 0:24d3eb812fd4 | 155 | Access-Control-Allow-Origin: * |
JMF | 0:24d3eb812fd4 | 156 | Access-Control-Allow-Credentials: true |
JMF | 0:24d3eb812fd4 | 157 | X-Powered-By: Flask |
JMF | 0:24d3eb812fd4 | 158 | X-Processed-Time: 0 |
JMF | 0:24d3eb812fd4 | 159 | Content-Length: 295 |
JMF | 0:24d3eb812fd4 | 160 | Via: 1.1 vegur |
JMF | 0:24d3eb812fd4 | 161 | |
JMF | 0:24d3eb812fd4 | 162 | Body (295 bytes): |
JMF | 0:24d3eb812fd4 | 163 | |
JMF | 0:24d3eb812fd4 | 164 | { |
JMF | 0:24d3eb812fd4 | 165 | "args": {}, |
JMF | 0:24d3eb812fd4 | 166 | "data": "", |
JMF | 0:24d3eb812fd4 | 167 | "files": {}, |
JMF | 0:24d3eb812fd4 | 168 | "form": {}, |
JMF | 0:24d3eb812fd4 | 169 | "headers": { |
JMF | 0:24d3eb812fd4 | 170 | "Connection": "close", |
JMF | 0:24d3eb812fd4 | 171 | "Content-Length": "0", |
JMF | 0:24d3eb812fd4 | 172 | "Content-Type": "application/json", |
JMF | 0:24d3eb812fd4 | 173 | "Host": "httpbin.org" |
JMF | 0:24d3eb812fd4 | 174 | }, |
JMF | 0:24d3eb812fd4 | 175 | "json": null, |
JMF | 0:24d3eb812fd4 | 176 | "origin": "205.197.242.109", |
JMF | 0:24d3eb812fd4 | 177 | "url": "http://httpbin.org/delete" |
JMF | 0:24d3eb812fd4 | 178 | } |
JMF | 0:24d3eb812fd4 | 179 | |
JMF | 0:24d3eb812fd4 | 180 | |
JMF | 0:24d3eb812fd4 | 181 | |
JMF | 0:24d3eb812fd4 | 182 | >>>HTTP:stream, send http://httpbin.org/stream/10... |
JMF | 0:24d3eb812fd4 | 183 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "http://httpbin.org/stream/10", "id": 0, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 184 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "http://httpbin.org/stream/10", "id": 1, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 185 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "http://httpbin.org/stream/10", "id": 2, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 186 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "http://httpbin.org/stream/10", "id": 3, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 187 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "http://httpbin.org/stream/10", "id": 4, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 188 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "http://httpbin.org/stream/10", "id": 5, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 189 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "http://httpbin.org/stream/10", "id": 6, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 190 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "http://httpbin.org/stream/10", "id": 7, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 191 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "http://httpbin.org/stream/10", "id": 8, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 192 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "http://httpbin.org/stream/10", "id": 9, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 193 | |
JMF | 0:24d3eb812fd4 | 194 | |
JMF | 0:24d3eb812fd4 | 195 | >>>HTTP:Status... |
JMF | 0:24d3eb812fd4 | 196 | |
JMF | 0:24d3eb812fd4 | 197 | ----- RESPONSE: ----- |
JMF | 0:24d3eb812fd4 | 198 | Status: 200 - OK |
JMF | 0:24d3eb812fd4 | 199 | Headers: |
JMF | 0:24d3eb812fd4 | 200 | Connection: keep-alive |
JMF | 0:24d3eb812fd4 | 201 | Server: meinheld/0.6.1 |
JMF | 0:24d3eb812fd4 | 202 | Date: Wed, 28 Mar 2018 12:58:05 GMT |
JMF | 0:24d3eb812fd4 | 203 | Content-Type: application/json |
JMF | 0:24d3eb812fd4 | 204 | Access-Control-Allow-Origin: * |
JMF | 0:24d3eb812fd4 | 205 | Access-Control-Allow-Credentials: true |
JMF | 0:24d3eb812fd4 | 206 | X-Powered-By: Flask |
JMF | 0:24d3eb812fd4 | 207 | X-Processed-Time: 0 |
JMF | 0:24d3eb812fd4 | 208 | Content-Length: 485 |
JMF | 0:24d3eb812fd4 | 209 | Via: 1.1 vegur |
JMF | 0:24d3eb812fd4 | 210 | |
JMF | 0:24d3eb812fd4 | 211 | Body (485 bytes): |
JMF | 0:24d3eb812fd4 | 212 | |
JMF | 0:24d3eb812fd4 | 213 | { |
JMF | 0:24d3eb812fd4 | 214 | "args": { |
JMF | 0:24d3eb812fd4 | 215 | "show_env": "1" |
JMF | 0:24d3eb812fd4 | 216 | }, |
JMF | 0:24d3eb812fd4 | 217 | "headers": { |
JMF | 0:24d3eb812fd4 | 218 | "Connect-Time": "0", |
JMF | 0:24d3eb812fd4 | 219 | "Connection": "close", |
JMF | 0:24d3eb812fd4 | 220 | "Host": "httpbin.org", |
JMF | 0:24d3eb812fd4 | 221 | "Total-Route-Time": "0", |
JMF | 0:24d3eb812fd4 | 222 | "Via": "1.1 vegur", |
JMF | 0:24d3eb812fd4 | 223 | "X-Forwarded-For": "205.197.242.109", |
JMF | 0:24d3eb812fd4 | 224 | "X-Forwarded-Port": "80", |
JMF | 0:24d3eb812fd4 | 225 | "X-Forwarded-Proto": "http", |
JMF | 0:24d3eb812fd4 | 226 | "X-Request-Id": "c0473d12-4062-4f12-88f2-7456d75de557", |
JMF | 0:24d3eb812fd4 | 227 | "X-Request-Start": "1522241885624" |
JMF | 0:24d3eb812fd4 | 228 | }, |
JMF | 0:24d3eb812fd4 | 229 | "origin": "205.197.242.109", |
JMF | 0:24d3eb812fd4 | 230 | "url": "http://httpbin.org/get?show_env=1" |
JMF | 0:24d3eb812fd4 | 231 | } |
JMF | 0:24d3eb812fd4 | 232 | |
JMF | 0:24d3eb812fd4 | 233 | >>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<< |
JMF | 0:24d3eb812fd4 | 234 | >>> TEST HTTPS - set up TLS connection <<< |
JMF | 0:24d3eb812fd4 | 235 | >>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<< |
JMF | 0:24d3eb812fd4 | 236 | |
JMF | 0:24d3eb812fd4 | 237 | Connecting to httpbin.org:443 |
JMF | 0:24d3eb812fd4 | 238 | Starting the TLS handshake... |
JMF | 0:24d3eb812fd4 | 239 | TLS connection to httpbin.org:443 established |
JMF | 0:24d3eb812fd4 | 240 | Server certificate: |
JMF | 0:24d3eb812fd4 | 241 | cert. version : 3 |
JMF | 0:24d3eb812fd4 | 242 | serial number : 03:55:B1:71:8C:8A:36:EC:AB:6C:1F:EA:C2:DD:D0:EC:F9:AD |
JMF | 0:24d3eb812fd4 | 243 | issuer name : C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3 |
JMF | 0:24d3eb812fd4 | 244 | subject name : CN=httpbin.org |
JMF | 0:24d3eb812fd4 | 245 | issued on : 2018-03-13 01:23:44 |
JMF | 0:24d3eb812fd4 | 246 | expires on : 2018-06-11 01:23:44 |
JMF | 0:24d3eb812fd4 | 247 | signed using : RSA with SHA-256 |
JMF | 0:24d3eb812fd4 | 248 | RSA key size : 2048 bits |
JMF | 0:24d3eb812fd4 | 249 | basic constraints : CA=false |
JMF | 0:24d3eb812fd4 | 250 | subject alt name : httpbin.org, www.httpbin.org |
JMF | 0:24d3eb812fd4 | 251 | key usage : Digital Signature, Key Encipherment |
JMF | 0:24d3eb812fd4 | 252 | ext key usage : TLS Web Server Authentication, TLS Web Client Authentication |
JMF | 0:24d3eb812fd4 | 253 | Certificate verification passed |
JMF | 0:24d3eb812fd4 | 254 | |
JMF | 0:24d3eb812fd4 | 255 | |
JMF | 0:24d3eb812fd4 | 256 | |
JMF | 0:24d3eb812fd4 | 257 | >>>Post data... ** |
JMF | 0:24d3eb812fd4 | 258 | |
JMF | 0:24d3eb812fd4 | 259 | ----- RESPONSE: ----- |
JMF | 0:24d3eb812fd4 | 260 | Status: 200 - OK |
JMF | 0:24d3eb812fd4 | 261 | Headers: |
JMF | 0:24d3eb812fd4 | 262 | Connection: keep-alive |
JMF | 0:24d3eb812fd4 | 263 | Server: meinheld/0.6.1 |
JMF | 0:24d3eb812fd4 | 264 | Date: Wed, 28 Mar 2018 12:58:19 GMT |
JMF | 0:24d3eb812fd4 | 265 | Content-Type: application/json |
JMF | 0:24d3eb812fd4 | 266 | Access-Control-Allow-Origin: * |
JMF | 0:24d3eb812fd4 | 267 | Access-Control-Allow-Credentials: true |
JMF | 0:24d3eb812fd4 | 268 | X-Powered-By: Flask |
JMF | 0:24d3eb812fd4 | 269 | X-Processed-Time: 0 |
JMF | 0:24d3eb812fd4 | 270 | Content-Length: 336 |
JMF | 0:24d3eb812fd4 | 271 | Via: 1.1 vegur |
JMF | 0:24d3eb812fd4 | 272 | |
JMF | 0:24d3eb812fd4 | 273 | Body (336 bytes): |
JMF | 0:24d3eb812fd4 | 274 | |
JMF | 0:24d3eb812fd4 | 275 | { |
JMF | 0:24d3eb812fd4 | 276 | "args": {}, |
JMF | 0:24d3eb812fd4 | 277 | "data": "{\"hello\":\"world\"},{\"test\":\"1234\"}", |
JMF | 0:24d3eb812fd4 | 278 | "files": {}, |
JMF | 0:24d3eb812fd4 | 279 | "form": {}, |
JMF | 0:24d3eb812fd4 | 280 | "headers": { |
JMF | 0:24d3eb812fd4 | 281 | "Connection": "close", |
JMF | 0:24d3eb812fd4 | 282 | "Content-Length": "33", |
JMF | 0:24d3eb812fd4 | 283 | "Content-Type": "application/json", |
JMF | 0:24d3eb812fd4 | 284 | "Host": "httpbin.org" |
JMF | 0:24d3eb812fd4 | 285 | }, |
JMF | 0:24d3eb812fd4 | 286 | "json": null, |
JMF | 0:24d3eb812fd4 | 287 | "origin": "205.197.242.109", |
JMF | 0:24d3eb812fd4 | 288 | "url": "https://httpbin.org/post" |
JMF | 0:24d3eb812fd4 | 289 | } |
JMF | 0:24d3eb812fd4 | 290 | |
JMF | 0:24d3eb812fd4 | 291 | |
JMF | 0:24d3eb812fd4 | 292 | |
JMF | 0:24d3eb812fd4 | 293 | >>>Put data... |
JMF | 0:24d3eb812fd4 | 294 | |
JMF | 0:24d3eb812fd4 | 295 | ----- RESPONSE: ----- |
JMF | 0:24d3eb812fd4 | 296 | Status: 200 - OK |
JMF | 0:24d3eb812fd4 | 297 | Headers: |
JMF | 0:24d3eb812fd4 | 298 | Connection: keep-alive |
JMF | 0:24d3eb812fd4 | 299 | Server: meinheld/0.6.1 |
JMF | 0:24d3eb812fd4 | 300 | Date: Wed, 28 Mar 2018 12:58:20 GMT |
JMF | 0:24d3eb812fd4 | 301 | Content-Type: application/json |
JMF | 0:24d3eb812fd4 | 302 | Access-Control-Allow-Origin: * |
JMF | 0:24d3eb812fd4 | 303 | Access-Control-Allow-Credentials: true |
JMF | 0:24d3eb812fd4 | 304 | X-Powered-By: Flask |
JMF | 0:24d3eb812fd4 | 305 | X-Processed-Time: 0 |
JMF | 0:24d3eb812fd4 | 306 | Content-Length: 313 |
JMF | 0:24d3eb812fd4 | 307 | Via: 1.1 vegur |
JMF | 0:24d3eb812fd4 | 308 | |
JMF | 0:24d3eb812fd4 | 309 | Body (313 bytes): |
JMF | 0:24d3eb812fd4 | 310 | |
JMF | 0:24d3eb812fd4 | 311 | { |
JMF | 0:24d3eb812fd4 | 312 | "args": {}, |
JMF | 0:24d3eb812fd4 | 313 | "data": "This is a PUT test!", |
JMF | 0:24d3eb812fd4 | 314 | "files": {}, |
JMF | 0:24d3eb812fd4 | 315 | "form": {}, |
JMF | 0:24d3eb812fd4 | 316 | "headers": { |
JMF | 0:24d3eb812fd4 | 317 | "Connection": "close", |
JMF | 0:24d3eb812fd4 | 318 | "Content-Length": "19", |
JMF | 0:24d3eb812fd4 | 319 | "Content-Type": "application/json", |
JMF | 0:24d3eb812fd4 | 320 | "Host": "httpbin.org" |
JMF | 0:24d3eb812fd4 | 321 | }, |
JMF | 0:24d3eb812fd4 | 322 | "json": null, |
JMF | 0:24d3eb812fd4 | 323 | "origin": "205.197.242.109", |
JMF | 0:24d3eb812fd4 | 324 | "url": "https://httpbin.org/put" |
JMF | 0:24d3eb812fd4 | 325 | } |
JMF | 0:24d3eb812fd4 | 326 | |
JMF | 0:24d3eb812fd4 | 327 | |
JMF | 0:24d3eb812fd4 | 328 | |
JMF | 0:24d3eb812fd4 | 329 | >>>Delete data... |
JMF | 0:24d3eb812fd4 | 330 | |
JMF | 0:24d3eb812fd4 | 331 | ----- RESPONSE: ----- |
JMF | 0:24d3eb812fd4 | 332 | Status: 200 - OK |
JMF | 0:24d3eb812fd4 | 333 | Headers: |
JMF | 0:24d3eb812fd4 | 334 | Connection: keep-alive |
JMF | 0:24d3eb812fd4 | 335 | Server: meinheld/0.6.1 |
JMF | 0:24d3eb812fd4 | 336 | Date: Wed, 28 Mar 2018 12:58:20 GMT |
JMF | 0:24d3eb812fd4 | 337 | Content-Type: application/json |
JMF | 0:24d3eb812fd4 | 338 | Access-Control-Allow-Origin: * |
JMF | 0:24d3eb812fd4 | 339 | Access-Control-Allow-Credentials: true |
JMF | 0:24d3eb812fd4 | 340 | X-Powered-By: Flask |
JMF | 0:24d3eb812fd4 | 341 | X-Processed-Time: 0 |
JMF | 0:24d3eb812fd4 | 342 | Content-Length: 296 |
JMF | 0:24d3eb812fd4 | 343 | Via: 1.1 vegur |
JMF | 0:24d3eb812fd4 | 344 | |
JMF | 0:24d3eb812fd4 | 345 | Body (296 bytes): |
JMF | 0:24d3eb812fd4 | 346 | |
JMF | 0:24d3eb812fd4 | 347 | { |
JMF | 0:24d3eb812fd4 | 348 | "args": {}, |
JMF | 0:24d3eb812fd4 | 349 | "data": "", |
JMF | 0:24d3eb812fd4 | 350 | "files": {}, |
JMF | 0:24d3eb812fd4 | 351 | "form": {}, |
JMF | 0:24d3eb812fd4 | 352 | "headers": { |
JMF | 0:24d3eb812fd4 | 353 | "Connection": "close", |
JMF | 0:24d3eb812fd4 | 354 | "Content-Length": "0", |
JMF | 0:24d3eb812fd4 | 355 | "Content-Type": "application/json", |
JMF | 0:24d3eb812fd4 | 356 | "Host": "httpbin.org" |
JMF | 0:24d3eb812fd4 | 357 | }, |
JMF | 0:24d3eb812fd4 | 358 | "json": null, |
JMF | 0:24d3eb812fd4 | 359 | "origin": "205.197.242.109", |
JMF | 0:24d3eb812fd4 | 360 | "url": "https://httpbin.org/delete" |
JMF | 0:24d3eb812fd4 | 361 | } |
JMF | 0:24d3eb812fd4 | 362 | |
JMF | 0:24d3eb812fd4 | 363 | |
JMF | 0:24d3eb812fd4 | 364 | |
JMF | 0:24d3eb812fd4 | 365 | >>>HTTP:stream, send http://httpbin.org/stream/10... |
JMF | 0:24d3eb812fd4 | 366 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "https://httpbin.org/stream/10", "id": 0, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 367 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "https://httpbin.org/stream/10", "id": 1, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 368 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "https://httpbin.org/stream/10", "id": 2, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 369 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "https://httpbin.org/stream/10", "id": 3, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 370 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "https://httpbin.org/stream/10", "id": 4, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 371 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "https://httpbin.org/stream/10", "id": 5, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 372 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "https://httpbin.org/stream/10", "id": 6, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 373 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "https://httpbin.org/stream/10", "id": 7, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 374 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "https://httpbin.org/stream/10", "id": 8, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 375 | Chunk Received: {"args": {}, "headers": {"Host": "httpbin.org", "Connection": "close"}, "url": "https://httpbin.org/stream/10", "id": 9, "origin": "205.197.242.109"} |
JMF | 0:24d3eb812fd4 | 376 | |
JMF | 0:24d3eb812fd4 | 377 | |
JMF | 0:24d3eb812fd4 | 378 | >>>HTTP:Status... |
JMF | 0:24d3eb812fd4 | 379 | |
JMF | 0:24d3eb812fd4 | 380 | ----- RESPONSE: ----- |
JMF | 0:24d3eb812fd4 | 381 | Status: 200 - OK |
JMF | 0:24d3eb812fd4 | 382 | Headers: |
JMF | 0:24d3eb812fd4 | 383 | Connection: keep-alive |
JMF | 0:24d3eb812fd4 | 384 | Server: meinheld/0.6.1 |
JMF | 0:24d3eb812fd4 | 385 | Date: Wed, 28 Mar 2018 12:58:20 GMT |
JMF | 0:24d3eb812fd4 | 386 | Content-Type: application/json |
JMF | 0:24d3eb812fd4 | 387 | Access-Control-Allow-Origin: * |
JMF | 0:24d3eb812fd4 | 388 | Access-Control-Allow-Credentials: true |
JMF | 0:24d3eb812fd4 | 389 | X-Powered-By: Flask |
JMF | 0:24d3eb812fd4 | 390 | X-Processed-Time: 0 |
JMF | 0:24d3eb812fd4 | 391 | Content-Length: 488 |
JMF | 0:24d3eb812fd4 | 392 | Via: 1.1 vegur |
JMF | 0:24d3eb812fd4 | 393 | |
JMF | 0:24d3eb812fd4 | 394 | Body (488 bytes): |
JMF | 0:24d3eb812fd4 | 395 | |
JMF | 0:24d3eb812fd4 | 396 | { |
JMF | 0:24d3eb812fd4 | 397 | "args": { |
JMF | 0:24d3eb812fd4 | 398 | "show_env": "1" |
JMF | 0:24d3eb812fd4 | 399 | }, |
JMF | 0:24d3eb812fd4 | 400 | "headers": { |
JMF | 0:24d3eb812fd4 | 401 | "Connect-Time": "0", |
JMF | 0:24d3eb812fd4 | 402 | "Connection": "close", |
JMF | 0:24d3eb812fd4 | 403 | "Host": "httpbin.org", |
JMF | 0:24d3eb812fd4 | 404 | "Total-Route-Time": "0", |
JMF | 0:24d3eb812fd4 | 405 | "Via": "1.1 vegur", |
JMF | 0:24d3eb812fd4 | 406 | "X-Forwarded-For": "205.197.242.109", |
JMF | 0:24d3eb812fd4 | 407 | "X-Forwarded-Port": "443", |
JMF | 0:24d3eb812fd4 | 408 | "X-Forwarded-Proto": "https", |
JMF | 0:24d3eb812fd4 | 409 | "X-Request-Id": "1a203766-8bdd-411b-89a4-25911114e72b", |
JMF | 0:24d3eb812fd4 | 410 | "X-Request-Start": "1522241901714" |
JMF | 0:24d3eb812fd4 | 411 | }, |
JMF | 0:24d3eb812fd4 | 412 | "origin": "205.197.242.109", |
JMF | 0:24d3eb812fd4 | 413 | "url": "https://httpbin.org/get?show_env=1" |
JMF | 0:24d3eb812fd4 | 414 | } |
JMF | 0:24d3eb812fd4 | 415 | |
JMF | 0:24d3eb812fd4 | 416 | - - - - - - - ALL DONE - - - - - - - |
JMF | 0:24d3eb812fd4 | 417 | |
JMF | 0:24d3eb812fd4 | 418 | ``` |
JMF | 0:24d3eb812fd4 | 419 | |
JMF | 0:24d3eb812fd4 | 420 | # Build for Greentea testing |
JMF | 0:24d3eb812fd4 | 421 | You can test driver operation by building and running the MBed OS Greentea test suite: |
JMF | 0:24d3eb812fd4 | 422 | 1. There is a known issue when using Greentea (https://os.mbed.com/docs/v5.7/tools/testing-applications.html) |
JMF | 0:24d3eb812fd4 | 423 | whereby there cannot be a main() function outside of a TESTS directory when building and running tests. This |
JMF | 0:24d3eb812fd4 | 424 | is because all nontest code is compiled and linked with the test code and a linker error will occur due to |
JMF | 0:24d3eb812fd4 | 425 | multiple main() functions defined. To eleminate this problem, rename the main application file in the 'source' |
JMF | 0:24d3eb812fd4 | 426 | directory to build. NOTE: this only applies when using the Greentea test suite. |
JMF | 0:24d3eb812fd4 | 427 | |
JMF | 0:24d3eb812fd4 | 428 | In summary, rename the application source file 'source/main-x.cpp' to 'source/main-x.keepcpp'. |
JMF | 0:24d3eb812fd4 | 429 | |
JMF | 0:24d3eb812fd4 | 430 | 2. Execute the command: **mbed test -m NUCLEO_L476RG -t GCC_ARM -c --test-config bg96_config.json -n mbed-os-tests-netsocket-\*** |
JMF | 0:24d3eb812fd4 | 431 | When running the test suite, it programs different test files into the hardware to run so execution will take |
JMF | 0:24d3eb812fd4 | 432 | some time to complete. When finished, you will get a summary report similar to: |
JMF | 0:24d3eb812fd4 | 433 | |
JMF | 0:24d3eb812fd4 | 434 | ``` |
JMF | 0:24d3eb812fd4 | 435 | mbedgt: test suite report: |
JMF | 0:24d3eb812fd4 | 436 | |
JMF | 0:24d3eb812fd4 | 437 | +-----------------------+---------------+-----------------------------------------+--------+--------------------+-------------+ |
JMF | 0:24d3eb812fd4 | 438 | | target | platform_name | test suite | result | elapsed_time (sec) | copy_method | |
JMF | 0:24d3eb812fd4 | 439 | +-----------------------+---------------+-----------------------------------------+--------+--------------------+-------------+ |
JMF | 0:24d3eb812fd4 | 440 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-connectivity | OK | 47.72 | default | |
JMF | 0:24d3eb812fd4 | 441 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-gethostbyname | OK | 25.99 | default | |
JMF | 0:24d3eb812fd4 | 442 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-ip_parsing | OK | 11.83 | default | |
JMF | 0:24d3eb812fd4 | 443 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-socket_sigio | OK | 36.46 | default | |
JMF | 0:24d3eb812fd4 | 444 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-tcp_echo | OK | 37.9 | default | |
JMF | 0:24d3eb812fd4 | 445 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-tcp_hello_world | OK | 28.42 | default | |
JMF | 0:24d3eb812fd4 | 446 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-udp_echo | OK | 30.89 | default | |
JMF | 0:24d3eb812fd4 | 447 | +-----------------------+---------------+-----------------------------------------+--------+--------------------+-------------+ |
JMF | 0:24d3eb812fd4 | 448 | mbedgt: test suite results: 7 OK |
JMF | 0:24d3eb812fd4 | 449 | mbedgt: test case report: |
JMF | 0:24d3eb812fd4 | 450 | +-----------------------+---------------+-----------------------------------------+----------------------------------------+--------+--------+--------+--------------------+ |
JMF | 0:24d3eb812fd4 | 451 | | target | platform_name | test suite | test case | passed | failed | result | elapsed_time (sec) | |
JMF | 0:24d3eb812fd4 | 452 | +-----------------------+---------------+-----------------------------------------+----------------------------------------+--------+--------+--------+--------------------+ |
JMF | 0:24d3eb812fd4 | 453 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-connectivity | Bringing the network up and down | 1 | 0 | OK | 14.03 | |
JMF | 0:24d3eb812fd4 | 454 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-connectivity | Bringing the network up and down twice | 1 | 0 | OK | 21.89 | |
JMF | 0:24d3eb812fd4 | 455 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-gethostbyname | DNS literal | 1 | 0 | OK | 0.02 | |
JMF | 0:24d3eb812fd4 | 456 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-gethostbyname | DNS preference literal | 1 | 0 | OK | 0.02 | |
JMF | 0:24d3eb812fd4 | 457 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-gethostbyname | DNS preference query | 1 | 0 | OK | 0.02 | |
JMF | 0:24d3eb812fd4 | 458 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-gethostbyname | DNS query | 1 | 0 | OK | 0.14 | |
JMF | 0:24d3eb812fd4 | 459 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-ip_parsing | Hollowed IPv6 address | 1 | 0 | OK | 0.0 | |
JMF | 0:24d3eb812fd4 | 460 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-ip_parsing | Left-weighted IPv4 address | 1 | 0 | OK | 0.02 | |
JMF | 0:24d3eb812fd4 | 461 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-ip_parsing | Left-weighted IPv6 address | 1 | 0 | OK | 0.0 | |
JMF | 0:24d3eb812fd4 | 462 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-ip_parsing | Null IPv4 address | 1 | 0 | OK | 0.0 | |
JMF | 0:24d3eb812fd4 | 463 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-ip_parsing | Null IPv6 address | 1 | 0 | OK | 0.0 | |
JMF | 0:24d3eb812fd4 | 464 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-ip_parsing | Right-weighted IPv4 address | 1 | 0 | OK | 0.0 | |
JMF | 0:24d3eb812fd4 | 465 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-ip_parsing | Right-weighted IPv6 address | 1 | 0 | OK | 0.01 | |
JMF | 0:24d3eb812fd4 | 466 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-ip_parsing | Simple IPv4 address | 1 | 0 | OK | 0.0 | |
JMF | 0:24d3eb812fd4 | 467 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-ip_parsing | Simple IPv6 address | 1 | 0 | OK | 0.0 | |
JMF | 0:24d3eb812fd4 | 468 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-socket_sigio | Socket Attach Test | 1 | 0 | OK | 3.59 | |
JMF | 0:24d3eb812fd4 | 469 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-socket_sigio | Socket Detach Test | 1 | 0 | OK | 6.22 | |
JMF | 0:24d3eb812fd4 | 470 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-socket_sigio | Socket Reattach Test | 1 | 0 | OK | 0.53 | |
JMF | 0:24d3eb812fd4 | 471 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-tcp_echo | TCP echo | 1 | 0 | OK | 26.16 | |
JMF | 0:24d3eb812fd4 | 472 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-tcp_hello_world | TCP hello world | 1 | 0 | OK | 16.66 | |
JMF | 0:24d3eb812fd4 | 473 | | NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | mbed-os-tests-netsocket-udp_echo | UDP echo | 1 | 0 | OK | 19.2 | |
JMF | 0:24d3eb812fd4 | 474 | +-----------------------+---------------+-----------------------------------------+----------------------------------------+--------+--------+--------+--------------------+ |
JMF | 0:24d3eb812fd4 | 475 | mbedgt: test case results: 21 OK |
JMF | 0:24d3eb812fd4 | 476 | mbedgt: completed in 219.44 sec |
JMF | 0:24d3eb812fd4 | 477 | |
JMF | 0:24d3eb812fd4 | 478 | ``` |
JMF | 0:24d3eb812fd4 | 479 | |
JMF | 0:24d3eb812fd4 | 480 | NOTE: the "UDP DTLS handshake" test is a known failure and is expected. |
JMF | 0:24d3eb812fd4 | 481 | |
JMF | 0:24d3eb812fd4 | 482 | |
JMF | 0:24d3eb812fd4 | 483 |