I am using pico with W5500. There is a library for it here: GitHub-RP2040 but unfortunately there is no HTTP Client library ( I tried some examples and library is working). I need to use http client for http request to server so I decided to add myself. I found this github-W5X00. I didn't try it before but I think I need to add httpClient.c, httpClient.h and main.c to first link. Then maybe I can do http request with it.
I added httpClient.c and httpClient.h like this : photo and I added main.c like this: photo2.
When I try to use cmake .. (I am using Mac, its the same with MinGW or something) in build, it gives
CMake Error at examples/http_client/CMakeLists.txt:3 (add_executable):
Cannot find source file:
/Users/User/Desktop/RP2040/RP2040-HAT-C/libraries/ioLibrary_Driver/Internet/HTTPClient/httpClient.c
and
CMake Error at libraries/CMakeLists.txt:136 (add_library):
Cannot find source file:
/Users/User/Desktop/RP2040/RP2040-HAT-C/libraries/ioLibrary_Driver/Internet/HTTPClient/httpClient.c
CMake Error at libraries/CMakeLists.txt:136 (add_library):
No SOURCES given to target: HTTPCLIENT_FILES
error even files exist. Then my libraries/ioLibrary_Driver/internet/HTTPClient files are being delete. I try to write CMakeLists.txt by looking other examples (ftp,http,mqt,sntp etc.)
First errors CMakeLists.txt :
set(TARGET_NAME w5x00_http_client)
add_executable(${TARGET_NAME}
${TARGET_NAME}.c
)
target_link_libraries(${TARGET_NAME} PRIVATE
pico_stdlib
hardware_spi
hardware_dma
ETHERNET_FILES
IOLIBRARY_FILES
DHCP_FILES
DNS_FILES
HTTPCLIENT_FILES
TIMER_FILES
)
pico_enable_stdio_usb(${TARGET_NAME} 1)
pico_enable_stdio_uart(${TARGET_NAME} 0)
pico_add_extra_outputs(${TARGET_NAME})
Second errors CMakeLists.txt (it is too long I only (150 line so I am sending only what I add ) :
# HTTP Client
add_library(HTTPCLIENT_FILES STATIC)
target_sources(HTTPCLIENT_FILES PUBLIC
${WIZNET_DIR}/Internet/HTTPClient/httpClient.c
)
target_include_directories(HTTPCLIENT_FILES PUBLIC
${WIZNET_DIR}/Ethernet
${WIZNET_DIR}/Internet/HTTPClient
)
So I didn't understand what is the problem. I try to add these files like they do. Why it is not working ?
Or It just http client files can't work like this?