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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 rust-lang/rust#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 $