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.

RTOS/TM4C1294NCPDT: HTTP API handler over Ethernet

Part Number: TM4C1294NCPDT


Tool/software: TI-RTOS

Hello,

I am developing an application using TM4C1294NCPDT and TI-RTOS, where the application requires to connect to the internet over ethernet as well as receive HTTP commands. This command will be used for configuring device features ( like enable the feature, disable the feature, GET settings, SET settings, etc).

As per my knowledge, the HTTP API parsing can be done in two ways,

1. Hosting a web server on a device itself and present a web-based user interface, so the user can configure device settings, OR

2. Host a web server remotely  (like a cloud or some other  Computer) and create an HTTP client on the controller device so HTTP APIs can be used and parsed to get configuration settings.

for the second option, a dedicated Server needs to maintain on remote system or cloud, which I don't want to use.

I was looking more into the first option, that is maintaining a lightweight web server on the device itself.

My application requires to store these configuration setting into non-volatile memory (onboard Flash), Thus there will be a memory crunch.

please guide me here for the suitable option or options available.

  • Hello Yogesh,

    I am going to pass this question to our Ethernet expert but he may not be able to reply until Monday.

  • Hi,

      If you want to host a webserver on the device then you can reference this link for a HTTP server example below. I hope this example will help you start.

      To store data in a non-volatile memory you can use the on-chip EEprom. You can find the below snippet of code in the TivaWare Peripheral Driver library user's guide. 

    uint32_t ui32EEPROMInit;
    uint32_t pui32Data[2];
    uint32_t pui32Read[2];
    //
    // Enable the EEPROM module.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_EEPROM0);
    //
    // Wait for the EEPROM module to be ready.
    //
    while(!SysCtlPeripheralReady(SYSCTL_PERIPH_EEPROM0))
    {
    }
    //
    // Wait for the EEPROM Initialization to complete
    //
    ui32EEPROMInit = EEPROMInit();
    //
    // Check if the EEPROM Initialization returned an error
    // and inform the application
    //
    if(ui32EEPROMInit != EEPROM_INIT_OK)
    {
    while(1)
    {
    }
    }
    //
    // Program some data into the EEPROM at address 0x400.
    //
    pui32Data[0] = 0x12345678;
    pui32Data[1] = 0x56789abc;
    EEPROMProgram(pui32Data, 0x400, sizeof(pui32Data));
    //
    // Read it back.
    //
    EEPROMRead(pui32Read, 0x400, sizeof(pui32Read));