Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"%", "#", and "&" don't work in Tasmota passwords. #393

Closed
ajshell1 opened this issue Mar 7, 2022 · 2 comments
Closed

"%", "#", and "&" don't work in Tasmota passwords. #393

ajshell1 opened this issue Mar 7, 2022 · 2 comments
Labels
bug Something isn't working resolved Issue is resolved

Comments

@ajshell1
Copy link

ajshell1 commented Mar 7, 2022

What happened

Following the Moonraker Configuration guide, I tried to setup my Tasmota Plug.

I added the following lines:

[power tasmota_neptune]
type: tasmota
address: 10.0.0.49
password: ^uaCpgzxkqFy@byctAiP*^%oaV%!WpQCrpSwep64LcwbmUEAJN7uFwP8E8#Y!TJ6

(Yes, that was my actual password for it at the time)

And I was greeted with this: https://cdn.discordapp.com/attachments/817507968609943584/950450137921105961/unknown.png

(full logs included below)

Length isn't the issue, since an alphanumeric 64 character password works without issuses

Since then, I did some testing. I changed my tasmota device's password to a series of the same character five times in a row, and attempted to connect to it with Moonraker. Here are the results:

Work:
^^^^^


!!!!!
?????

Don't work:

&&&&&
%%%%%

I also tried

From bash, I've found that curl "http://10.0.0.83/cm?user=admin&password=%%%%%&cmnd=Power1" doesn't work. This may be a curl issue. This is also the case for ##### as well.

Client

Mainsail

Browser

Firefox

How to reproduce

If you own a Tasmota device, give it a password with "%", "&", or "#", and configure it in Moonraker.

[power tasmota_neptune]
type: tasmota
address:
password:

Additional information

I enabled Debug mode, but my Moonraker.log is now 1.5MB, so here's a snippet. I'll provide more if needed.

I have two Tasmota devices, one with a 64 character alphanumeric password (which I have redacted), which connects successfully.

