WiFi-PRO Module

  • View
    223

  • Download
    5

Embed Size (px)

Transcript

  • WiFi-PRO ModuleNetworking Guide

  • -2- v7.1

    Index

    Document version: v7.1 - 07/2017 Libelium Comunicaciones Distribuidas S.L.

    INDEX1. Introduction ..........................................................................................................................4

    1.1. Connect to a standard router .......................................................................................................... 51.2. Connect to a Meshlium .................................................................................................................... 61.3. When is Meshlium recommended? ................................................................................................ 61.4. WiFi vs WiFi PRO ................................................................................................................................ 8

    2. Hardware ...............................................................................................................................92.1. Specifications ..................................................................................................................................... 92.2. Power consumption........................................................................................................................ 102.3. Time consumption .......................................................................................................................... 102.4. How to connect the module .......................................................................................................... 102.5. Expansion Radio Board .................................................................................................................. 11

    3. Software ...............................................................................................................................133.1. Waspmote libraries ......................................................................................................................... 13

    3.1.1. Waspmote WiFi PRO libraries ............................................................................................133.1.2. Class constructor .................................................................................................................133.1.3. API constants .......................................................................................................................133.1.4. API variables .........................................................................................................................143.1.5. API functions ........................................................................................................................143.1.6. Error codes ...........................................................................................................................15

    3.2. Switch on .......................................................................................................................................... 183.3. Restore to factory defaults ............................................................................................................ 183.4. Switch off .......................................................................................................................................... 183.5. How to configure and join an Access Point ................................................................................. 18

    3.5.1. Configure ESSID ...................................................................................................................183.5.2. Configure the password .....................................................................................................193.5.3. Software reset ......................................................................................................................193.5.4. Join the Access Point ...........................................................................................................19

    3.6. IP addressing ................................................................................................................................... 203.6.1. DHCP client ..........................................................................................................................203.6.2. Static IP address ..................................................................................................................20

    3.7. Ping ................................................................................................................................................... 213.8. Power level ....................................................................................................................................... 213.9. Certificate management for SSL connections ............................................................................. 22

    3.9.1. How SSL works ....................................................................................................................223.9.2. Set the CA certificate ...........................................................................................................22

    3.10. TCP/UDP sockets ........................................................................................................................... 243.10.1. TCP client ............................................................................................................................24

  • -3- v7.1

    3.10.2. TCP server ..........................................................................................................................253.10.3. UDP ....................................................................................................................................263.10.4. Send data to a TCP/UDP socket .......................................................................................273.10.5. Receive data from a TCP/UDP socket .............................................................................273.10.6. Closing a socket .................................................................................................................283.10.7. SSL sockets .........................................................................................................................28

    3.11. HTTP client ..................................................................................................................................... 293.11.1. HTTP GET ............................................................................................................................293.11.2. HTTP POST .........................................................................................................................293.11.3. HTTPS ..................................................................................................................................303.11.4. Send Waspmote frames to Meshlium ............................................................................31

    3.12. FTP client ........................................................................................................................................ 323.12.1. Open FTP session ..............................................................................................................323.12.2. FTP directory listing ...........................................................................................................333.12.3. FTP make directory ...........................................................................................................333.12.4. FTP change working directory .........................................................................................343.12.5. FTP file size in server .........................................................................................................343.12.6. FTP upload .........................................................................................................................353.12.7. FTP download ....................................................................................................................353.12.8. Close FTP session ..............................................................................................................36

    3.13. Scan APs ......................................................................................................................................... 363.14. Set RTC time from NTP server ..................................................................................................... 37

    3.14.1. Time Server setting ...........................................................................................................373.14.2. Time activation flag ...........................................................................................................373.14.3. GMT .....................................................................................................................................373.14.4. Update RTC settings from WiFi PRO module .................................................................37

    3.15. Multiple SSIDs ................................................................................................................................ 383.16. Roaming mode .............................................................................................................................. 39

    3.16.1. Behavior following a hardware or software reset ........................................................393.16.2. Behavior when AP signal becomes weak .......................................................................393.16.3. Behavior in the event of a lost link ..................................................................................40

    3.17. Firmware version .............................................................................