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
  • 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

  • Hi,

    "You could start by looking at the https_client sample and removing everything that you do not need."

    I'm new to Zephyr; if could do it on my own, there would be no need to post anything here.

    Thanks anyway, please close this case.

  • Hi,

    I am still looking to assist you. 

    I have started again with the project provided in the ticket linked in your initial post (http_post.zip). I was not able to build this sample project successfully. Does that sample build for you?

    Then I tried to build your project (8625.http_post.zip) which successfully built (with modification to CMakeLists.txt file) but there was nothing in the terminal after flashing. This seems to be the same result as you mentioned in your initial post, but you might have used http post.zip sample project. Do you get the same empty terminal when using 8625.http_post.zip sample project? 

    What are the differences between http_post.zip and 8625.http_post.zip? 

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

    This error comes from zephyr\include\zephyr\net\dns_resolve.h. It is system error

    /** System error returned in `errno' */
    	DNS_EAI_SYSTEM      = -11,

    Which sample did you use and how did you build it when you got error -11 which you mentioned in your initial post? Did you get any other error in addition to error -11?

    Best regards,
    Dejan

Related