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

When sendind a mqtt message on cmds/set to change the atts of a device, crash platform #41

Closed
Darcraytore1 opened this issue May 13, 2024 · 5 comments · Fixed by #51
Closed

Comments

@Darcraytore1
Copy link
Member

No description provided.

@XdoctorwhoZ
Copy link
Member

Which interface ? Which Device ?

@XdoctorwhoZ
Copy link
Member

Sur fakeBPC pour tous les attributs

@XdoctorwhoZ
Copy link
Member

It seems ok on my computer windows and I send data on cmds with sandbox app

   Finished dev [unoptimized + debuginfo] target(s) in 0.21s
     Running `target\debug\panduza-rust-platform.exe`
-1-[F] # Device factory initialization
-1-[F] List of producers:
-1-[F]   - korad.ka3005
-1-[F]   - new hunter
-1-[F]   - panduza.server
-1-[F]   - panduza.voxpower_inhibiter
-1-[F]   - panduza.fake_power_supply
-1-[P] Platform Version ...
-13-[P] Booting...
-13-[P] Loading tree file: "C:\\Users\\xavie\\panduza\\tree.json"
-13-[P]  - Tree Json content -
{
  "devices": [
    {
      "name": "pok",
      "ref": "panduza.fake_power_supply"
    }
  ]
}
-13-[test-platform] Connection created
-1-[P] New task created ! [AbortHandle { id: Id(17) }]
-13-[test-platform] Connection started
-13-[P]  - Try to create device -
{
  "name": "MSI",
  "ref": "panduza.server"
}
-13-[default/MSI] Device created
-13-[default/MSI] Start Interfaces...
-13-[default/MSI/platform] Registering attribute "info"
-13-[default/MSI/platform] Interface started
-1-[P] New task created ! [AbortHandle { id: Id(19) }]
-13-[default/MSI] Interfaces started !
-1-[P] New task created ! [AbortHandle { id: Id(20) }]
-13-[P] Boot Success!
-13-[P] Reloading Configuration Tree...
-13-[P]  - Try to create device -
{
  "name": "pok",
  "ref": "panduza.fake_power_supply"
}
-13-[default/pok] Device created
-13-[default/pok] Start Interfaces...
-13-[default/pok/channel] Registering attribute "info"
-1-[P] New task created ! [AbortHandle { id: Id(21) }]
-13-[default/pok/channel] Interface started
-1-[P] New task created ! [AbortHandle { id: Id(22) }]
-13-[default/pok] Interfaces started !
-11-[default/MSI/platform] Run State "Connecting"
-13-[P] Reloading Success!
-13-[default/pok/channel] Run State "Connecting"
-11-[default/MSI/platform] State changed Connecting => Initializating
-4-[default/pok/channel] State changed Connecting => Initializating
-11-[default/MSI/platform] Run State "Initializating"
-4-[default/pok/channel] Run State "Initializating"
-11-[default/MSI/platform] Registering attribute "dtree"
-4-[default/pok/channel] Registering attribute "enable"
-11-[default/MSI/platform] Registering attribute "devices"
-4-[default/pok/channel] Registering attribute "voltage"
-11-[default/MSI/platform] State changed Initializating => Running
-4-[default/pok/channel] Registering attribute "current"
-11-[default/MSI/platform] Run State "Running"
-4-[default/pok/channel] FakeBpc - read_enable_value: false
-11-[default/MSI/platform] Run State "Running"
-4-[default/pok/channel] State changed Initializating => Running
-4-[default/pok/channel] Run State "Running"
running
-4-[default/pok/channel] Run State "Running"
running
BpcSubscriber::process: "pza/default/pok/channel/cmds/set"
BpcSubscriber::process: b"{\"voltage\":{\"value\":0.429385971604732}}"
-10-[default/pok/channel] FakeBpc - write_voltage_value: 0.429385971604732
-10-[default/pok/channel] FakeBpc - read_voltage_value: 0.429385971604732
BpcSubscriber::process: "pza/default/pok/channel/cmds/set"
BpcSubscriber::process: b"{\"current\":{\"value\":0.3087719365170129}}"
-4-[default/pok/channel] FakeBpc - write_current_value: 0.3087719365170129
-4-[default/pok/channel] FakeBpc - read_current_value: 0.3087719365170129
BpcSubscriber::process: "pza/default/pok/channel/cmds/set"
BpcSubscriber::process: b"{\"enable\":{\"value\":true}}"
-4-[default/pok/channel] FakeBpc - write_enable_value: false
-4-[default/pok/channel] FakeBpc - read_enable_value: true
BpcSubscriber::process: "pza/default/pok/channel/cmds/set"
BpcSubscriber::process: b"{\"enable\":{\"value\":false}}"
-10-[default/pok/channel] FakeBpc - write_enable_value: true
-10-[default/pok/channel] FakeBpc - read_enable_value: false
BpcSubscriber::process: "pza/default/pok/channel/cmds/set"
BpcSubscriber::process: b"{\"enable\":{\"value\":true}}"
-4-[default/pok/channel] FakeBpc - write_enable_value: false
-4-[default/pok/channel] FakeBpc - read_enable_value: true
BpcSubscriber::process: "pza/default/pok/channel/cmds/set"
BpcSubscriber::process: b"{\"enable\":{\"value\":false}}"
-12-[default/pok/channel] FakeBpc - write_enable_value: true
-12-[default/pok/channel] FakeBpc - read_enable_value: false
BpcSubscriber::process: "pza/default/pok/channel/cmds/set"
BpcSubscriber::process: b"{\"enable\":{\"value\":true}}"
-10-[default/pok/channel] FakeBpc - write_enable_value: false
-10-[default/pok/channel] FakeBpc - read_enable_value: true
BpcSubscriber::process: "pza/default/pok/channel/cmds/set"
BpcSubscriber::process: b"{\"enable\":{\"value\":false}}"
-4-[default/pok/channel] FakeBpc - write_enable_value: true
-4-[default/pok/channel] FakeBpc - read_enable_value: false
BpcSubscriber::process: "pza/default/pok/channel/cmds/set"
BpcSubscriber::process: b"{\"current\":{\"value\":0.6425438596491232}}"
-10-[default/pok/channel] FakeBpc - write_current_value: 0.6425438596491232
-10-[default/pok/channel] FakeBpc - read_current_value: 0.6425438596491232

