SoftAp Flyport WIFI G

From openPicus Wiki
Jump to: navigation, search

Contents

What you are going to learn

This tutorial shows how to manage Soft Access Point feature of Flyport Wifi G.

Introduction to Soft Acess Point

Soft Access Point is a special feature of Flyport Wifi G (Flyport Wifi with MRF24WG0MA/B transceiver - it's the blue colored one...) only. SoftAP mode permits to create a infrastructure network with Flyport Wifi. In this way, you can connect any wifi device (but only one at time) to Flyport module.

Soft AP can be configured with as both open network or WEP protected network.

There are some differences between SoftAP and Adhoc network. Since Adhoc network is old and (almost) deprecated network configuration, some newer devices cannot connect to them (for example Android devices or some Windows phone 8). With SoftAp network those devices can reach and discover Flyport's network as any other access point.

NOTE: Please remember that the network created with SoftAP mode is a SOFTWARE access point, so its performances could be reduced respect to hardware access point. Plus you could not access to Internet-based services!

How to use it

SoftAP network can be configured in both IDE Wizard, or in firmware's custom profile.

Using Default Profile (IDE Wizard configuration)

To set Flyport's default network parameters to create a SoftAP connection, you have to choose "Soft AP" from the following page of IDE wizard

IDE Wizard - Flyport Wifi G SoftAP configuration

Once done, your Flyport could create a SoftAP network simply using the WFConnect(WF_DEFAULT); function. If you enabled DHCP Server service on the first page of IDE Wizard, any client connected to Flyport will receive a network IP number on the same subnet.

Using Custom Profile

If you plan to use several Wifi Network settings in your application, you can use WF_CUSTOM profile to set network parameters at firmware runtime execution. In case you would like to set your WF_CUSTOM network type as SoftAP, just use the command
NETSetParam(NETWORK_TYPE, SOFTAP);
Set SSID name with your prefered one, for example: NETSetParam(SSID_NAME, "Flyport Custom SoftAP");
Once your Flyport is disconnected to any network use WFConnect(WF_CUSTOM); to let Flyport Wifi G to create Soft Access Point Network

How to test it

Bill of Materials

  • 1x Flyport Wifi G Module
  • 1x miniUSB programmer
  • 1x any Flyport Nest (carrier boards)


Code example

If you would like to use WF_DEFAULT profile and IDE Wizard

Create a Flyport Wifi G project form the available templates of IDE (2.4 or above):

  • New Project
    • WiFi-G
      • Choose the template you want

Open IDE Wizard and be sure parameters as set as shown in this chapter

Compile and Download firmware

At Startup your Flyport Wifi G will create a SoftAP network


If you would like to use WF_CUSTOM profile and firmware

Here is a snippet of how to set a SoftAP network using Custom profile and Flyport's firmware

Substitute taskFlyport.c code with:

#include "taskFlyport.h"
 
void FlyportTask()
{
    // Set SoftAP Custom profile from firmware:
    NETSetParam(NETWORK_TYPE, SOFTAP);
    NETSetParam(SSID_NAME, "Flyport Custom SoftAP");
    WFSetSecurity(WF_SECURITY_OPEN, "", 0, 0); 
 
    // Flyport connects to network
    WFConnect(WF_CUSTOM);
    while(WFGetStat() != CONNECTED);
    vTaskDelay(25);
    UARTWrite(1,"Flyport Wi-fi G connected...hello world!\r\n");
 
    while(1)
    {
        //    Main user's firmware loop
    }
}

Compile and Download firmware

At Startup your Flyport Wifi G will create a SoftAP network named "Flyport Custom SoftAP"

Personal tools
Namespaces

Variants
Actions
START HERE
DEVELOPMENT
HARDWARE INFO
RESOURCES
PHASED OUT
Toolbox