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

restore send-and-receive activation status after reboot #62

Open
schmittlauch opened this issue Oct 21, 2020 · 7 comments
Open

restore send-and-receive activation status after reboot #62

schmittlauch opened this issue Oct 21, 2020 · 7 comments

Comments

@schmittlauch
Copy link

A minor convenience issue:
After rebooting the device and re-opening the Contrac app, scan-and-sending tokens still has to be enabled again, no matter whether it had been enabled before the reboot or not.

While opening the app manually after boot is necessary anyways, remembering the proximity-scan activation status is a minor convenience improvement.

@llewelld
Copy link
Owner

This sounds like a bug as the status should stick. I'll look into it, but it would be helpful to have a copy of the logs generated when shutting down contracd. The easiest way to collect them is probably something like this:

systemctl --user stop contracd
contracd
... [logs are generated]
^C
... [some more logs as the process quits]
systemctl --user start contracd

The ^C in the middle of that is Ctrl-C to stop the service.

If you could post them here, that would be a big help.

@schmittlauch
Copy link
Author

$ contracd
[D] unknown:0 - QML debugging is enabled. Only use this in a safe environment.
[D] main:31 - contrac VERSION string: 0.7.2
[D] main:32 - VERSION_MAJOR: 0
[D] main:33 - VERSION_MINOR: 7
[D] main:34 - VERSION_BUILD: 2
[D] Settings::Settings:19 - Settings created:  "/home/nemo/.config/contracd/contracd.conf"
[D] Settings::upgrade:148 - Existing settings file version:  0
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:81 - Contrac
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:83 - Controller
[D] BleAdvertisement::setServiceData:178 - Service data value:  "48656c6c6f"
[D] BleAdvertisement::registerDBus:45 - Registering:  "/uk/co/flypig/advert1"
[D] BleAdvertisement::registerDBus:48 - Connecting
[D] BleAdvertisement::registerDBus:56 - Registering object
[D] BleAdvertisementManager::connectDBus:28 - Registering interface
[D] BleAdvertisementManager::connectDBus:35 - Connecting property change
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:85 - Scanner
[D] BleScanner::BleScanner:17 - Registering interface
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:87 - Contacts
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:89 - Timer
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:94 - Load
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:103 - Using existing tracing key
[D] ContactStorage::onTimeChanged:38 - Storage day set to  18556
[D] ContactStorage::harvestOldData:107 - Harvesting file:  "00000000.dat"
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:108 - Connections
[D] DBusInterface::DBusInterface:13 - CONTRAC: Initialising the dbus interface
[D] DBusInterface::DBusInterface:34 - CONTRAC: service registration:  false
[D] DBusInterface::DBusInterface:41 - CONTRAC: DBus registered:  false
[D] DBusInterface::DBusInterface:44 - CONTRAC: Error initialising dbus interface
[D] DBusInterface::DBusInterface:48 - Starting automatically
[D] BleScanner::applyDiscoveryFilter:97 - Setting up discovery filter
[D] Controller::registerAdvert:42 - Registering advertisement
[D] BleAdvertisementManager::registerAdvertisement:65 - Registering advertisement:  "/uk/co/flypig/advert1"
[D] main:58 - Execution started
[D] BleScanner::applyDiscoveryFilter()::<lambda:108 - DBus SetDiscoveryFilter returned
[D] BleScanner::applyDiscoveryFilter()::<lambda:123 - No error
[D] BleScanner::startDiscovery:147 - Starting discovery
[D] BleScanner::startDiscovery()::<lambda:155 - DBus StartDiscovery returned
[D] BleScanner::startDiscovery()::<lambda:162 - No error
[D] BleAdvertisementManager::onPropertiesChanged:53 - Property changed
[D] BleAdvertisementManager::onPropertiesChanged:54 -    Interface:  "org.bluez.LEAdvertisingManager1"
[D] BleAdvertisementManager::onPropertiesChanged:56 -    Changed:  "ActiveInstances"  =  QVariant(uchar, 2)
[D] BleAdvertisementManager::onPropertiesChanged:56 -    Changed:  "SupportedInstances"  =  QVariant(uchar, 3)
[D] BleAdvertisementManager::registerAdvertisement(BleAdvertisement*)::<lambda:75 - DBus RegisterAdvertisement call returned
[D] BleAdvertisementManager::registerAdvertisement(BleAdvertisement*)::<lambda:82 - No error
[D] ExposureNotification::intervalUpdate:572 - intervalUpdate
[D] ExposureNotification::intervalUpdate:572 - intervalUpdate