2022-03-07 13:16:44,323 [curl_httpclient.py:_curl_debug()] - Connected to 10.0.0.49 (10.0.0.49) port 80 (#0)
2022-03-07 13:16:44,323 [curl_httpclient.py:_curl_debug()] - > GET /cm?user=admin&password=[REDACTED_ALPHANUMERIC_STRING]&cmnd=Power1 HTTP/1.1
2022-03-07 13:16:44,323 [curl_httpclient.py:_curl_debug()] - > Host: 10.0.0.49
2022-03-07 13:16:44,323 [curl_httpclient.py:_curl_debug()] - > User-Agent: Moonraker
2022-03-07 13:16:44,324 [curl_httpclient.py:_curl_debug()] - > Accept: /
2022-03-07 13:16:44,324 [curl_httpclient.py:_curl_debug()] - > Accept-Encoding: gzip,deflate
2022-03-07 13:16:44,324 [curl_httpclient.py:_curl_debug()] - >
2022-03-07 13:16:44,346 [curl_httpclient.py:_curl_debug()] - Mark bundle as not supporting multiuse
2022-03-07 13:16:44,347 [curl_httpclient.py:_curl_debug()] - < HTTP/1.1 200 OK
2022-03-07 13:16:44,347 [curl_httpclient.py:_curl_debug()] - < Content-Type: application/json
2022-03-07 13:16:44,347 [curl_httpclient.py:_curl_debug()] - < Server: Tasmota/10.1.0 (ESP8266EX)
2022-03-07 13:16:44,347 [curl_httpclient.py:_curl_debug()] - < Cache-Control: no-cache, no-store, must-revalidate
2022-03-07 13:16:44,348 [curl_httpclient.py:_curl_debug()] - < Pragma: no-cache
2022-03-07 13:16:44,348 [curl_httpclient.py:_curl_debug()] - < Expires: -1
2022-03-07 13:16:44,348 [curl_httpclient.py:_curl_debug()] - < Accept-Ranges: none
2022-03-07 13:16:44,348 [curl_httpclient.py:_curl_debug()] - < Transfer-Encoding: chunked
2022-03-07 13:16:44,348 [curl_httpclient.py:_curl_debug()] - < Connection: close
2022-03-07 13:16:44,350 [curl_httpclient.py:_curl_debug()] - <
2022-03-07 13:16:44,354 [curl_httpclient.py:_curl_debug()] - Closing connection 0
2022-03-07 13:16:44,357 [curl_httpclient.py:_curl_setup_request()] - GET http://10.0.0.83/cm?user=admin&password=%%%%%&cmnd=Power1
2022-03-07 13:16:44,359 [curl_httpclient.py:_curl_debug()] - Trying 10.0.0.83:80...
2022-03-07 13:16:44,425 [curl_httpclient.py:_curl_debug()] - Connected to 10.0.0.83 (10.0.0.83) port 80 (#1)
2022-03-07 13:16:44,426 [curl_httpclient.py:_curl_debug()] - > GET /cm?user=admin&password=%%%%%&cmnd=Power1 HTTP/1.1
2022-03-07 13:16:44,426 [curl_httpclient.py:_curl_debug()] - > Host: 10.0.0.83
2022-03-07 13:16:44,426 [curl_httpclient.py:_curl_debug()] - > User-Agent: Moonraker
2022-03-07 13:16:44,426 [curl_httpclient.py:_curl_debug()] - > Accept: /
2022-03-07 13:16:44,426 [curl_httpclient.py:_curl_debug()] - > Accept-Encoding: gzip,deflate
2022-03-07 13:16:44,426 [curl_httpclient.py:_curl_debug()] - >
2022-03-07 13:16:44,470 [curl_httpclient.py:_curl_debug()] - Mark bundle as not supporting multiuse
2022-03-07 13:16:44,471 [curl_httpclient.py:_curl_debug()] - < HTTP/1.1 401 Unauthorized
2022-03-07 13:16:44,471 [curl_httpclient.py:_curl_debug()] - < Content-Type: application/json
2022-03-07 13:16:44,471 [curl_httpclient.py:_curl_debug()] - < Server: Tasmota/10.1.0 (ESP8266EX)
2022-03-07 13:16:44,471 [curl_httpclient.py:_curl_debug()] - < Cache-Control: no-cache, no-store, must-revalidate
2022-03-07 13:16:44,471 [curl_httpclient.py:_curl_debug()] - < Pragma: no-cache
2022-03-07 13:16:44,471 [curl_httpclient.py:_curl_debug()] - < Expires: -1
2022-03-07 13:16:44,472 [curl_httpclient.py:_curl_debug()] - < Accept-Ranges: none
2022-03-07 13:16:44,472 [curl_httpclient.py:_curl_debug()] - < Transfer-Encoding: chunked
2022-03-07 13:16:44,472 [curl_httpclient.py:_curl_debug()] - < Connection: close
2022-03-07 13:16:44,472 [curl_httpclient.py:_curl_debug()] - <
2022-03-07 13:16:44,476 [curl_httpclient.py:_curl_debug()] - Closing connection 1
2022-03-07 13:16:45,481 [curl_httpclient.py:_curl_setup_request()] - GET http://10.0.0.83/cm?user=admin&password=%%%%%&cmnd=Power1
2022-03-07 13:16:45,483 [curl_httpclient.py:_curl_debug()] - Hostname 10.0.0.83 was found in DNS cache
2022-03-07 13:16:45,484 [curl_httpclient.py:_curl_debug()] - Trying 10.0.0.83:80...
2022-03-07 13:16:45,491 [curl_httpclient.py:_curl_debug()] - Connected to 10.0.0.83 (10.0.0.83) port 80 (#2)
2022-03-07 13:16:45,492 [curl_httpclient.py:_curl_debug()] - > GET /cm?user=admin&password=%%%%%&cmnd=Power1 HTTP/1.1
2022-03-07 13:16:45,492 [curl_httpclient.py:_curl_debug()] - > Host: 10.0.0.83
2022-03-07 13:16:45,493 [curl_httpclient.py:_curl_debug()] - > User-Agent: Moonraker
2022-03-07 13:16:45,493 [curl_httpclient.py:_curl_debug()] - > Accept: /
2022-03-07 13:16:45,493 [curl_httpclient.py:_curl_debug()] - > Accept-Encoding: gzip,deflate
2022-03-07 13:16:45,493 [curl_httpclient.py:_curl_debug()] - >
2022-03-07 13:16:45,507 [curl_httpclient.py:_curl_debug()] - Mark bundle as not supporting multiuse
2022-03-07 13:16:45,507 [curl_httpclient.py:_curl_debug()] - < HTTP/1.1 401 Unauthorized
2022-03-07 13:16:45,508 [curl_httpclient.py:_curl_debug()] - < Content-Type: application/json
2022-03-07 13:16:45,509 [curl_httpclient.py:_curl_debug()] - < Server: Tasmota/10.1.0 (ESP8266EX)
2022-03-07 13:16:45,510 [curl_httpclient.py:_curl_debug()] - < Cache-Control: no-cache, no-store, must-revalidate
2022-03-07 13:16:45,510 [curl_httpclient.py:_curl_debug()] - < Pragma: no-cache
2022-03-07 13:16:45,510 [curl_httpclient.py:_curl_debug()] - < Expires: -1
2022-03-07 13:16:45,511 [curl_httpclient.py:_curl_debug()] - < Accept-Ranges: none
2022-03-07 13:16:45,511 [curl_httpclient.py:_curl_debug()] - < Transfer-Encoding: chunked
2022-03-07 13:16:45,512 [curl_httpclient.py:_curl_debug()] - < Connection: close
2022-03-07 13:16:45,512 [curl_httpclient.py:_curl_debug()] - <
2022-03-07 13:16:45,514 [curl_httpclient.py:_curl_debug()] - Closing connection 2
2022-03-07 13:16:46,519 [curl_httpclient.py:_curl_setup_request()] - GET http://10.0.0.83/cm?user=admin&password=%%%%%&cmnd=Power1
2022-03-07 13:16:46,521 [curl_httpclient.py:_curl_debug()] - Hostname 10.0.0.83 was found in DNS cache
2022-03-07 13:16:46,521 [curl_httpclient.py:_curl_debug()] - Trying 10.0.0.83:80...
2022-03-07 13:16:46,532 [curl_httpclient.py:_curl_debug()] - Connected to 10.0.0.83 (10.0.0.83) port 80 (#3)
2022-03-07 13:16:46,533 [curl_httpclient.py:_curl_debug()] - > GET /cm?user=admin&password=%%%%%&cmnd=Power1 HTTP/1.1
2022-03-07 13:16:46,533 [curl_httpclient.py:_curl_debug()] - > Host: 10.0.0.83
2022-03-07 13:16:46,533 [curl_httpclient.py:_curl_debug()] - > User-Agent: Moonraker
2022-03-07 13:16:46,534 [curl_httpclient.py:_curl_debug()] - > Accept: /
2022-03-07 13:16:46,534 [curl_httpclient.py:_curl_debug()] - > Accept-Encoding: gzip,deflate
2022-03-07 13:16:46,534 [curl_httpclient.py:_curl_debug()] - >
2022-03-07 13:16:46,546 [curl_httpclient.py:_curl_debug()] - Mark bundle as not supporting multiuse
2022-03-07 13:16:46,547 [curl_httpclient.py:_curl_debug()] - < HTTP/1.1 401 Unauthorized
2022-03-07 13:16:46,548 [curl_httpclient.py:_curl_debug()] - < Content-Type: application/json
2022-03-07 13:16:46,548 [curl_httpclient.py:_curl_debug()] - < Server: Tasmota/10.1.0 (ESP8266EX)
2022-03-07 13:16:46,549 [curl_httpclient.py:_curl_debug()] - < Cache-Control: no-cache, no-store, must-revalidate
2022-03-07 13:16:46,549 [curl_httpclient.py:_curl_debug()] - < Pragma: no-cache
2022-03-07 13:16:46,550 [curl_httpclient.py:_curl_debug()] - < Expires: -1
2022-03-07 13:16:46,550 [curl_httpclient.py:_curl_debug()] - < Accept-Ranges: none
2022-03-07 13:16:46,550 [curl_httpclient.py:_curl_debug()] - < Transfer-Encoding: chunked
2022-03-07 13:16:46,550 [curl_httpclient.py:_curl_debug()] - < Connection: close
2022-03-07 13:16:46,551 [curl_httpclient.py:_curl_debug()] - <
2022-03-07 13:16:46,552 [curl_httpclient.py:_curl_debug()] - Closing connection 3
2022-03-07 13:16:46,555 [power.py:refresh_status()] - Error Refeshing Device Status: tasmota_neptune
Traceback (most recent call last):
File "/home/aj/moonraker/moonraker/components/power.py", line 433, in _send_http_command
response = await self.client.fetch(
tornado.httpclient.HTTPClientError: HTTP 401: Unauthorized

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/aj/moonraker/moonraker/components/power.py", line 455, in refresh_status
state = await self._send_status_request()
File "/home/aj/moonraker/moonraker/components/power.py", line 888, in _send_status_request
res = await self._send_tasmota_command("info")
File "/home/aj/moonraker/moonraker/components/power.py", line 885, in _send_tasmota_command
return await self._send_http_command(url, command)
File "/home/aj/moonraker/moonraker/components/power.py", line 439, in _send_http_command
raise self.server.error(msg) from e
utils.ServerError: Error sending 'tasmota' command: info
2022-03-07 13:16:46,555 [moonraker.py:_initialize_component()] - Component [power] failed post init
Traceback (most recent call last):
File "/home/aj/moonraker/moonraker/moonraker.py", line 201, in _initialize_component
await ret
File "/home/aj/moonraker/moonraker/components/power.py", line 114, in component_init
if not await dev.initialize():
File "/home/aj/moonraker/moonraker/components/power.py", line 357, in initialize
await ret
File "/home/aj/moonraker/moonraker/components/power.py", line 424, in init_state
await self.refresh_status()
File "/home/aj/moonraker/moonraker/components/power.py", line 460, in refresh_status
raise self.server.error(msg) from None
utils.ServerError: Error Refeshing Device Status: tasmota_neptune
2022-03-07 13:16:46,555 [moonraker.py:add_warning()] - Component 'power' failed to load with error: Error Refeshing Device Status: tasmota_neptune
2022-03-07 13:16:46,557 [moonraker.py:start_server()] - Starting Moonraker on (0.0.0.0, 7125), Hostname: octoprint
2022-03-07 13:16:46,561 [app.py:listen()] - SSL Certificate/Key not configured, aborting HTTPS Server startup
2022-03-07 13:16:46,815 [klippy_connection.py:_do_connect()] - Klippy Connection Established
2022-03-07 13:16:47,072 [klippy_connection.py:_init_klippy_connection()] - Webhooks Subscribed
2022-03-07 13:16:47,077 [klippy_connection.py:_init_klippy_connection()] - GCode Output Subscribed
2022-03-07 13:16:47,084 [file_manager.py:_update_fixed_paths()] -

@ajshell1 ajshell1 added the bug Something isn't working label Mar 7, 2022
@Arksine
Copy link
Owner

Arksine commented Mar 7, 2022

This is probably a url encoding issue. I'm currently reworking the http client, suspect that I will be able to resolve the issue in that series of patches.

@Arksine Arksine added the resolved Issue is resolved label Apr 22, 2022
@Arksine
Copy link
Owner

Arksine commented Apr 22, 2022

This issue should be resolved in the current version of Moonraker, so I'm going to close this. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved Issue is resolved
Projects
None yet
Development

No branches or pull requests

2 participants