wgetasync problem esp32

Code tips and tricks for beginners
Post Reply
martineztel
Posts: 15
Joined: Wed Jun 28, 2023 7:20 am
Been thanked: 1 time

wgetasync problem esp32

Post by martineztel »

Hello

When you try to execute the command, a message about lack of authorization appears.
How to add a username and password ?

wgetasync"http://192.168.33.100/status"

result
<HTML><HEAD><TITLE>401 Unauthorized</TITLE></HEAD>
<BODY BGCOLOR="#cc9999"><H4>401 Unauthorized</H4>
Authorization required.
</BODY></HTML>
User avatar
cicciocb
Site Admin
Posts: 2057
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1357 times
Contact:

Re: wgetasync problem esp32

Post by cicciocb »

You can use this format:

Code: [Local Link Removed for Guests]

http://username:password@example.com/
so, in yout case you must do

Code: [Local Link Removed for Guests]

wgetasync "http://login:password@192.168.33.100/status"
martineztel
Posts: 15
Joined: Wed Jun 28, 2023 7:20 am
Been thanked: 1 time

Re: wgetasync problem esp32

Post by martineztel »

ok, it works, but the wgetresult$ function throws a messages out of memory
User avatar
cicciocb
Site Admin
Posts: 2057
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1357 times
Contact:

Re: wgetasync problem esp32

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Apr 15, 2024 1:10 pm ok, it works, but the wgetresult$ function throws a messages out of memory
Probably the answer is too big for the RAM available in the chip.
If you are using an ESP8266 this means that is time to change device :D
If you are using an ESP32, this means that you need a module with PSRAM :lol:
martineztel
Posts: 15
Joined: Wed Jun 28, 2023 7:20 am
Been thanked: 1 time

Re: wgetasync problem esp32

Post by martineztel »

There was an error in the address, it should have been
wgetasync "http://login:password@192.168.33.100/status.html"
Now it works properly.
Thank you for your help.
Post Reply