Help with http post to private server

Hi!

I'm attempting to run the application from this URL, but nothing appears on the serial console, and I don't see any posts on the toilet website.

Could you help me with this? I've spent too many months on http_client and https_client with no results.

My set up:
Updated Windows 11 64-bit.
Board: DK nRF9151.
SDK: 2.8.0

I don't know why there is no output on serial terminal, but I debugged the app and there is an error at row # 87 with code:

int err = getaddrinfo(HTTP_HOST, NULL, NULL, &res);
I got error -11

I included application files and a build-log in the zip file.

Please help!
With kind regards


4705.http post.zip

Parents Reply Children
  • Hi Dejan,

    last time, I sent you the build log in the zip file to confirm that it was successfully built; this time, I successfully built the app again, and I am providing you with the application code, the build log, images showing the problem tab, and the terminal tabs used when programming.

    I was able to debug the application, identify the row number where the error occurred, and obtain the error number.

    Also, I've included a link to an application that one of your coworkers upload to this forum, so you may download it and build it your own.

    What challenge did you encounter when building the application? Maybe I can help you, even though you are thousands of times more capable of fixing it than I am. Also, maybe you can use the hex file in the build folder.

    I've spent more than a year attempting to adapt https_client or http_client apps to send a text message to a private server by http post; at first, I bought a Sparkfun board, but after 10 or 11 months of fails, I gave up and bought a Nordic board,but, with little progress since.

    I am not even making a application of my own, just trying to make an Nordic sample work in a private server.

    Please help me!

    With kind regards

    8625.http post.zip

  • Hi Dejans!

    I am waiting for your response, please!

  • Hello, Dejans.
    commented the "app_http_start()" call, and the serial terminal is attached as log file.

    With kind regards

    ..[m
    .[1;32muart:~$ .[m.[8D.[J.[1;31m.[1;31m--- 25 messages dropped ---
    .[0m.[m[00:00:00.412,109] .[0m<dbg> os: z_impl_k_mutex_unlock: new owner of mutex 0x2000cfb4: (nil) (prio: -1000).[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.412,139] .[0m<dbg> net_route: net_route_init: (main): Allocated 8 routing entries (544 bytes).[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.412,170] .[0m<dbg> net_route: net_route_init: (main): Allocated 8 nexthop entries (192 bytes).[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.412,231] .[0m<dbg> net_core: l3_init: (main): Network L3 init done.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.412,261] .[0m<dbg> net_if: net_if_init: (main): .[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.412,292] .[0m<dbg> os: z_impl_k_mutex_lock: 0x2000de68 took mutex 0x2000cfa0, count: 1, orig prio: 0.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.412,353] .[0m<dbg> net_tc: net_tc_tx_init: (main): No TX thread created.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.412,384] .[0m<dbg> net_if: init_iface: (main): On iface 0x2000d0bc.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.412,506] .[0m<dbg> net_if: net_if_ipv6_calc_reachable_time: (main): min_reachable:15000 max_reachable:45000.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.412,536] .[0m<dbg> os: z_impl_k_mutex_lock: 0x2000de68 took mutex 0x2000cff0, count: 1, orig prio: 0.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.412,994] .[0m<dbg> os: z_impl_k_mutex_unlock: mutex 0x2000cff0 lock_count: 1.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.413,024] .[0m<dbg> os: z_impl_k_mutex_unlock: new owner of mutex 0x2000cff0: (nil) (prio: -1000).[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.413,055] .[0m<dbg> os: z_impl_k_mutex_unlock: mutex 0x2000cfa0 lock_count: 1.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.413,085] .[0m<dbg> os: z_impl_k_mutex_unlock: new owner of mutex 0x2000cfa0: (nil) (prio: -1000).[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.413,146] .[0m<dbg> net_tc: net_tc_rx_init: (main): [0] Starting RX handler 0x2000db38 stack size 1504 prio 15 coop(-1).[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.413,177] .[0m<dbg> os: setup_thread_stack: stack 0x200102d0 for thread 0x2000db38: obj_size=1504 buf_start=0x200102d0  buf_size 1504 stack_ptr=0x200108b0.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.413,452] .[0m<dbg> net_if: net_if_post_init: (main): .[0m
    .[1;32muart:~$ .[m.[8D.[J*** Booting nRF Connect SDK v2.8.0-a2386bfc8401 ***
    .[1;32muart:~$ .[m.[8D.[J*** Using Zephyr OS v3.7.99-0bc3393fb112 ***
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.413,574] .[0m<dbg> os: setup_thread_stack: stack 0x200109b0 for thread 0x2000dca8: obj_size=1024 buf_start=0x200109b0  buf_size 1024 stack_ptr=0x20010db0.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.413,726] .[0m<dbg> os: k_sched_unlock: scheduler unlocked (0x2000de68:0).[0m
    .[1;32muart:~$ .[m.[8D.[JStarting http post....[1;32muart:~$ .[m.[8D.[J[00:00:00.413,940] .[0m<dbg> os: z_impl_k_mutex_lock: 0x2000d628 took mutex 0x2000e528, count: 1, orig prio: 14.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.414,764] .[0m<dbg> os: z_impl_k_mutex_unlock: mutex 0x2000e528 lock_count: 1.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.414,794] .[0m<dbg> os: z_impl_k_mutex_unlock: new owner of mutex 0x2000e528: (nil) (prio: -1000).[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.414,825] .[0m<dbg> os: z_impl_k_mutex_lock: 0x2000d628 took mutex 0x2000e528, count: 1, orig prio: 14.[0m
    .[1;32muart:~$ .[m.[8D.[J.[1;32muart:~$ .[m.[8D.[J.[1;32muart:~$ .[m.[8D.[J[00:00:00.717,315] .[0m<dbg> os: z_impl_k_mutex_unlock: mutex 0x2000e528 lock_count: 1.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.717,346] .[0m<dbg> os: z_impl_k_mutex_unlock: new owner of mutex 0x2000e528: (nil) (prio: -1000).[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.717,376] .[0m<dbg> os: z_impl_k_mutex_lock: 0x2000d628 took mutex 0x2000e528, count: 1, orig prio: 14.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.719,512] .[0m<dbg> os: z_impl_k_mutex_unlock: mutex 0x2000e528 lock_count: 1.[0m
    .[1;32muart:~$ .[m.[8D.[J[00:00:00.719,512] .[0m<dbg> os: z_impl_k_mutex_unlock: new owner of mutex 0x2000e528: (nil) (prio: -10

  • Hi,

    I have built your application successfully by modifying your CMakeLists.txt file. However, the application did not even enter main(). I recommend that you start from the working sample. In your case, you could start by looking at https_client sample and removing everything that you do not need.

    Best regards,
    Dejan

Related