tsathishkumar / MySController-rs

Controller for MySensors, exposes WoT APIs for the sensors. It supports OTA firmware updates, and also acts as proxy for all requests.
GNU Affero General Public License v3.0
20 stars 9 forks source link

Latest build results #14

Closed flatsiedatsie closed 5 years ago

flatsiedatsie commented 5 years ago

Perhaps it's useful, so here are the latest results from "cargo run":

pi@gateway:~ $ cd MySController-rs/ pi@gateway:~/MySController-rs $ git pull remote: Enumerating objects: 83, done. remote: Counting objects: 100% (83/83), done. remote: Compressing objects: 100% (36/36), done. remote: Total 63 (delta 44), reused 44 (delta 26), pack-reused 0 Unpacking objects: 100% (63/63), done. From https://github.com/tsathishkumar/MySController-rs 85a1ef9..d8f4b0e master -> origin/master Updating 85a1ef9..d8f4b0e Fast-forward .bintray.json 6 +- .travis.yml 1 + Cargo.lock 2 +- Cargo.toml 16 ++--- README.md 16 ++++- build.sh 24 ++----- .../down.sql 1 + .../up.sql 1 + src/core/interceptor.rs 33 ++++----- src/core/message/internal.rs 83 ++++++++++++++++++++++ src/core/message/mod.rs 13 +++- src/core/message_handler/internal.rs 64 ++++++++++++----- src/core/server.rs 3 +- src/handler/node.rs 1 + src/model/node.rs 2 + 15 files changed, 195 insertions(+), 71 deletions(-) create mode 100644 migrations/2018-10-12-103949_add_parent_node_id_in_nodes/down.sql create mode 100644 migrations/2018-10-12-103949_add_parent_node_id_in_nodes/up.sql create mode 100644 src/core/message/internal.rs pi@gateway:~/MySController-rs $ cargo run Compiling myscontroller-rs v0.6.1 (/home/pi/MySController-rs)
warning: unused import: hex
--> src/core/message/internal.rs:2:5
2 use hex;
^^^

= note: #[warn(unused_imports)] on by default

warning: unused import: std::mem
--> src/core/message/internal.rs:5:5
|
5 | use std::mem;
| ^^^^^^^^

warning: unnecessary parentheses around method argument
--> src/core/message_handler/internal.rs:82:14
82 .set((parent_node_id.eq(_parent_node_id))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

= note: #[warn(unused_parens)] on by default

warning: cannot find type table in this scope
--> <::diesel::macros::table_body macros>:165:33
165 derive ( Debug , Clone , Copy , QueryId ) ] /// The actual table struct ^^^^^^^ names from parent modules are not accessible without an explicit import
= note: #[warn(proc_macro_derive_resolution_fallback)] on by default        
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #50504 <https://github.com/rust-lang/rust/issues/50504>
warning: cannot find type table in this scope
--> <::diesel::macros::table_body macros>:165:33
165 derive ( Debug , Clone , Copy , QueryId ) ] /// The actual table struct ^^^^^^^ names from parent modules are not accessible without an explicit import
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #50504 <https://github.com/rust-lang/rust/issues/50504>
warning: cannot find type firmware_type in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type firmware_version in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type name in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type blocks in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type crc in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type data in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type Firmware in this scope
--> src/model/firmware.rs:23:10
23 #[derive(Queryable, Serialize, Deserialize, Insertable, Clone)] ^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type firmwares in this scope
--> src/model/firmware.rs:23:45
23 #[derive(Queryable, Serialize, Deserialize, Insertable, Clone)] ^^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type Firmware in this scope
--> src/model/firmware.rs:23:45
23 #[derive(Queryable, Serialize, Deserialize, Insertable, Clone)] ^^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type node_id in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type node_name in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type desired_firmware_type in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type desired_firmware_version in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type auto_update in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type scheduled in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type parent_node_id in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type Node in this scope
--> src/model/node.rs:15:10
15 #[derive(Queryable, Serialize, Deserialize, Insertable, Debug)] ^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type nodes in this scope
--> src/model/node.rs:15:45
15 #[derive(Queryable, Serialize, Deserialize, Insertable, Debug)] ^^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type Node in this scope
--> src/model/node.rs:15:45
15 #[derive(Queryable, Serialize, Deserialize, Insertable, Debug)] ^^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type child_sensor_id in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type sensor_type in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type description in this scope
--> <::diesel::macros::__diesel_column macros>:5:33
5 derive ( Debug , Clone , Copy , QueryId , Default ) ] pub struct $ column_name ^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type PresentationType in this scope
--> src/model/sensor.rs:16:10
16 #[derive(Queryable, Serialize, Deserialize, Insertable, Debug, PartialEq, Clone)] ^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type Sensor in this scope
--> src/model/sensor.rs:16:10
16 #[derive(Queryable, Serialize, Deserialize, Insertable, Debug, PartialEq, Clone)] ^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type sensors in this scope
--> src/model/sensor.rs:16:45
16 #[derive(Queryable, Serialize, Deserialize, Insertable, Debug, PartialEq, Clone)] ^^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type Sensor in this scope
--> src/model/sensor.rs:16:45
16 #[derive(Queryable, Serialize, Deserialize, Insertable, Debug, PartialEq, Clone)] ^^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: cannot find type PresentationType in this scope
--> src/model/sensor.rs:16:45
16 #[derive(Queryable, Serialize, Deserialize, Insertable, Debug, PartialEq, Clone)] ^^^^^^^^^^ names from parent modules are not accessible without an explicit import

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 https://github.com/rust-lang/rust/issues/50504