@llewelld
Copy link
Owner

Thank you! I see "Error initialising dbus interface" in there, which suggests you have two copies running. Did you definitely run systemctl --user stop contracd first?

@schmittlauch
Copy link
Author

schmittlauch commented Oct 21, 2020

In addition, after a reboot contracd seems to be running already – before having opened harbour-contrac – but after opening the app it still displays the deactivated status.

$ ps aux|grep contrac
nemo      6701  0.0  0.1  55996  5936 ?        Ssl  21:37   0:00 /usr/bin/contracd
nemo      6950  0.0  0.1  55996  5936 ?        Ssl  21:37   0:00 /usr/bin/contracd
nemo      7543  0.0  0.0   5748   948 ?        Ss   21:38   0:00 /usr/bin/invoker --type=generic /usr/bin/contracd

@schmittlauch
Copy link
Author

Thank you! I see "Error initialising dbus interface" in there, which suggests you have two copies running. Did you definitely run systemctl --user stop contracd first?

Yes:

[nemo@Pro1 ~]$ systemctl --user status contracd  
● contracd.service - Contrac daemon
   Loaded: loaded (/usr/lib/systemd/user/contracd.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Wed 2020-10-21 21:43:03 CEST; 6s ago
  Process: 7543 ExecStart=/usr/bin/invoker --type=generic /usr/bin/contracd (code=killed, signal=TERM)
 Main PID: 7543 (code=killed, signal=TERM)
[nemo@Pro1 ~]$ contracd
[D] unknown:0 - QML debugging is enabled. Only use this in a safe environment.
[D] main:31 - contrac VERSION string: 0.7.2
[D] main:32 - VERSION_MAJOR: 0
[D] main:33 - VERSION_MINOR: 7
[D] main:34 - VERSION_BUILD: 2
[D] Settings::Settings:19 - Settings created:  "/home/nemo/.config/contracd/contracd.conf"
[D] Settings::upgrade:148 - Existing settings file version:  0
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:81 - Contrac
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:83 - Controller
[D] BleAdvertisement::setServiceData:178 - Service data value:  "48656c6c6f"
[D] BleAdvertisement::registerDBus:45 - Registering:  "/uk/co/flypig/advert1"
[D] BleAdvertisement::registerDBus:48 - Connecting
[D] BleAdvertisement::registerDBus:56 - Registering object
[D] BleAdvertisementManager::connectDBus:28 - Registering interface
[D] BleAdvertisementManager::connectDBus:35 - Connecting property change
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:85 - Scanner
[D] BleScanner::BleScanner:17 - Registering interface
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:87 - Contacts
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:89 - Timer
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:94 - Load
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:103 - Using existing tracing key
[D] ContactStorage::onTimeChanged:38 - Storage day set to  18556
[D] ContactStorage::harvestOldData:107 - Harvesting file:  "00000000.dat"
[D] ExposureNotificationPrivate::ExposureNotificationPrivate:108 - Connections
[D] DBusInterface::DBusInterface:13 - CONTRAC: Initialising the dbus interface
[D] DBusInterface::DBusInterface:34 - CONTRAC: service registration:  false
[D] DBusInterface::DBusInterface:41 - CONTRAC: DBus registered:  false
[D] DBusInterface::DBusInterface:44 - CONTRAC: Error initialising dbus interface
[D] DBusInterface::DBusInterface:48 - Starting automatically
[D] BleScanner::applyDiscoveryFilter:97 - Setting up discovery filter
[D] Controller::registerAdvert:42 - Registering advertisement
[D] BleAdvertisementManager::registerAdvertisement:65 - Registering advertisement:  "/uk/co/flypig/advert1"
[D] main:58 - Execution started
[D] BleScanner::applyDiscoveryFilter()::<lambda:108 - DBus SetDiscoveryFilter returned
[D] BleScanner::applyDiscoveryFilter()::<lambda:123 - No error
[D] BleScanner::startDiscovery:147 - Starting discovery
[D] BleScanner::startDiscovery()::<lambda:155 - DBus StartDiscovery returned
[D] BleScanner::startDiscovery()::<lambda:162 - No error
[D] BleAdvertisementManager::onPropertiesChanged:53 - Property changed
[D] BleAdvertisementManager::onPropertiesChanged:54 -    Interface:  "org.bluez.LEAdvertisingManager1"
[D] BleAdvertisementManager::onPropertiesChanged:56 -    Changed:  "ActiveInstances"  =  QVariant(uchar, 2)
[D] BleAdvertisementManager::onPropertiesChanged:56 -    Changed:  "SupportedInstances"  =  QVariant(uchar, 3)
[D] BleAdvertisementManager::registerAdvertisement(BleAdvertisement*)::<lambda:75 - DBus RegisterAdvertisement call returned
[D] BleAdvertisementManager::registerAdvertisement(BleAdvertisement*)::<lambda:82 - No error
[D] BleScanner::onInterfaceAdded:87 - Beacon found:  "1c3b59560b4222f12c0304b4474a633c9ee82b7c"
[D] ExposureNotification::beaconDiscovered:547 - Beacon discovered
[D] ExposureNotification::beaconDiscovered:551 - RPI: "1c3b59560b4222f12c0304b4474a633c"
[D] ExposureNotification::beaconDiscovered:553 - AEM: "9ee82b7c"
[D] DayStorage::addContact:189 - Outputting to file:  "/home/nemo/.config/contracd/contracd/contacts/0000487c.dat"
[D] DBusInterface::incrementReceiveCount:163 - CONTRAC: incrementReceiveCount()
[D] BleScanner::onInterfaceAdded:87 - Beacon found:  "ce718501d068fa3785fe7ab30adf43aad6807fa6"
[D] ExposureNotification::beaconDiscovered:547 - Beacon discovered
[D] ExposureNotification::beaconDiscovered:551 - RPI: "ce718501d068fa3785fe7ab30adf43aa"
[D] ExposureNotification::beaconDiscovered:553 - AEM: "d6807fa6"
[D] DayStorage::addContact:189 - Outputting to file:  "/home/nemo/.config/contracd/contracd/contacts/0000487c.dat"
[D] DBusInterface::incrementReceiveCount:163 - CONTRAC: incrementReceiveCount()
[D] ExposureNotification::intervalUpdate:572 - intervalUpdate
[D] ExposureNotification::intervalUpdate:572 - intervalUpdate
^CReceived SIGINT signal
[D] DBusInterface::~DBusInterface:69 - CONTRAC: DBus unregistration:  false
[D] DBusInterface::~DBusInterface:72 - CONTRAC: Error unregistering service
[D] Contrac::~Contrac:42 - ~Contrac
[D] Controller::~Controller:33 - ~Controller() start
[D] BleAdvertisement::~BleAdvertisement:37 - ~BleAdvertisement()
[D] Controller::~Controller:36 - ~Controller() finish
[D] BleAdvertisementManager::~BleAdvertisementManager:41 - ~BleAdvertisementManager() start
[D] BleAdvertisementManager::~BleAdvertisementManager:48 - ~BleAdvertisementManager() finish
[D] main:69 - Execution finished: 0
[D] Settings::~Settings:34 - Deleted settings
[D] main:71 - Deleted app

@llewelld
Copy link
Owner

For some reason it's failing to register its dbus interface:

[D] DBusInterface::DBusInterface:13 - CONTRAC: Initialising the dbus interface
[D] DBusInterface::DBusInterface:34 - CONTRAC: service registration:  false
[D] DBusInterface::DBusInterface:41 - CONTRAC: DBus registered:  false
[D] DBusInterface::DBusInterface:44 - CONTRAC: Error initialising dbus interface

This seems to be causing your problem: the scanning is actually active, but the UI doesn't know about it. Same for the sent/received values being 0.

I'm not sure why this would happen I'm afraid and will need to think about it. I do suggest updating to version 0.7.4, but I don't expect it to fix this particular issue I'm afraid.

@Matzt
Copy link

Matzt commented Nov 5, 2020

I do have the same problem on Sony XA2, SFOS 3.4.0.24 and Contrac 0.7.4. If I can provide any useful Information please let me know.

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

No branches or pull requests

3 participants