@Darcraytore1
Copy link
Member Author

@XdoctorwhoZ I have still the same error :

warning: panduza-rust-platform (bin "panduza-rust-platform") generated 29 warnings (run cargo fix --bin "panduza-rust-platform" to apply 21 suggestions)
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
Running target/debug/panduza-rust-platform
-1-[F] # Device factory initialization
-1-[F] List of producers:
-1-[F] - korad.ka3005
-1-[F] - new hunter
-1-[F] - panduza.server
-1-[F] - panduza.voxpower_inhibiter
-1-[F] - panduza.fake_power_supply
-1-[P] Platform Version ...
-3-[P] Booting...
-3-WARN: Unsupported system bu try with unix path anyway !
-3-WARN: Unsupported system bu try with unix path anyway !
-3-[P] Loading tree file: "/etc/panduza/tree.json"
-3-[P] - Tree Json content -
{
"devices": [
{
"name": "empty",
"ref": "panduza.fake_power_supply",
"settings": {}
}
]
}
-3-[test-platform] Connection created
-1-[P] New task created ! [AbortHandle { id: Id(7) }]
-3-[test-platform] Connection started
-3-[P] - Try to create device -
{
"name": "ubuntuV2222",
"ref": "panduza.server"
}
-3-[default/ubuntuV2222] Device created
-3-[default/ubuntuV2222] Start Interfaces...
-3-[default/ubuntuV2222/platform] Registering attribute "info"
-1-[P] New task created ! [AbortHandle { id: Id(9) }]
-1-[P] New task created ! [AbortHandle { id: Id(10) }]
-3-[default/ubuntuV2222/platform] Interface started
-3-[default/ubuntuV2222] Interfaces started !
-3-[P] Boot Success!
-3-[P] Reloading Configuration Tree...
-3-[P] - Try to create device -
{
"name": "empty",
"ref": "panduza.fake_power_supply",
"settings": {}
}
-3-[default/empty] Device created
-3-[default/empty] Start Interfaces...
-3-[default/empty/channel] Registering attribute "info"
-3-[default/empty/channel] Interface started
-1-[P] New task created ! [AbortHandle { id: Id(11) }]
-3-[default/empty] Interfaces started !
-2-[default/ubuntuV2222/platform] Run State "Connecting"
-3-[P] Reloading Success!
-1-[P] New task created ! [AbortHandle { id: Id(12) }]
-2-[default/empty/channel] Run State "Connecting"
BpcSubscriber::process: "pza/default/empty/channel/cmds/set"
BpcSubscriber::process: b"{"enable":{"value":true}}"
-3-[default/empty/channel] FakeBpc - write_enable_value: false
-3-[default/empty/channel] FakeBpc - read_enable_value: true
thread 'tokio-runtime-worker' panicked at src/interface/mod.rs:247:54:
called Option::unwrap() on a None value
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
-1-ERROR: Join failed: task 12 panicked

