1

I'm doing a project on ARM platform (Linux Kernel), where I need to code a firmware autoupdate task in C. In order to that, I need to download the manifest file from the FTP/HTTP server and from the manifest file, I'll have link to download the firmware package. I'm using libwebsockets to achieve this task as this is very light weight and has low memory footprint.

Please help me on HOW to download the files and upload the files (as a client) using the libwebsockets library? I have gone through the examples and source code repo to understand how this library works, but this is pretty confusing to fathom the flow and API. Please help me, folks.

Thank you all in advance.

Venky
  • 11
  • 2
  • 1
    Is libwebsocket even capable of HTTP beyond just the basic websocket handshake? – Sal Rahman Jul 24 '17 at 07:39
  • If not, then just stick to a generic HTTP client library. – Sal Rahman Jul 24 '17 at 07:39
  • @SalehenRahman yes, libwebsockets is capable of file transfers over HTTP clients – nj2237 Jul 24 '17 at 08:12
  • @Rahman I could handle the ping and bind with the HTTP server with the "libwebsockets", but i need to write the download and upload of files over http or FTP using libwebsocket. Yes, I was told that the HTTP file transfer is possible with libwebsockets. – Venky Jul 24 '17 at 08:29
  • @Learning Could you please help if there an API or example code for such functionality? – Venky Jul 24 '17 at 08:32
  • @Venky Refer to iamscottmoyers' git repo - https://github.com/iamscottmoyers/simple-libwebsockets-example, which has simplified serving a file and a client sending data to the server - I think this should help. – nj2237 Jul 24 '17 at 09:32
  • @learning Thank you very much. I'll refer to it right away. – Venky Jul 25 '17 at 10:03
  • 1
    Hi @learning ! The scott's code is a server serving the file download request from a client. But, in my case, I need to be a client. i have gone through the libwebsokcet API, but i didn't get an API to do that job. I have requested scottmoyers himself to help me with an idea, but no luck. Thank you very much for your insights and help. – Venky Jul 27 '17 at 03:13
  • I have checked and tried to use the code several examples and tried to modify the example for my application (provided by libwebsockets themselves), but no able to achieve the application. I'm always receiving some or the errors from the lws api. The documentation in the code and as well as on the API reference web page of theirs is very poor and not much informative. – Venky Jul 31 '17 at 09:29

0 Answers0