Implementation of p2p synchronization of different Freedomotic instances. If you turn on a light in instanceA the change is reflected in instanceB. Also moving an object changes its location in both instances.
In details
Each instance has a complete copy of the data so you can turn off the other instances when you want. For sure you’ll loose the “local not replicated plugins” but the system will be online and you will not notice any “recovery delay” because each instance always uses its local data, which are silently synchronized with the others.
Now we have a “state synchronization” but when we’ll refine the mechanism we will have a “completely replicated cache” which is far better than the current system.
To reach this goal we made some changes:
Workaround for now is sharing the data folder on Dropbox and make both instances to read from the same folder to start. No problem if you run both instances from the same PC because they already share a common data folder.
Note
The restapi3 port is still static (9111) so the second Freedomotic instance will not be able to start this plugin. If you run two instances from the same system the problem is automatically solved (the second one cannot start because the port is already in use). If Freedomotic is installed on two RaspberryPis, then restapi plugin should be removed from the other instance before startup.