This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot-open:remotelab:sut:generalpurpose2:u2 [2019/08/04 13:21] – pczekalski | en:iot-open:remotelab:sut:generalpurpose2:u2 [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| === Prerequisites === | === Prerequisites === | ||
| - | You need to know how to handle 4×20 characters LCD screen. In case of doubt re-work on scenarios B1 and B2.\\ <fc # | + | You need to know how to handle 4×20 characters LCD screen. In case of doubt re-work on scenarios B1 and B2.\\ <fc # |
| - | <note warning> | + | <note warning> |
| To fully experience this scenario, you need to book another node (one of 1,2,3 or 4), to let the other node act as your networking client. You can use scenario U1 for this purpose but mind to update network SSID and passphrase in your code, to let it connect to your server. <note tip> | To fully experience this scenario, you need to book another node (one of 1,2,3 or 4), to let the other node act as your networking client. You can use scenario U1 for this purpose but mind to update network SSID and passphrase in your code, to let it connect to your server. <note tip> | ||
| Line 24: | Line 24: | ||
| <code c> | <code c> | ||
| #include < | #include < | ||
| - | #include < | ||
| #include < | #include < | ||
| #include < | #include < | ||
| Line 30: | Line 29: | ||
| </ | </ | ||
| == Step 2 == | == Step 2 == | ||
| - | Give it some definitions as identifiers for cleaner code: | + | Give it some definitions as identifiers for cleaner code, remember to change ssid name to yours! |
| <code c> | <code c> | ||
| - | #define wifi_ssid_ap | + | #define wifi_ssid_ap |
| #define wifi_password_ap " | #define wifi_password_ap " | ||
| </ | </ | ||
| - | < | + | < |
| == Step 3 == | == Step 3 == | ||
| Print some information about starting software WiFi AP, configure network interface as a WiFi AP and give it a try to start: | Print some information about starting software WiFi AP, configure network interface as a WiFi AP and give it a try to start: | ||
| <code c> | <code c> | ||
| + | ... | ||
| + | delay(10); | ||
| + | ... | ||
| WiFi.mode(WIFI_AP); | WiFi.mode(WIFI_AP); | ||
| - | boolean result = WiFi.softAP(" | + | |
| + | | ||
| + | | ||
| if(result == true) | if(result == true) | ||
| { | { | ||
| - | Serial.println(" | + | ... //Announce success, print status, SSID and passphrase to the LCD |
| } | } | ||
| else | else | ||
| { | { | ||
| - | Serial.println(" | + | ... //Announce failure. Print it on LCD |
| } | } | ||
| + | ... | ||
| </ | </ | ||
| - | == Step n == | + | == Step 4 == |
| - | //Describe activities done in Step n.// | + | Implement |
| + | <code c> | ||
| + | ... | ||
| + | void loop() | ||
| + | { | ||
| + | lcd.setCursor(0, | ||
| + | sprintf(buffer, | ||
| + | lcd.print(buffer); | ||
| + | delay(3000); | ||
| + | } | ||
| + | ... | ||
| + | </code> | ||
| === Result validation === | === Result validation === | ||
| - | Check your AP is active on LCD. If so, compile U1 scenario on another node(s), mind to update SSID and passphrase then observe if connected clients counter | + | Check your AP is active on LCD eventually observe failure. If works OK, compile U1 scenario on another node(s), mind to update SSID and passphrase |
| === FAQ === | === FAQ === | ||
| Do I need to use WiFi.mode(WIFI_AP);?: | Do I need to use WiFi.mode(WIFI_AP);?: | ||