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.

CCS/TMS320F28388D: Add websocket server on web server example

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE, CC3200

Tool/software: Code Composer Studio

Hi everybody,

I can run the enet_lwip example given with c2000Ware and I also can replace the given HTML page with my own HTML page.

I have to add a websocket server with this web server to communicate between device and PC with a good speed. I found an example using Minnow Server but I don't how to implement it on my web server. I also found an example made by TI but for CC3200 devices, a lot of things are not the same.

Is there somewhere an example of websocket server made by TI and for c2000 devices ?

Thanks for your help !

  • Hi,

    One of our experts will get back to you on this.

  • Hi,

    We do not have a socket implementation/example with C2000 Devices. 

    Regards,

    Sudharsanan

  • Ok what is the best solution for me ? I can try to adapt the CC3200 example for my device but I don't if I can use the same libraries.

    I see that there is a lot if files about http in CC3200 project, like HttpCore, Http Debug, HttpSocket, etc. Can I use these files with my project based on C2000 MCU ? If yes, how to use these files with C2000Ware web server example ?

  • Hi,

    You can refer to the CC3200 example but note that the device level port libraries will not be the same.

    Regards,

    Yashwant

  • Hi, 

    After lots of research, I decided to do my own websocket library. 

    First thing I try to do is using sockets.h and sockets.c included in c2000ware. I see in sockets.h that LWIP_SOCKET variable must be defined in lwipopts.h. When i set this variable to 1 in lwipopts.h and try to build without other changes, I have a lot of errors in api_msg and api_lib files (some errors below).

    Could you help me about these errors ?

    Thanks,

    Nathan

  • We are looking into it and will get back to you.

  • OK so I finally was able to write my websocket library. The fact is that I don't need sockets.c and sockets.h files. 

    Now, I have my websocket file in the enet_lwip project and I use it without the original webserver. I run the websocket server on the board, run a client wrote in C# on my PC and I can communicate without problem.

    My aim is to implement this websocket server with the original web server. I just want to store the client side on the board and send it when I enter the server IP adress in my web browser (exactly the same operation as the web server but with websockets in addition).

    My problem is that I don't know exactly how tu run this 2 parts (web server and websockets server) in my main code. In main() I run web server with httpd_init() and just after that I run websocket server with ws_init (the fonction listen for hanndshake and accept connection). But, when I run this programm and enter IP adress in my broser, nothing appears. I think that the board doesn't send the files for html page.

    I don't know if my way to do is good. Maybe you have a better solution ?

    Thanks for your help !