@Darcraytore1
Copy link
Member Author

Ok with the patch you made for Lucas it's currently working.

-1-[F] # Device factory initialization
-1-[F] List of producers:
-1-[F] - korad.ka3005
-1-[F] - new hunter
-1-[F] - panduza.server
-1-[F] - panduza.voxpower_inhibiter
-1-[F] - panduza.fake_power_supply
-1-[P] Platform Version ...
-3-[P] Booting...
-3-WARN: Unsupported system ("linux") but try with unix path anyway !
-3-WARN: Unsupported system ("linux") but try with unix path anyway !
-3-[P] Loading tree file: "/etc/panduza/tree.json"
-3-[P] - Tree Json content -
{
"devices": [
{
"name": "empty",
"ref": "panduza.fake_power_supply",
"settings": {}
}
]
}
-3-[test-platform] Connection created
-3-[P] - Try to create device -
{
"name": "ubuntuV2222",
"ref": "panduza.server"
}
-1-[P] New task created ! [AbortHandle { id: Id(7) }]
-3-[default/ubuntuV2222] Device created
-3-[default/ubuntuV2222] Start Interfaces...
-3-[default/ubuntuV2222/platform] Registering attribute "info"
-3-[default/ubuntuV2222/platform] Interface started
-1-[P] New task created ! [AbortHandle { id: Id(9) }]
-3-[default/ubuntuV2222] Interfaces started !
-1-[P] New task created ! [AbortHandle { id: Id(10) }]
-3-[P] Boot Success!
-3-[P] Reloading Configuration Tree...
-3-[P] - Try to create device -
{
"name": "empty",
"ref": "panduza.fake_power_supply",
"settings": {}
}
-3-[default/empty] Device created
-3-[default/empty] Start Interfaces...
-2-[default/ubuntuV2222/platform] Run State "Connecting"
-3-[default/empty/channel] Registering attribute "info"
-3-[default/empty/channel] Interface started
-1-[P] New task created ! [AbortHandle { id: Id(11) }]
-3-[default/empty] Interfaces started !
-1-[P] New task created ! [AbortHandle { id: Id(12) }]
-2-[default/ubuntuV2222/platform] State changed Connecting => Initializating
-2-[default/ubuntuV2222/platform] Run State "Initializating"
-2-[default/ubuntuV2222/platform] Registering attribute "dtree"
-3-[P] Reloading Success!
-2-[default/ubuntuV2222/platform] Registering attribute "devices"
-2-[default/ubuntuV2222/platform] State changed Initializating => Running
-3-[default/empty/channel] Run State "Connecting"
-2-[default/ubuntuV2222/platform] Run State "Running"
-2-[default/ubuntuV2222/platform] Run State "Running"
-3-[default/empty/channel] State changed Connecting => Initializating
-3-[default/empty/channel] Run State "Initializating"
-3-[default/empty/channel] Registering attribute "enable"
-3-[default/empty/channel] Registering attribute "voltage"
-3-[default/empty/channel] Registering attribute "current"
-3-[default/empty/channel] FakeBpc - read_enable_value: false
-3-[default/empty/channel] State changed Initializating => Running
-3-[default/empty/channel] Run State "Running"
running
-3-[default/empty/channel] Run State "Running"
running
BpcSubscriber::process: "pza/default/empty/channel/cmds/set"
BpcSubscriber::process: b"{"enable":{"value":true}}"
-2-[default/empty/channel] FakeBpc - write_enable_value: false
-2-[default/empty/channel] FakeBpc - read_enable_value: true
BpcSubscriber::process: "pza/default/empty/channel/cmds/set"
BpcSubscriber::process: b"{"enable":{"value":false}}"
-3-[default/empty/channel] FakeBpc - write_enable_value: true
-3-[default/empty/channel] FakeBpc - read_enable_value: false
BpcSubscriber::process: "pza/default/empty/channel/cmds/set"
BpcSubscriber::process: b"{"enable":{"value":true}}"
-2-[default/empty/channel] FakeBpc - write_enable_value: false
-2-[default/empty/channel] FakeBpc - read_enable_value: true
BpcSubscriber::process: "pza/default/empty/channel/cmds/set"
BpcSubscriber::process: b"{"enable":{"value":false}}"
-3-[default/empty/channel] FakeBpc - write_enable_value: true
-3-[default/empty/channel] FakeBpc - read_enable_value: false
BpcSubscriber::process: "pza/default/empty/channel/cmds/set"
BpcSubscriber::process: b"{"enable":{"value":true}}"
-2-[default/empty/channel] FakeBpc - write_enable_value: false
-2-[default/empty/channel] FakeBpc - read_enable_value: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants