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.

Socket communication in NDK while HTTP module still enabled!!



MCU: TM4C1294NCPDT

TI-RTOS: v2.01.00.03

NDK: v2.23.01.01

CCS: v6.0.1.0040

-

Hello,

 With reference to the Embedded Web Server project at  I would like to know whether it is possible to access raw socket & port while http section still exists in code. What I mean is that, is there any way by which I can disable the HTTP section of the NDK during run-time & use raw socket communication.

    For example, I want the Embedded HTTP Web Server thing being disabled & the Tiva C MCU should place TCP packets on the Ethernet network asking to connect to IP address 173.194.115.99 (port 80) & exchange data.

  How to achieve this? Is there any way of doing this?

-

Thanks

-

Regards

Soumyajit

  • Hi Soumyajit,

    Do you mean that you want to disable HTTP server and start a tcp server on your TivaC MCU at runtime on port 80? Or do you mean that you would like to connect to an external server from TivaC as a client?

    If by "connect to IP address" you mean to talk to external server, then I think you can just open a socket connection to the external server at port 80 without disabling your HTTP server. See NDK Programming guide for socket APIs: http://downloads.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ndk/2_23_01_01/exports/ndk_2_23_01_01/docs/spru524h.pdf

    Vikram
  • Hi Vikram,
    Thanks for your support. I meant to configure Tiva C MCU as a client & connect to some external server at IP address 173.194.115.99 (port 80) [port may be some other number also like 25 or 23]. Did you mean to say that the Tiva C MCU can run as HTTP server & a TCP client at the same time?
    In the meanwhile, I will go through the document spru524...
    -
    Thanks
    -
    Regards
    Soumyajit Das
  • I haven't given the usecase a try but I don't see why it can't be used as a server and client. By looking at some of the NDK example cfg files, I don't see any configuration that is specific to server or client.You can create another task that will create a new socket and connect to the address and port.

    Vikram
  • Hi Vikram,
    Thanks for your help. It worked, I tried HTTP GET & its able to upload data to the server. I will soon implement FTP & Email also.
    -
    Thanks
    -
    Regards
    Soumyajit Das