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.

LAUNCHXL-CC3235SF: How can I add my own webserver to the WIFI-HTTP code.

Part Number: LAUNCHXL-CC3235SF
Other Parts Discussed in Thread: CC3220SF, CC3235SF, UNIFLASH, SYSCONFIG

Tool/software:

Greetings;
I have a ready WIFI-HTTP code and the code works properly. When I type mysimplelink.net/portable.html, the webserver opens in my browser. I am running the device in STA mode, in this mode, when I type 192.168.1.15/portable.html instead of mysimplelink.net/portable.html, the html webserver opens. I do not want this because the ip addresses of the devices can change constantly and the users cannot know this.

I want to send data without the need for an ip address with a webserver or a windows form application. I don't know how to do this, can you guide me.

  • Hi,

    I think we talk this topic here. But it seems you are not trust to my answer. Please wait for answer from other users, but do not expect other answer.

    Jan

  • I trust your answer. and I want you to guide me for the fastest solution. i wrote a code in windovs form app with visual studio. but here i am using ip address. i should not do this.
    I am putting a piece of code here. 

    try
    {
    // Send GET request to the device's IP address
    HttpResponseMessage response = await client.GetAsync("">http://192.168.1.94/wifi");

    if (!response.IsSuccessStatusCode)
    {
    // Log error if there's an unsuccessful status code (like 404)
    listBox1.Items.Clear();
    listBox1.Items.Add("Error: " + response.StatusCode);
    }
    else
    {
    // Get the response content as a string
    string responseData = await response.Content.ReadAsStringAsync();

    // Display the Wi-Fi results in the ListBox
    DisplayWifiResults(responseData);
    }
    }
    catch (HttpRequestException e)
    {
    // Handle connection or request errors (e.g., network issues, 404 errors)
    listBox1.Items.Clear();
    listBox1.Items.Add("Connection error: " + e.Message);
    }
    }

  • Hi,

    If you want to create own FindDevice software, there is multiple options:

    • Enable mDNS at CC32xx and create at Visual studio application which can discovery using mDNS. I am not familiar about mDNS component for Visual Studio, but you can use 3rd party software like a Bonjour Browser for Windows or mDNS Discovery for Andriod
    • You can create own FindDevice protocol. You need to create into CC32xx UDP server which will listen at some particular port. And you can create application at Visual Studio which will send UDP broadcast and listen for responses. This should be relatively easy task, but some complication may to be when computer have multiple network interfaces. For example I use this way. (I use modified Lantronix FindDevice protocol at UDP port 30718).
    • You can create cloud based solution. Your CC32xx will send HTTP request with IP address to your Cloud server. Your server will save into database this IP together with external IP (IP address from which come request). And when user open webpage of your Cloud server, you will check if external IP match, if so you will return into webpages IP form database.

    Your code above is not much useful at this topic.

    Btw1: at "my" manual I have this chapter:

    How to determine device IP address
    IP address of device in Client mode can be obtained from DHCP server or can be set manually static IP. IP address at Access point mode is not configurable by end-user and is set to 192.168.3.1. IP address of device regardless selected mode can be determined by multiple ways.
    • IP address is shown on the device LCD display after short press of MODE button. When IP address is show as 0.0.0.0 it means IP address is not assigned. Either device is not connected into WiFi network or WiFi sensor was not able obtain IP address from DHCP server.
    • IP address can be discovered by search option at software COMET Vision or software TSensor. This software is free for download at manufacturer webpages.
    • Local IP address of WiFi sensor can be shown at COMET Cloud or COMET Database. To be able to utilize this feature, WiFi sensor needs to be connected to that platform.
    • Web interface of the infrastructure access point / router can show IP address when device is at Client mode and DHCP is used. This may to vary according to model of access point / router.

    Btw2: this is example of device running at CC3220SF.

    Jan

  • If I want to send data with UDP, that is, with the 2nd method you suggest, what kind of changes will I need to make in the CC3235SF software. 

  • Hi,

    You need to run UDP server at CC32xx. Unfortunately there is no example of UDP server at CC32xx SDK and I cannot provide you my code. But at Internet you can find examples how to run BSD UDP server.

    • You need to create UDP socket sl_Socket(SL_AF_INET, SL_SOCK_DGRAM, SL_IPPROTO_UDP);
    • Bind with port using API sl_Bind()
    • Read incoming data from socket by sl_RecvFrom() and when packet have right structure send back using sl_SendTo() API

    Jan

  • For example, do you think it makes sense to use UDP in an application where I want 4 devices to print data to a server. 

  • Hi,

    Selection between UDP or TCP for communication with server depends on application need.

    Selection of UDP protocol make sense for time sensitive communication where a small packet loss is not a issue like a audio or video streaming. Other advantage of UDP is capability to send broadcast. That means you send one packet which can be received by multiple clients (e.g. multi nodes communication or synchronisation). Last thing is that UDP can achieve higher performance (throughput) than TCP. But for example if you want to communicate with server outside your local network (e.g. at Cloud), it is better to use TCP (or protocol above TCP like HTTP(s)) for better reliability.

    Do not forget that CC32xx supports up to 16 sockets at same moment. That means you can create code which can serve multiple protocols at same moment. E.g. UDP broadcast for Find Device, communication with your Cloud server via HTTPs, TCP for local communication,...

    At answer above IS described only "software" options how to determine IP address. But you can youse hardware options like showing IP address LCD display, or using other wireless communication like BLE or NFC. Especially NFC can be good and cheap option for settings of device and provisioning if you have enough space for NFC antenna inside device. For example NFC EEPROM from STM costs sub $1.

    Jan

  • Well, I will have a question for you. the device does not receive a port address other than port address 80. does the device only work on port address 80 or can I give the address I want? 

  • Hi,

    You can use "almost" any TCP/UPD port. Port cannot be occupied by NWP (WiFi coprocessor), e.g. when NWP webserver is used you cannot open TCP port 80 inside your code. Or when module is at AP mode and internal DNS server is enabled, you cannot open inside your code UDP port 53. Here I talk about listening port inside device (when CC32xx acts as server) not a client (remote) port.

    btw ... When you say word "address" it generally means IP address. Port is just called "port" or "UDP port"/"TCP port".

    Jan

  • First of all, thank you for your answers, it is instructive.
    What I want to ask you is in my case can I change the port number for STA mode in the WIFI-HTTP code. Is this possible? static int32_t ConfigureHttpServer()
    {
    int32_t retVal = 0;
    uint16_t primaryPortNumber = 80; // The primary port number you want to set
    uint16_t secondaryPortNumber = 8081; // You can also set the secondary port number if needed

    // Stop HTTP server
    retVal = sl_NetAppStop(SL_NETAPP_HTTP_SERVER_ID);
    Display_printf(display, 0, 0, “[Http server task] HTTP Server Stopped”);

    // Set HTTP primary port number
    retVal = sl_NetAppSet(SL_NETAPP_HTTP_SERVER_ID, SL_NETAPP_HTTP_PRIMARY_PORT_NUMBER, sizeof(primaryPortNumber), (uint8_t *)&primaryPortNumber);
    if(retVal < 0)
    {
    Display_printf(display, 0, 0, “[Http server task] Failed to set HTTP primary port. Error: %d”, retVal);
    return retVal; // Exit if error occurs
    }
    Display_printf(display, 0, 0, “[Http server task] HTTP Primary Port set to %d”, primaryPortNumber);

    // If you also want to set the secondary port, you can add this part
    retVal = sl_NetAppSet(SL_NETAPP_HTTP_SERVER_ID, SL_NETAPP_HTTP_SECONDARY_PORT_NUMBER, sizeof(secondaryPortNumber), (uint8_t *)&secondaryPortNumber);
    if(retVal < 0)
    {
    Display_printf(display, 0, 0, “[Http server task] Failed to set HTTP secondary port. Error: %d”, retVal);
    return retVal; // Exit if error occurs
    }
    Display_printf(display, 0, 0, “[Http server task] HTTP Secondary Port set to %d”, secondaryPortNumber);

    // Restart the HTTP server
    retVal = sl_NetAppStart(SL_NETAPP_HTTP_SERVER_ID);
    Display_printf(display, 0, 0, “[Http server task] HTTP Server Re-started, retVal=%d”, retVal);

    return retVal;
    } I wrote a code like this, does it make sense?

  • Hi,

    Yes, that code looks reasonable for settings NWP http server port. Maybe you don't need to set secondary port which is used for HTTPs server. HTTP server use port 80 by default, you don't need to change them for using port 80.

    Jan

  • I make the one that says 80 84 and I make my other device 82. I give the same ip address to two devices. I wrote a code in visual studio to get data from these two devices, but it only gets one of them. 

  • Hi,

    I am not sure whether I understood correctly.

    You have two devices CC3325 at STA mode connected at same moment into same network (WLAN). You have set same static address for both CC3325 devices. Is this statement correct?

    I am slightly "scared" from your answer.

    Jan

  • Yes, I gave the same static ip address. I made the port numbers different. I am trying to get data from these two devices with my visual studio code. Is this not possible? 

  • Hi,

    You cannot have two devices at same network with same IP address. When you set static IP address it needs to be set according LAN (proper subnet range, etc.). That means you cannot "hardcode" static IP address into your product and static address need to be set by end-user of your product (or use DHCP).

    I am almost "shocked" that you try to use same IP address at multiple devices. This is pretty basic knowledge how IP networks works. And anybody who try to develop network device must this know without any exception.

    Jan

  • I am asking you if such a thing is possible, is that a question?   Can't we read devices with the same ip address over different port numbers. Like giving id; 

  • Hi,

    IP address needs to be always unique at same subnet. This is reason why exist DHCP to simplify assigning IP addresses inside network. Port allow run multiple services at same device at same moment, but it cannot distinguish between multiple devices at network.

    Jan

  • It was a very explanatory information, thank you. Finally, I want to tell you about the application I am trying to make.

    I want to connect my 4 cc3235sf devices to the same Access Point network in STA mode. Then I want to write a visual studio code. This visual studio code will receive and display data from these 4 devices.
    For this, I am using the infrastructure of the WIFI-HTTP code. Which method I try over this WIFI-HTTP code for this project will be the easiest and most useful method.

    I know you mentioned MDNS and UDP.
    However, I am a beginner in this regard and I need to finish the project quickly.
    Can you tell me the method and method I need to follow in the simplest way?

    Thank you.

  • Hi,

    If you want to use HTTP server at CC32xx and HTTP client at your PC there is no other option than set IP address into your PC application. You can set IP manually (e.g. by showing IP at your infrastructure router/DHCP server). Other option can be use mDNS, your own discovery protocol or just send http request to "all" devices at network and try to find your devices (network administrators will not be happy from such approach).

    Why you need to use CC32xx as server? Why you not use CC32xx as client and not sent values to local server or server at internet? Local server address may to be configurable during provisioning. In case of server at internet will be used, DNS address for this server can be hardcoded inside your CC32xx code.

    What you are describing looks for a some kind of school project.

    Jan

  • “Why you need to use CC32xx as server? Why you not use CC32xx as client and not sent values to local server or server at internet? Local server address may to be configurable during provisioning. In case of server at internet will be used, DNS address for this server can be hardcoded inside your CC32xx code.”

    In fact, if the user does not have to enter any ip address to get the data when you say this, this also works for me.

    What are the steps how to do this.

  • Hi,

    For example you can create your own server code (using PHP, .NET, etc.) public them into Internet server. CC32xx can send via TI HTTP client library data to this server. Inside CC32xx SDK you can find HTTP GET demo. You can adapt this demo and change GET to POST with data content. Documentation for this library you can find at SDK \ docs\ns\NS_API_Reference.html.

    Jan

  • Hello; When I examine the ready HTTP-GET example, it seems to communicate with example.com. with http get request. but it did not work in this code. Error! code = -30 error on serial port.   

  • Hi,

    I am not sure what is source of your error code -30. HTTP library should return error codes like -3001, -3002, etc. You should to use debugger to determine what is going on.

    Jan

  • Thank you very much for your answers but I still don't understand which method I should use. you talk about many options and possibilities but I don't understand. my only request is that you give clearer answers. of course you don't have to.

    In my system there will be 100 cc3235sf connected to the same acces pointer. Since there is no lcd etc. on the devices or there is no serial port, the user will not be able to see the ip addresses received by the devices.

    The user wants to write a windows form app. it will display the data received from 100 devices by receiving rssi values from 100 devices. I don't know how to do this because he won't know the ip address. mDNS requires additional applications for windows so we can't use it. Can you explain to me the best method I should do and what I should do in this matter.

    As I said, you don't have to do this, but I would be very grateful to you if you do.

  • Hi,

    Why you not implement mDNS into your Windows application? If you will be able to this, you will be able stay with system as you designed. Only difference will be send mDNS to discovery devices at network.

    Jan

  • In my research I found that in order to use mdns on windows I have to install a software like Bonjour. users will not accept such a thing. 

  • Hi,

    I think it using 3rd party app is not needed. You can use some .net library with mDNS support. Usage for 3rd party application can be useful during development but after that you will have properly enabled mDNS at CC32xx side, you can implement mDNS into your Windows application.

    Jan

  • I will integrate mdns into my existing wifi -http code. Then they will communicate with my visual studio code in this way.  

  • Hi,

    Implementation of mDNS into CC32xx is about enabling mDNS service. mDNS is described at SWRU455.

    You will use mDNS to find IP addresses of your devices at network after that you will be able read values from CC32xx webserver form your Windows client application.

    Jan

  • There are code blocks related to mdns in the document you sent, but I don't know how to adapt them to my own code. is there a resource I can use for this? 

  • Hi,

    You should add mDNS enable code somewhere into your initialisation code, code where NWP is enabled.

    btw ... at this forum you can find many threads related to mDNS at CC3220 and CC3235.

    Jan


  • #define SERVICE_NAME "_wifi_scan._tcp.local" // mDNS service name
    #define MAX_SCAN_SIZE 200 // Maximum Wi-Fi scan entries
    #define MAX_MDNS_TEXT_LENGTH 256 // Maximum mDNS text length

    SlWlanNetworkEntry_t previousEntries[MAX_SCAN_SIZE];
    int previousEntryCount = 0;

    void updateMdnsService(const char *mdnsText) {
    int32_t status;
    const uint16_t portNumber = 8080; // Port for HTTP access (if needed)
    const uint32_t TTL = 120; // Time to live (seconds)
    uint32_t options = SL_NETAPP_MDNS_OPTIONS_IS_NOT_PERSISTENT | SL_NETAPP_MDNS_IPV4_ONLY_SERVICE;

    // Update mDNS service text dynamically
    status = sl_NetAppMDNSRegisterService((const signed char *)SERVICE_NAME, strlen(SERVICE_NAME),
    (const signed char *)mdnsText, strlen(mdnsText),
    portNumber, TTL, options);
    if (status != 0) {
    Display_printf(display, 0, 0, "[mDNS] Failed to update mDNS service: %d", status);
    } else {
    Display_printf(display, 0, 0, "[mDNS] Service updated with Wi-Fi scan data.");
    }
    }

    #define MAX_SCAN_SIZE 200 // Tahmini en fazla Wi-Fi ağı sayısı
    int32_t wifiGetCallback(uint8_t requestIdx, uint8_t *argcCallback, uint8_t **argvCallback, SlNetAppRequest_t *netAppRequest) {
    SlWlanNetworkEntry_t *currentEntries = NULL;
    int32_t status;
    char *payload = NULL;
    char *pPayload = NULL;
    int entryCount = 0;
    char mdnsText[MAX_MDNS_TEXT_LENGTH]; // Buffer to hold mDNS text data
    char *pMdnsText = mdnsText;

    // Clear the buffer for mDNS text
    memset(mdnsText, 0, MAX_MDNS_TEXT_LENGTH);

    // Dynamic memory allocation for current entries
    currentEntries = (SlWlanNetworkEntry_t *)malloc(MAX_SCAN_SIZE * sizeof(SlWlanNetworkEntry_t));
    if (!currentEntries) {
    // Memory allocation failed, send error message
    payload = (char *)malloc(50 * sizeof(char)); // Allocate for error message
    if (payload) {
    sl_Memcpy(payload, "Memory allocation failed", 25);
    sl_NetAppSend(netAppRequest->Handle, strlen(payload), (unsigned char *)payload, 0);
    free(payload);
    }
    return -1;
    }

    // Get the list of Wi-Fi networks
    status = sl_WlanGetNetworkList(0, MAX_SCAN_SIZE, currentEntries);
    if (status < 0) {
    // Prepare error response for Wi-Fi scan failure
    payload = (char *)malloc(50 * sizeof(char)); // Allocate for error message
    if (payload) {
    sl_Memcpy(payload, "Error during Wi-Fi scan", 24);
    sl_NetAppSend(netAppRequest->Handle, strlen(payload), (unsigned char *)payload, 0);
    free(payload);
    }
    sl_Memcpy(mdnsText, "Error during Wi-Fi scan", 24); // Also send mDNS error
    } else {
    // Determine the number of found entries
    entryCount = status;

    // Dynamic memory allocation for payload to send via HTTP
    payload = (char *)malloc(2048 * sizeof(char)); // Adjust size as needed
    if (!payload) {
    // Memory allocation failed, send error message
    sl_Memcpy(payload, "Memory allocation failed", 25);
    sl_NetAppSend(netAppRequest->Handle, strlen(payload), (unsigned char *)payload, 0);
    free(currentEntries);
    return -1;
    }

    memset(payload, 0, 2048); // Clear the payload buffer
    pPayload = payload;

    // Sort current entries by RSSI
    qsort(currentEntries, entryCount, sizeof(SlWlanNetworkEntry_t), compareRSSI);

    // Prepare payload for current scan networks
    for (int i = 0; i < entryCount; i++) {
    SlWlanNetworkEntry_t *ap = &currentEntries[i];

    // Check SSID, assign "NULL" if empty
    char *ssid = (strlen((char *)ap->Ssid) > 0) ? (char *)ap->Ssid : "NULL";

    // Check BSSID, assign "NULL" if not available
    char bssid[18];
    if (ap->Bssid[0] == 0 && ap->Bssid[1] == 0 && ap->Bssid[2] == 0 &&
    ap->Bssid[3] == 0 && ap->Bssid[4] == 0 && ap->Bssid[5] == 0) {
    sprintf(bssid, "NULL");
    } else {
    sprintf(bssid, "%02x:%02x:%02x:%02x:%02x:%02x",
    ap->Bssid[0], ap->Bssid[1], ap->Bssid[2],
    ap->Bssid[3], ap->Bssid[4], ap->Bssid[5]);
    }

    // RSSI check
    char rssi[5];
    sprintf(rssi, "%d", ap->Rssi);

    // Channel check
    char channel[5];
    sprintf(channel, "%d", ap->Channel);

    // Format the payload for HTTP response
    pPayload += sprintf(pPayload, "| %s | %s | %s | %s |\n", ssid, bssid, rssi, channel);

    // Print to debug console
    Display_printf(display, 0, 0, "| %s | %s | %s | %s |\n", ssid, bssid, rssi, channel);

    // Add to mDNS text for top 3 networks
    if (i < 3) {
    char entryText[80];
    snprintf(entryText, sizeof(entryText), "SSID=%s;RSSI=%d;CH=%d|",
    strlen((char *)ap->Ssid) > 0 ? (char *)ap->Ssid : "Unknown",
    ap->Rssi, ap->Channel);
    strncat(pMdnsText, entryText, MAX_MDNS_TEXT_LENGTH - strlen(pMdnsText) - 1);
    }
    }

    // Terminate payload with NULL for HTTP response
    *pPayload = '\0';
    uint16_t metadataLen = prepareGetMetadata(0, strlen(payload), HttpContentTypeList_TextPlain);
    sl_NetAppSend(netAppRequest->Handle, metadataLen, gMetadataBuffer, SL_NETAPP_REQUEST_RESPONSE_FLAGS_CONTINUATION | SL_NETAPP_REQUEST_RESPONSE_FLAGS_METADATA);
    sl_NetAppSend(netAppRequest->Handle, strlen(payload), (unsigned char *)payload, 0);

    // Update the mDNS service with Wi-Fi scan results
    updateMdnsService(mdnsText);
    }

    // Free allocated memory
    free(currentEntries);
    free(payload);

    return 0;
    }

    #define MDNS_SERVICE_NAME "http" // Example service name
    #define MDNS_SERVICE_TYPE "_http._tcp.local" // Service type, e.g., HTTP
    #define MDNS_HOST_NAME "my_device"
    #define MDNS_SERVICE_PORT 80
    int32_t startMdnsService() {
    int32_t status;

    // Set the mDNS host name
    status = sl_NetAppSet(SL_NETAPP_DEVICE_ID, SL_NETAPP_DEVICE_URN, strlen(MDNS_HOST_NAME), (uint8_t *)MDNS_HOST_NAME);
    if (status < 0) {
    Display_printf(display, 0, 0, "[mDNS] Failed to set mDNS host name: %d", status);
    return status;
    }

    // Ensure mDNS service is stopped before re-registering
    status = sl_NetAppStop(SL_NETAPP_MDNS_ID);
    if (status < 0) {
    Display_printf(display, 0, 0, "[mDNS] Failed to stop previous mDNS service: %d", status);
    return status;
    }

    // Register the mDNS service
    status = sl_NetAppMDNSRegisterService((const signed char *)MDNS_SERVICE_TYPE,
    strlen(MDNS_SERVICE_TYPE),
    (const signed char *)MDNS_SERVICE_NAME,
    strlen(MDNS_SERVICE_NAME),
    MDNS_SERVICE_PORT, 0, 120); // TTL = 120 seconds
    if (status < 0) {
    Display_printf(display, 0, 0, "[mDNS] Failed to register mDNS service: %d", status);
    return status;
    }

    Display_printf(display, 0, 0, "[mDNS] mDNS service started successfully");
    return 0;

    I realized the mdns code in this way, but I still could not communicate via my_divece. Is there an error or missing in my mdns code? 

  • Hi,

    I am not able review such big code without debuting them. I don't have time do such things, and I even don't have ready development environment for debugging CC3235 with latest SDK and CCS. Debugging of your code will be up to you.

    But I don't see at your code above anywhere enabling mDNS service by sl_NetAppStart(SL_NETAPP_MDNS_ID);

    Jan

  • However, I have worked with many companies before. ST, NUVOTON, Microchip, when I tried to use their products, the company officials personally took care of me and helped me to get my project up and running. I expect this from TI, but only you are helping me. I expect help from TI officials but they ignore me.

    Thank you very much.

  • Hi,

    At first step you need to enable mDNS at your CC32xx and test with 3rd party mDNS app like a Bonjour browser. After that you can search for mDNS library for .NET and implement mDNS into you VS application.

    I don't think that TI engineers ignoring you. But you can't expect that they will write code for you or create for you exact step-step guide how it use their solution with your project. They will also expecting from end user some basic knowledge how computers networks works, same as I. I am working for 15 years as developer, and I never seen semiconductor company which will be able write code for me. This is same for TI, NXP, STM, ADI, ONSemi even I have friends between NXP and ONSemi employees (these companies have R&D and FAB at same 16k town) and we are not s small company in scope.

    Jan

  • So after doing this, will users who buy the devices need to install additional apps like Bonjour when they need to use their own systems to retrieve data? Most of the time users don't want to install additional apps for security reasons. 

  • Hi,

    You can implement support of mDNS into your application created at Visual Studio. There will not be needed use 3rd party application. But such 3rd party application can be useful at development stage of your project.

    Jan

  • I'm sorry I've been so tiring. I am learning what to do from an experienced person like you and I am grateful to you for this.

    Finally, I now need to determine a method and I am very undecided.

    1-) As I said, I will give 100 cc3235sf cards to the user and the user will receive data from these 100 cards with visual studio or other software. The user prefers to do this without using the ip address of the devices.
    According to this preference, is it enough for me to integrate mdns into my wifi-http code. then he can get the data by integrating mdns into visual studio or other software.

    2-) Thinking that you understand what I want to do, do you have a more functional way suggestion? If there is a way that you say I would do this, can you tell me that way.

    Finally, I want you to answer these 2 questions
    Thank you

  • Hi,

    You give 100 device to end user. At first stage will your customer need to provision device into their network (that means set SSID and password for their network into devices). When will be devices successfully connected to network, he can run PC application. This PC application will search for available device using mDNS and start reading data from them using HTTP GET.

    This approach should work properly. Maybe it will be better to set unique mDNS address for each device. This can be done during your production stage.

    There may to better way how implement such task, but I afraid that you will struggle with such approaches. Usage of HTTP server inside CC32xx together with mDNS seems to be reasonable approach for you.

    Jan

  • I have a new question for you. Now to the wifi network
    #define SSID_NAME “FiberHGW_ZTGT2P_5GHz”
    /* Security type (OPEN or WEP or WPA_WPA2) */
    #define SECURITY_TYPE SL_WLAN_SEC_TYPE_WPA_WPA2
    /* Password of the secured AP */
    #define SECURITY_KEY “bUDePdKrNb”

    I am connecting with this information. but there is only ssid and password. I want to connect with my customer with SSID, USER NAME AND PASSWORD. Is it possible to provide this. if possible, how can we do this.

  • Hi,

    If you are talking about to EAP security (WPA2-EAP, WPA3-EAP), that this security type is supported by CC3235. But CC3235 have limitation for TLS 1.0 for RADIUS authentication. To be able use EAP security, you need to have WiFi network supporting EAP security (e.g. RADIUS server). More details how to use EAP security you can find at SWRU455.

    But enabling EAP security may to be tricky (proper settings of networks, uploading certificates and CA file into CC32xx device). My recommendation for you according your previous questions. Do not try to use EAP security.

    Jan

  • In this way I want to connect to a network by entering ssid, password and username for WPA2-ENTREPRISE but the device does not connect to the network. the code is like this. what is the reason for this.   

    #define SSID_NAME "TLNYS"
    /* Security type (OPEN or WEP or WPA_WPA2) */
    #define SECURITY_TYPE SL_WLAN_SEC_TYPE_WPA_ENT
    /* Password of the secured AP */
    #define SECURITY_KEY "Mcr0C0ntr0llrS:)"
    #define USER_KEY "micro"

    SlWlanSecParams_t secParams = {0};
    SlWlanSecParamsExt_t secParamsExt = {0}; // WPA2-Enterprise için ek parametreler

    secParams.Key = (signed char *)SECURITY_KEY; // Şifre
    secParams.KeyLen = strlen(SECURITY_KEY);
    secParams.Type = SECURITY_TYPE;

    // Eğer WPA2-Enterprise (Kullanıcı adı ve şifre) kullanılıyorsa ayarları yap
    if (SECURITY_TYPE == SL_WLAN_SEC_TYPE_WPA_ENT)
    {
    secParamsExt.User = (signed char *)USER_KEY; // Kullanıcı adı
    secParamsExt.UserLen = strlen(USER_KEY);
    secParamsExt.AnonUser = NULL; // Anonim kullanıcı yoksa boş bırakılabilir
    secParamsExt.AnonUserLen = 0;
    secParamsExt.EapMethod = SL_WLAN_ENT_EAP_METHOD_PEAP0_MSCHAPv2; // EAP yöntemi PEAP/MSCHAPv2
    }

    retc = Network_IF_ConnectAP(SSID_NAME, secParams, &secParamsExt);
    if (retc < 0)
    {
    Display_printf(display, 0, 0, "[Http server task] Failed to connect to AP");
    while (1);

  • Hi,

    Hard to say what can be reason that you are not able connect using WPA2-EAP. For more details see log at RADIUS server.

    To be able connect using EAP mode PEAP0-MSCHAPv2 you need to have set proper time inside CC32xx and uploaded CA file inside sFlash or disabled server authentication against CA file (parameter set to 0, not a 1 as described at SWRU455). At RDIUS server side need to be properly configured user profiles and it need to be allowed usage of TLS 1.0 (this it important!), because CC32xx does not support TLS 1.1 and TLS 1.2 for EAP security.

    Jan

  • I went to a company and my computer connected directly to the company's acces point by entering the username and password.

    Therefore, I do not think that the company's internet has a security certificate.

    Later, when I wanted to connect my device, the device did not receive ip. I cannot try this on my own system because you are not a router that supports WPA2-ENTERPRISE.

  • Hi,

    CA need to be provided by administrator. Usage of PEAP0-MSCHAPv2 without CA file, does not make sense, because this will be a security risk.

    How do you want to debug EAP security if you don't have EAP (IEEE 802.1X) capable hardware? You need to have access point capable connect to RADIUS server. After that you can run FreeRADISU to your computer or Raspberry Pi. Proper configuration of FreeRADIUS server is not a easy task (installing FreeRADIUS at Linux machine, configuring list of users, proper configuration of EAP extension, generating certificates by OpenSSL, etc.).

    As I said at previous answer CC32xx support for EAP security TLS 1.0 only. And this may to be issue at deployment at many companies. Many big companies does not allow to use TLS 1.0 any more. Even FreeRADIUS 3.x does not support TLS 1.0 by default and need to be enabled at /mods-enabled/eap and option ls_min_version = "1.0".

    Jan

  • Well, if the company network does not support TLS 1.0, how will I have to find a solution. then I will not be able to use cc3235sf, should I switch to another module. 

  • It also says here that it supports TLS networks other than TLS 1.0.  

  • Hi,

    No. This is for sockets not for EAP. For EAP is supported TLS 1.0 only as I said.

    Jan

  • the network I want to use uses PEAP. does this r-case also have the problem 

  • Hi,

    Limitation for TLS 1.0 to EAP security is for all EAP methods. What I am not sure about CISCO FAST_* methods, but these are used rarely.

    If network use PEAP EAP method, but TLS 1.0 is not allowed, there is no way how to connect CC3235 into these network using EAP security and you can't do anything about this.

    Jan

1 2