Cbj-hub Can't release menual review panding

My snap is stack at “Promote from uploaded revisions” and can’t move to edge as it need manual review, wasen’t sure about that as I thought that the point of edge is to support confinement devmode but I guess this is good chance for asking for plugs.

Background:
cbj-hub is the hub part of CyBear Jinni ecosystem, it is in charge of controlling devices from different vendors in one easy to use app and even to expand the functionality of the devices.
It is open source and very similar to home assistant with more focuses on simplicity (especially in setting up things).

Plug and explanation:

system-files with read: - /etc

Needed for getting the version and the model of the raspberry/nano-pi, will be shown in the app for the user to know what hub he bought with the exact computer model.

I don’t mind for it to stay at Auto-connect = no as it is not required for the program to work and just add extra info.

system-observe

The user will set up bindings in the app, the hub will recognize the bindings and start actions.
Some bindings can be set to start action when you open program on your computer.
Example: if you opened vlc for more than 3m than start movie scene turn off lights turn AC on and more.

hardware-observe

More info about hardware.
Example: recognize that zigbee dongle is connected (diffrent protocol than WiFi that is used for IoT) and add support controlling zigbee based devices.
For now this can also stay at Auto-connect = no as we currently didn’t add support to control zigbee devices or Bluetooth controlled devices.

avahi-observe

The basic of finding smart devices IP in the network require to detect mDNS/avahi of the devices.

avahi-control

Currently I can’t find dart package that can do such thing like configure avahi if not installed (only search in the network) but it is heavily required for the app/clients to easily find the hub and send LAN requests.
Currently I am using port scan but this is slower and we will move to mDNS in the future, maybe will ask the users to install avahi manually and the program will configure it for them.

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

Regarding system-files - granting read access to all of /etc seems excessive if you are just reading a few pieces of information - instead can this please specify the specific files/paths that are required down to the minimum?

+1 from me for system-observe, hardware-observe and avahi-observe auto-connect as these seem core functions of this snap.

Can you also please explain more about how avahi-control is used in the overall architecture of this snap and the CBJ ecosystem of devices?

1 Like

at least o the Pi using cat /proc/device-tree/model (covered by either system-observe or hardware-observe) will get you the extact model without needing to read from /etc …

the same goes for cat /proc/cpuinfo | grep Model

1 Like

Yes, to get the version from the pi I am using the info in /proc/cpuinfo

For the nanopi I am using
- /etc/armbian-release
- /etc/armbian-image-release

And will update the system-files specifically for them.

avahi-control
I want all the clients (phones, Linux and more) to connect to the hub in the home by using the same mDNS name (like cbj_hub) in all homes since there is one hub per LAN.
For this to happen I need to change the avahi settings to add support for new mDNS name (cbj_hub) and start advertising the new name in the LAN for the clients to connect to.

so your snap would not work on an Ubuntu Core nanopi … or on a debian based, fedora based, OpenSUSE based nanopi install (or on a yocto based one …) … snaps are distro agnostic, you should rather look for something the kernel provides to make your snap not break on non-armbian installs

I didn’t thought about it so first of all thank you @ogra .

Most of the time (for now) the devises aren’t nanopi based so for now I will remove the request for system-files plug and will search for better option when needed to support nanopi devices.

1 Like

BTW:

$ echo $(cat /proc/device-tree/model)
FriendlyARM NanoPi NEO
$

:wink:

2 Likes

Any news? @ogra @alexmurray

+1 from me for auto-connect system-observe and hardware-observe to cbj-hub since those clearly required for the snap to properly operate. +2 votes for, 0 votes against, granting auto-connect for plugging system-observe and hardware-observe to cbj-hub. This is now live.

I am +1 as well for auto-connect avahi-control since its needed to update the avahi settings and advertise as explained. Since avahi-control implies avahi-observe https://github.com/snapcore/snapd/blob/master/interfaces/builtin/avahi_control.go#L131, plugging avahi-control should be enough. Can other @reviewers please vote?

1 Like

+1 from me too for avahi-control as this is a core function for the snap as described earlier.

+2 votes for, 0 votes against. Granting auto-connect of avahi-control to cbj-hub. This is now live.

@guyluz11 you should be able to remove avahi-observe now and everything should work.

Thanks!

1 Like