Comments (5)
That is not a great user experience.
This error is currently unhandled in the Rust code, so it bubbles up to Python as a panic.
An unreachable device will throw a proper timeout exception, so it's not that.
This panic occurs when the API of the device returns an empty response.
It might be that the response status code is not properly validated. I'll investigate.
from tapo.
Hi, the library is still panicking. I tracked the full stack, maybe can help for further investigations
2024-01-07T06:35:41.578057+01:00 raspberrypi python3[1072361]: thread 'tokio-runtime-worker' panicked at tapo/src/api/protocol/klap_cipher.rs:61:26:
2024-01-07T06:35:41.613919+01:00 raspberrypi python3[1072361]: range start index 32 out of range for slice of length 0
2024-01-07T06:35:41.619313+01:00 raspberrypi python3[1072361]: stack backtrace:
2024-01-07T06:35:41.930871+01:00 raspberrypi python3[1072361]: 0: rust_begin_unwind
2024-01-07T06:35:41.932535+01:00 raspberrypi python3[1072361]: at ./rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
2024-01-07T06:35:41.934638+01:00 raspberrypi python3[1072361]: 1: core::panicking::panic_fmt
2024-01-07T06:35:41.935300+01:00 raspberrypi python3[1072361]: at ./rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
2024-01-07T06:35:41.935957+01:00 raspberrypi python3[1072361]: 2: core::slice::index::slice_start_index_len_fail_rt
2024-01-07T06:35:41.936342+01:00 raspberrypi python3[1072361]: at ./rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/slice/index.rs:52:5
2024-01-07T06:35:41.936777+01:00 raspberrypi python3[1072361]: 3: core::slice::index::slice_start_index_len_fail
2024-01-07T06:35:41.937139+01:00 raspberrypi python3[1072361]: at ./rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/slice/index.rs:40:9
2024-01-07T06:35:41.949087+01:00 raspberrypi python3[1072361]: 4: tapo::api::protocol::klap_cipher::KlapCipher::decrypt
2024-01-07T06:35:41.956973+01:00 raspberrypi python3[1072361]: 5: <tapo::api::protocol::klap_protocol::KlapProtocol as tapo::api::protocol::tapo_protocol::TapoPro
tocolExt>::execute_request::{{closure}}
2024-01-07T06:35:41.962650+01:00 raspberrypi python3[1072361]: 6: <tapo::api::protocol::tapo_protocol::TapoProtocol as tapo::api::protocol::tapo_protocol::TapoPro
tocolExt>::execute_request::{{closure}}
2024-01-07T06:35:41.972875+01:00 raspberrypi python3[1072361]: 7: tapo::api::api_client::ApiClient::get_device_info::{{closure}}
2024-01-07T06:35:41.980510+01:00 raspberrypi python3[1072361]: 8: <pyo3_asyncio::generic::Cancellable as core::future::future::Future>::poll
2024-01-07T06:35:41.983036+01:00 raspberrypi python3[1072361]: 9: <tokio::task::task_local::TaskLocalFuture<T,F> as core::future::future::Future>::poll
2024-01-07T06:35:41.988233+01:00 raspberrypi python3[1072361]: 10: <pyo3_asyncio::tokio::TokioRuntime as pyo3_asyncio::generic::Runtime>::spawn::{{closure}}
2024-01-07T06:35:41.995734+01:00 raspberrypi python3[1072361]: 11: tokio::runtime::task::core::Core<T,S>::poll
2024-01-07T06:35:41.996563+01:00 raspberrypi python3[1072361]: 12: tokio::runtime::task::harness::Harness<T,S>::poll
2024-01-07T06:35:41.997293+01:00 raspberrypi python3[1072361]: 13: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
2024-01-07T06:35:42.004578+01:00 raspberrypi python3[1072361]: 14: tokio::runtime::scheduler::multi_thread::worker::Context::run
2024-01-07T06:35:42.012060+01:00 raspberrypi python3[1072361]: 15: tokio::runtime::context::scoped::Scoped::set
2024-01-07T06:35:42.015976+01:00 raspberrypi python3[1072361]: 16: tokio::runtime::context::runtime::enter_runtime
2024-01-07T06:35:42.016336+01:00 raspberrypi python3[1072361]: 17: tokio::runtime::scheduler::multi_thread::worker::run
2024-01-07T06:35:42.016705+01:00 raspberrypi python3[1072361]: 18: tokio::runtime::task::core::Core<T,S>::poll
2024-01-07T06:35:42.023126+01:00 raspberrypi python3[1072361]: 19: tokio::runt
from tapo.
I suspect this is because the above change has not been released yet.
There is one more fix I want to get in before I cut a new version. Sorry, it dragged on.
from tapo.
The fix has been released in Tapo Rust v0.7.7 and Tapo Python v0.1.4.
from tapo.
Excellent! Sorry, I didn't mean to hurry, just wanted to help.
from tapo.
Related Issues (20)
- Is it mandatory to use the Hub? HOT 2
- P115 changing WI-FI HOT 5
- H100 initialization attempt returns error HOT 4
- Support client.getDeviceList HOT 4
- Example for doing things with devices accessed throung the hub HOT 1
- Local access to TAPO P110 for energy data HOT 10
- S500D support HOT 3
- cannot import 'LightHander' or 'ColorLightHandler' for typings HOT 3
- Meaning / correctness of timestamps of device.get_energy_data HOT 3
- Bug in hue/saturation and color_temperature code HOT 2
- ApiClient on AWS Lambda HOT 1
- Sporadic segfaults in a python module when using ApiClient to query a Tapo P110 HOT 8
- ImportError: cannot import name 'ApiClient' from partially initialized module 'tapo' (most likely due to a circular import) HOT 2
- start_timestamp and export timestamp HOT 5
- Tapo: SessionTimeout HOT 2
- Monthly data reading crashes when device somehow has negative values HOT 2
- trigger logs doesn't retrieve all logs HOT 2
- tapo-py 0.3.1 code hangs on timeout HOT 1
- tapo-py :- 0.3.1 getting error while calling get_device_info HOT 5
- Behaviour of start_date and end_date parameters of device.get_energy_data() HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tapo.