Background:
cbj-hub
is the hub part of CyBear Jinni ecosystem, it is in charge of finding and controlling devices from different vendors in one easy-to-use app and even expanding the functionality of the devices.
It is open source and very similar to home assistant with more focus on simplicity (especially in setting up things).
Plug And Explanation:
One of the ways the Hub finds smart devices that can be added automatically to the home is by device hostname. The app uses a dart package that pings all IPs in the network and waits for a response. If a response is found (device exist in that IP) the program will try to find the host name of that device. In case the hostname contains the name of a specific vendor the program can understand that this vendor exists and try to send a request suited to that vendor to that device IP to get his info to see if it is a supported device type.
I am getting an error
ProcessException: Permission denied
for the command ping, see the full log at the end.
snappy-debug.security scanlog
suggest adding one of the following plugs in order to fix the permission denied error
* add one of 'firewall-control, network-control, network-observe' to 'plugs'
Snap Permission Log:
:~$ snappy-debug.security scanlog
INFO: Following '/var/log/syslog'. If have dropped messages, use:
INFO: $ sudo journalctl --output=short --follow --all | sudo snappy-debug
= AppArmor =
Time: Aug 9 22:13:59
Log: apparmor="DENIED" operation="open" profile="snap.cbj-hub.cbj-hub" name="/etc/" pid=11461 comm="DartWorker" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
File: /etc/ (read)
Suggestions:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON
* adjust snap to use snap layouts (https://forum.snapcraft.io/t/snap-layouts/7207)
= AppArmor =
Time: Aug 9 22:13:59
Log: apparmor="DENIED" operation="open" profile="snap.cbj-hub.cbj-hub" name="/usr/bin/timeout" pid=11513 comm="DartWorker" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
File: /usr/bin/timeout (read)
Suggestions:
* adjust snap to ship 'timeout'
* adjust program to use relative paths if the snap already ships 'timeout'
= AppArmor =
Time: Aug 9 22:13:59
Log: apparmor="DENIED" operation="open" profile="snap.cbj-hub.cbj-hub" name="/usr/bin/timeout" pid=11515 comm="DartWorker" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
File: /usr/bin/timeout (read)
Suggestions:
* adjust snap to ship 'timeout'
* adjust program to use relative paths if the snap already ships 'timeout'
= AppArmor =
Time: Aug 9 22:13:59
Log: apparmor="DENIED" operation="exec" profile="snap.cbj-hub.cbj-hub" name="/usr/bin/ping" pid=11543 comm="DartWorker" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
File: /usr/bin/ping (exec)
Suggestions:
* adjust snap to ship 'ping'
* adjust program to use relative paths if the snap already ships 'ping'
* add one of 'firewall-control, network-control, network-observe' to 'plugs'
Program Crash Log:
Check that /usr/bin/timeout exists
command: timeout 2s avahi-browse --all -p
Check that /usr/bin/timeout exists
command: timeout 2s mdns-scan
You can make the mdns process better by installing `mdns-scan`
Unhandled exception:
ProcessException: Permission denied
Command: ping -O -n -W 1 -i 1 -t 255 -c 1 192.168.31.1
#0 _ProcessImpl._start (dart:io-patch/process_patch.dart:401)
#1 Process.start (dart:io-patch/process_patch.dart:38)
#2 BasePing.platformProcess (package:dart_ping/src/ping/base_ping.dart:71)
#3 BasePing._onListen (package:dart_ping/src/ping/base_ping.dart:86)
#4 _runGuarded (dart:async/stream_controller.dart:814)
#5 _StreamController._subscribe.<anonymous closure> (dart:async/stream_controller.dart:692)
#6 _BufferingStreamSubscription._guardCallback (dart:async/stream_impl.dart:417)
#7 _StreamController._subscribe (dart:async/stream_controller.dart:691)
#8 _ControllerStream._createSubscription (dart:async/stream_controller.dart:827)
#9 _StreamImpl.listen (dart:async/stream_impl.dart:473)
#10 _StreamIterator._initializeOrDone (dart:async/stream_impl.dart:1028)
#11 _StreamIterator.moveNext (dart:async/stream_impl.dart:1004)
#12 HostScanner._getHostFromPing (package:network_tools/src/host_scanner.dart)
#13 HostScanner.getAllPingableDevices (package:network_tools/src/host_scanner.dart:41)
<asynchronous suspension>
CyBear Jinni code is open source, here are links to the project and snap.
Link to the repo CyBear Jinni Hub
Link to the snap repo CyBear Jinni Hub Snap repo
Link to the snapstore snap CyBear Jinni Smart Home Hub snap