Did you restart pimatic after enabling the debug option?
The debug messages in the frontend are only shown if the log page is open when they appear.
You should find all debug messages also in the log file pimatic-daemon.log
.
[Solved] Pimatic Netcheck installation
Did you restart pimatic after enabling the debug option?
The debug messages in the frontend are only shown if the log page is open when they appear.
You should find all debug messages also in the log file pimatic-daemon.log
.
pimatic-radiohead - Build your own wire or radio networks.
pimatic-pcf8574 - Use one or more PCF8574 portexpander ICs.
pimatic-netcheck - Check if e.g. smartphones are present using ping and/or bluetooth.
Now i get debug messages. I often get an error “… netcheck done but failed” and my graph for present/absent has a lots of gaps. Smartphone is always on and always connected to my smartwatch too. The Smartphone has Bluetooth 5.0.
Edit: I checked every 5 Seconds, i try it now with a 60 Seconds check and report what happens.
Edit2: Also with 60 Seconds it loses connection after a while
The debug message netcheck done but failed
means, that the check is completed but one (or all, depending on config) device is not present.
5 seconds are very short. In my tests 10 seconds (10000 ms in the config) worked fine.
Can you insert the following line to your crontab (crontab -e
) to run an extra commandline check every minute and log the results to a file? (replace <MAC>
with your mac address)
* * * * * [ "$(sudo hcitool name <MAC>)" == "" ] && echo "$(date) absent" || echo "$(date) present" >> ~/netcheck-test.txt
This should create a file named netcheck-test.txt
in your home directory. After some minutes it should contain lines like this:
So 24. Sep 19:01:02 CEST 2017 present
So 24. Sep 19:02:02 CEST 2017 present
So 24. Sep 19:03:02 CEST 2017 present
Please check if this also reports absent if your device is marked as absent in pimatic.
pimatic-radiohead - Build your own wire or radio networks.
pimatic-pcf8574 - Use one or more PCF8574 portexpander ICs.
pimatic-netcheck - Check if e.g. smartphones are present using ping and/or bluetooth.
Okay i created the crontab and will report what happens over the hours.
I did some testing using different devices, configs etc. and could reproduce your issue.
The used hcitool
command sometimes don’t get a connection to the device. I will test to use l2ping
instead.
pimatic-radiohead - Build your own wire or radio networks.
pimatic-pcf8574 - Use one or more PCF8574 portexpander ICs.
pimatic-netcheck - Check if e.g. smartphones are present using ping and/or bluetooth.
Yes, I have the same issues. For a few seconds hcitool get no connection and in my option if you have both checks, Bluetooth and wifi then the Bluetooth check does not work so. So I made a new device only with Bluetooth check and it worked except of sometimes.
I’ve published a new version 1.1.0 to npm which uses l2ping
for the bluetooth checks.
In my tests this did the job more reliable and always detected the devices if they were in range. Only if a device is nearly out of range, it’s sometime detected as present and sometimes as absent.
There’s also a new option for the NetCheckDevice called bluetoothUseSudo. You should enable this, if your pimatic isn’t started as root, because the l2ping needs root privileges.
pimatic-radiohead - Build your own wire or radio networks.
pimatic-pcf8574 - Use one or more PCF8574 portexpander ICs.
pimatic-netcheck - Check if e.g. smartphones are present using ping and/or bluetooth.