• TI Thinks Resolved

RTOS/DK-TM4C129X: Connect to cloud (https client ) - using proxy and tls

Expert 1255 points

Part Number: DK-TM4C129X

Tool/software: TI-RTOS

Hello,

I am using the base code as an example provided in ti rtos (though it is for another board) for establishing a https client on my target.

When the board it connected to ethernet, and i run the code, i get the error that host is not resolved.

To test, I tried to connect curl to my cloud server, and got the same error  host is not resolved. Then i set the proxy settings for curl and i am able to connect curl to cloud via proxy tunnel.

Now i want to do the same on my target, ie to set proxy. 

I am not able to find much documents or example on this. Can you please help, and guide me in the right direction. 

Thanks a lot

av

mcu : tm4c129xnczad

board: dk-tm4c129x

ide: ccs

  • In reply to a.v:

    Can you please share your code? I would like to try it on my set-up.

    I would like to see why your application in hanging on a semaphore. Also, I would make sure the ntp address is valid (use pool.ntp.org instead). 

    a.v

    AND 

    later code crashes at tls create.

    Are there any crash messages on the console? Can you check ROV (in CCS debug mode, select Tools > ROV)? Do you have sufficient heap (check BIOS.heapSize in your application cfg file)?

    Vikram

  • Expert 1255 points

    In reply to Vikram Adiga:

    Hi Vikram
    Yes , i can share my code, can i u suggest a way i can send it to you personally?
    Thanks a lot
    av
  • In reply to a.v:

    Preferred option is to send me an example project that can reproduce your issue. You can then attach the project here.

    The other option is to direct message me through e2e messages.

    Vikram
  • Expert 1255 points

    In reply to Vikram Adiga:

    Hi Vikram,

    This is the screenshot where it crashes. and also the serial output screen

    I will send the code as a private msg as soon as possible.

    Thanks a lot

    av

  • In reply to a.v:

    looks like you are hitting stack overflow. Make sure your task has enough stack size.

    Vikram

  • Expert 1255 points

    In reply to Vikram Adiga:

    Hi viikram,

    #define TCPHANDLERSTACK 2048

    #define HTTPTASKSTACKSIZE 8192

    i have provided enough space, but still this occurs..

    i will send my code

    thanks

    av

  • In reply to a.v:

    The stack needed for woflSSL is much bigger than 8K. Please refer the httpsget example.

    Vikram
  • Expert 1255 points

    In reply to Vikram Adiga:

    Hi Vikram

    I have taken the https get example for ek- tm4c129exl and converted it for my board dk-tm4c129x...the code is untouched except for the addition of the certificate. But i get the error as follows:

    this is the code

    httpsget_EK_TM4C129EXL_TI_TivaTM4C129ENCPDT.rar

    i am behind a proxy, so when i made the http client code for my board i had added proxy

    as such, and this was connecting to the website and doing get and post perfectly:

    struct sockaddr_in paddr;
    paddr.sin_family = AF_INET;
    paddr.sin_port = htons(PROXY_PORT);
    paddr.sin_addr.s_addr=inet_addr1(PROXY_IP);
    HTTPCli_setProxy((struct sockaddr *)&paddr);

    struct addrinfo hints;
    struct addrinfo *addrs;
    memset(&hints, 0, sizeof(struct addrinfo));
    hints.ai_family = AF_INET;
    ret = getaddrinfo(HOSTNAME, "0", &hints, &addrs);
    if (ret != 0)
    {
    // return (HTTPCli_EHOSTNAME);
    }
    *((struct sockaddr *)&addr) = *(addrs->ai_addr);
    addr.sin_port = htons(HOST_PORT);

    do i need to add proxy setting for stnp function as well

    please guide

    thanks

    av

  • In reply to a.v:

    a.v

    struct addrinfo hints;
    struct addrinfo *addrs;
    memset(&hints, 0, sizeof(struct addrinfo));
    hints.ai_family = AF_INET;
    ret = getaddrinfo(HOSTNAME, "0", &hints, &addrs);
    if (ret != 0)
    {
    // return (HTTPCli_EHOSTNAME);
    }
    *((struct sockaddr *)&addr) = *(addrs->ai_addr);
    addr.sin_port = htons(HOST_PORT);

    do i need to add proxy setting for stnp function as well

    We don't have proxy support in our SNTP module and as far as I know the NTP servers in a proxy/firewall based networks are local. You may have to check with your IT team to find the address of the local NTP server. Using the local NTP server should resolve the issue.

    Vikram

  • Expert 1255 points

    In reply to Vikram Adiga:

    Hi Vikram

    it seems i havent got much support from the IT team regarding the ntp server address.

    But for the time being as a work around is there a way to set the device time manually as in the cc3200 device:

    ex in cc3200 we had this option:

    SlDateTime_t dt;
    dt.sl_tm_day = 6;
    dt.sl_tm_mon = 1;
    dt.sl_tm_year =2017;
    dt.sl_tm_hour = 12;
    dt.sl_tm_min = 34;
    dt.sl_tm_sec = 45;
    sl_DevSet(SL_DEVICE_GENERAL_CONFIGURATION,
    SL_DEVICE_GENERAL_CONFIGURATION_DATE_TIME,
    sizeof(SlDateTime_t), (unsigned char *)(&dt));

    Is there a way to set device time manually for this board?

    Thanks 

    av