warning: unused variable: ack
--> src/core/message_handler/internal.rs:38:65
38 InternalMessage {node_id, child_sensor_id: 255, ack, sub_type: InternalType::DiscoverResponse, ref payload } => { ^^^ help: try ignoring the field: ack: _

= note: #[warn(unused_variables)] on by default

warning: constant item is never used: MAX_MESSAGE_LENGTH
--> src/core/message/internal.rs:7:1
7 const MAX_MESSAGE_LENGTH: usize = 32; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

= note: #[warn(dead_code)] on by default

Finished dev [unoptimized + debuginfo] target(s) in 6m 13s                  
 Running `target/debug/myscontroller-rs`

INFO 2018-10-23T12:51:35Z: actix_web::server::srv: Starting 4 http workers INFO 2018-10-23T12:51:35Z: actix_web::server::srv: Starting server on http://0.0.0.0:8000 Running migration 20181012103949 thread 'main' panicked at 'called Result::unwrap() on an Err value: QueryError(DatabaseError(Unknown, "attempt to write a readonly database"))', libcore/result.rs:1009:5 stack backtrace: 0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49 1: std::sys_common::backtrace::print at libstd/sys_common/backtrace.rs:71 at libstd/sys_common/backtrace.rs:59 2: std::panicking::default_hook::{{closure}} at libstd/panicking.rs:211 3: std::panicking::default_hook at libstd/panicking.rs:227 4: std::panicking::rust_panic_with_hook at libstd/panicking.rs:476 5: std::panicking::continue_panic_fmt at libstd/panicking.rs:390 6: rust_begin_unwind at libstd/panicking.rs:325 7: core::panicking::panic_fmt at libcore/panicking.rs:77 8: core::result::unwrap_failed at libcore/macros.rs:26 9: <core::result::Result<T, E>>::unwrap at libcore/result.rs:808 10: myscontroller_rs::main at src/main.rs:105 11: std::rt::lang_start::{{closure}} at libstd/rt.rs:74 12: std::panicking::try::do_call at libstd/rt.rs:59 at libstd/panicking.rs:310 13: __rust_maybe_catch_panic at libpanic_unwind/lib.rs:102 14: std::panicking::try at libstd/panicking.rs:289 15: std::rt::lang_start_internal at libstd/panic.rs:392 at libstd/rt.rs:58 16: std::rt::lang_start at libstd/rt.rs:74 17: main 18: libc_start_main pi@gateway:~/MySController-rs $

tsathishkumar commented 5 years ago

Ah, that makes sense. Airquality sensor has to be handled. I'll work on that.

On Tue, Nov 20, 2018, 1:34 PM flatsiedatsie <notifications@github.com wrote:

I just noticed:

pi@gateway:~/MySController-rs/target/debug $ sudo ./myscontroller-rs INFO 2018-11-20T08:03:55Z: actix_web::server::srv: Starting 4 http workers INFO 2018-11-20T08:03:55Z: actix_web::server::srv: Starting server on http://0.0.0.0:8000 INFO 2018-11-20T08:03:55Z: myscontroller_rs: Starting proxy server INFO 2018-11-20T08:03:55Z: myscontroller_rs::core::connection: Waiting for server connection -- 0.0.0.0:5003 ...

WARN 2018-11-20T08:03:55Z: myscontroller_rs::wot::adapter: PresentationType ArduinoRepeaterNode is not handled yet! WARN 2018-11-20T08:03:55Z: myscontroller_rs::wot::adapter: PresentationType AirQuality is not handled yet! INFO 2018-11-20T08:03:55Z: myscontroller_rs::core::connection: Connected to -- 0.0.0.0:5003 INFO 2018-11-20T08:03:55Z: myscontroller_rs::core::connection: Server listening on -- 0.0.0.0:9095 INFO 2018-11-20T08:03:55Z: myscontroller_rs::core::connection: 0.0.0.0:5003 >> "0;255;3;0;14;Gateway startup complete.\n" INFO 2018-11-20T08:03:55Z: myscontroller_rs::core::connection: 0.0.0.0:5003 >> "0;255;0;0;18;2.3.0\n" ERROR 2018-11-20T08:03:55Z: myscontroller_rs::core::message_handler::presentation: Error while checking for existing node of Sensor { node_id: 0, child_sensor_id: 255, sensor_type: ArduinoRepeaterNode, description: "2.3.0" } NotFound INFO 2018-11-20T08:03:55Z: actix_web::server::srv: Starting 4 http workers INFO 2018-11-20T08:03:55Z: actix_web::server::srv: Starting server on http://0.0.0.0:8888 INFO 2018-11-20T08:03:55Z: actix_web::middleware::logger: 192.168.2.110:38282 [20/Nov/2018:09:03:55 +0100] "GET / HTTP/1.1" 200 2 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" 0.039264 INFO 2018-11-20T08:03:57Z: myscontroller_rs::core::connection: 0.0.0.0:5003 >> "14;0;1;0;37;301\n" WARN 2018-11-20T08:03:57Z: myscontroller_rs::wot: No thing found matching SetMessage { node_id: 14, child_sensor_id: 0, ack: 0, value: Value { set_type: Level, value: "301" } }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tsathishkumar/MySController-rs/issues/14#issuecomment-440179707, or mute the thread https://github.com/notifications/unsubscribe-auth/ABaM5B8jXbz0ZQqN594rYUFhQhgfLOJxks5uw7epgaJpZM4X1hCn .

flatsiedatsie commented 5 years ago

It's alive! This time really.

I added another test device with three relays. And after adding that device manually the :8888 shows devices! And they show up in Mozilla Gateway!

It's a start!

So I guess now the only question is:

tsathishkumar commented 5 years ago

Why doesn't it add the devices itself?

This is because - in our setup we create the nodes by sending firmwares over the air (and the node_id gets assigned automatically by the controller). But in your case the node ids are already set, but the controller doesn't know about the node_id. I have a solution in mind. If there is a presentation message from node, we can auto create it with no firmware.

Can I help with adding more sensor types? I am not a good programmer, but if I can just repeat a pattern, perhaps that's useful? Which files should I check out?

Definitely. I need help in understanding about the sensor outputs. What kind of values will be coming from the sensor, so that I can map it correctly to the Mozilla WoT thing.

To start with, what is the output of AirQuality Sensor, quick look at the mysensors API tells that V_LEVEL and V_UNIT_PREFIX are applicable for S_AIR_QUALITY. Is that all?

tsathishkumar commented 5 years ago

And it would be better to use some other medium or another issue. Because this issue is filled with long logs and Github is struggling to load this page :D