AT+HTTPCPOST

JerryFrag
Posts: 6
Joined: Mon May 09, 2022 8:20 pm

AT+HTTPCPOST

Postby JerryFrag » Mon May 09, 2022 8:56 pm

Hi,

I'm using an ESP32-WROOM 32E. This device is connected to another chip and the ESP is being used only for WiF, and is being configured and commanded over a UART. I am having trouble getting AT+HTTPCPOST to work.

To test, I used:
AT+HTTPCPOST="http://httpbin.org/post",65,1,"content-type: application/json"
And for data I used:
{"alertCode" : "alertid","timestamp": "2022-02-09T21:58:08.674Z"}

This works fine.

When I try to do the same with a server I'm working with:
AT+HTTPCPOST="https:...",65,2,"Authorization: ***","Content-type: application/json"

I receive as a reply 'alertCode is required' which I take to mean that the JSON data is not being transmitted.

Do you have any examples of actual JSON data being used?

Thank you.

JerryFrag
Posts: 6
Joined: Mon May 09, 2022 8:20 pm

Re: AT+HTTPCPOST

Postby JerryFrag » Tue May 10, 2022 2:18 pm

Just a quick update:

When using AT+HTTPCLIENT I formatted the JSON data correctly and the command returned OK.

I used the exact same JSON data with this command and the same server replies that it needs the first data item.

Any thoughts?

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: AT+HTTPCPOST

Postby ESP_Sun » Fri May 13, 2022 4:08 am

Can you provide the specific steps you took to reproduce it? For example, AT commands sent along with version numbers and error logs (if possible) provide unencrypted packet captures.

JerryFrag
Posts: 6
Joined: Mon May 09, 2022 8:20 pm

Re: AT+HTTPCPOST

Postby JerryFrag » Fri May 13, 2022 7:12 pm

Hi,

I should have been more specific.

It looks like this is a problem related to version 2.1.0.0 of the firmware, where data is being sent at text/xml even though I specified application/json.

I saw a note to update the code to 2.2.0 but the same problem exists.

I notice a note for 2.3.0.0 for the MINI, but I'm using a WROOM and so this fix isn't in yet to the WROOM firmware.

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: AT+HTTPCPOST

Postby ESP_Sun » Mon May 16, 2022 2:55 am

Maybe you can download the latest wroom test firmware from here (https://github.com/espressif/esp-at/act ... 2319465429) to test this function.
You can refer to this document <How to Download the Latest Temporary Version of AT Firmware from GitHub>(https://docs.espressif.com/projects/esp ... rom-github) to download at firmware from GitHub.

JerryFrag
Posts: 6
Joined: Mon May 09, 2022 8:20 pm

Re: AT+HTTPCPOST

Postby JerryFrag » Wed May 25, 2022 4:11 pm

Hi,

I want to report that the latest firmware release for the WROOM worked and I am able to POST JSON data without error.

Thank you.

Is there a proposed release date for the firmware?

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: AT+HTTPCPOST

Postby ESP_Sun » Thu May 26, 2022 2:06 am

I think the release v2.4 version should also not have the previous issue, because this version was released recently, you can probably get it from this link (https://docs.espressif.com/projects/esp ... aries.html).

Who is online

Users browsing this forum: No registered users and 44 guests