fablab-bergamo / rfid-database-interface

1 stars 0 forks source link

Server requirements for V1.0 #2

Open PBrunot opened 1 year ago

PBrunot commented 1 year ago

Following @valerionew suggestion, I am drafting here the requirements for V1.0 version of FabLab machine management solution.

Users management

Machines management

Maintenance & Admin

Boards API

Connectivity

Others requirements

Open points:

valerionew commented 1 year ago

I was about to add this to https://github.com/fablab-bergamo/rfid-arduino/issues/4 but i figured it would be more relevant here.

Are we foreseeing the case where the power of the machine is lost but the power of the server is not? Do we have a keepalive? If not, would it be enough for the machine to reconnect to the server? If that's the case, could a device "deauth" another one if they use the same name/id?

PBrunot commented 1 year ago

I think machine and board will share the same power source. If board goes offline and server is online, nothing would happen. Also I noticed MQTT broker has its own keepalive protocol with clients. When so when board comes back online, it will reconnect to the server and subscribe to the machine topic. In the case of different boards subscribing the same machine topc : first, it is a configuration error, as boards are physically connected to only one machine. To handle gracefully this kind of issues, I will investigate if MQTT broker can be configured to allow max 1 subscriber per topic, so that the second board will not be able to subscribe successfully the machine topic if one board already owns it I don't think we will have ever the case of a machine "blocked" because the server thinks another boards owns it because 1) machine free/not free is managed by the board and notified to the server 2) the MQTT keepalive will take care of freeing the topic.

valerionew commented 1 year ago

To handle gracefully this kind of issues, I will investigate if MQTT broker can be configured to allow max 1 subscriber per topic, so that the second board will not be able to subscribe successfully the machine topic if one board already owns it

I guess the proper way of doing this would be some sort of authentication. But we can definitely push this to the V2