thx @gleno0h!!
but what is this plugin exactly for? i don’t get it
is it a “ping device” for bluetooth or ip adresses?
-
[Solved] Pimatic Netcheck installation
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
@leader21 said in Pimatic Netcheck installation:
is it a “ping device” for bluetooth or ip adresses?
Yes, kind of. On top of this it provide a rule action provide which allows for checking the presence of a given device and calling another rule in the absence and/or presence case. That quiete smart and we may use a similar pattern for other use cases in the future.
When <some condition> then check <NetCheckDevice> [if present exec rule <RuleID>] [if absent exec rule <RuleID>]
See also https://git.cryhost.de/crycode/pimatic-netcheck/blob/master/README.md
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
thank you for your tipps, i try it tomorrow.
If i understand, the plugin creates a present/absent device for ping or bluetooth or for ping AND bluetooth in one device. So i do not have to have 2 devices, one for bluetooth, one for ping when its a smartphone i want to recognize. In the past i used a DummyShellPresents with a “hcitool scan…” for recognizing bluetooth presents of my smartphone.
-
Hi,
thanks for the created issue @mwittig.
There was a small typo in the package.json file, which prevented the
netcheck-config-schema.coffee
andnetcheck.coffee
files from being added to the npm package.I fixed this and published a new version on npm (v1.0.2). Please try again the installation.
@leader21 said in Pimatic Netcheck installation:
but what is this plugin exactly for?
It can be used to check if a device is present using an ip address (for devices in your WLAN for example), or using the MAC address of a bluetooth device. Also a combination of both is possible where you can choose if only one or all added devices must be present to set the pimatic device to present.
Some apple smartphones turn off WiFi if their screen is off. So you can not detect thier pesence using WLAN, but the bluetooth check works.Additionally you may define some rules. For example to run the check only if your front door is opened and then execute an action if the pimatic device is not present. (Some kind of alarm system.)
@S7EN said in Pimatic Netcheck installation:
If i understand, the plugin creates a present/absent device for ping or bluetooth or for ping AND bluetooth in one device. So i do not have to have 2 devices, one for bluetooth, one for ping when its a smartphone i want to recognize.
That’s right!
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. -
@pmueller thx for your information!
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
@pmueller said in Pimatic Netcheck installation:
Hi,
thanks for the created issue @mwittig.
There was a small typo in the package.json file, which prevented the
netcheck-config-schema.coffee
andnetcheck.coffee
files from being added to the npm package.I fixed this and published a new version on npm (v1.0.2). Please try again the installation.
@leader21 said in Pimatic Netcheck installation:
but what is this plugin exactly for?
It can be used to check if a device is present using an ip address (for devices in your WLAN for example), or using the MAC address of a bluetooth device. Also a combination of both is possible where you can choose if only one or all added devices must be present to set the pimatic device to present.
Some apple smartphones turn off WiFi if their screen is off. So you can not detect thier pesence using WLAN, but the bluetooth check works.Additionally you may define some rules. For example to run the check only if your front door is opened and then execute an action if the pimatic device is not present. (Some kind of alarm system.)
@S7EN said in Pimatic Netcheck installation:
If i understand, the plugin creates a present/absent device for ping or bluetooth or for ping AND bluetooth in one device. So i do not have to have 2 devices, one for bluetooth, one for ping when its a smartphone i want to recognize.
That’s right!
Installation works and Plugin too. Thank you very much!
-
The Plugin does not recognize the bluetooth of an device. I tried pair it with bluetoothctl and after that it worked a while but after rebooting the pi it only works with networkipadress and bluetooth not.
-
Sorry for highjacking this thread, but
When <some condition> then check <NetCheckDevice> [if present exec rule <RuleID>] [if absent exec rule <RuleID>]
This would be nice to have generally for rules like this e.g.:
When <some condition> then [if s.th. is closed set $variableBla = "jagga"] [if s.th. is open set $variableBla = "tuktuk"]
This would save one of two rules. Is this possible?
-
@S7EN said in [Solved] Pimatic Netcheck installation:
The Plugin does not recognize the bluetooth of an device. I tried pair it with bluetoothctl and after that it worked a while but after rebooting the pi it only works with networkipadress and bluetooth not.
Sounds like the pairing is lost after reboot. Your device should be listed in
/var/lib/bluetooth/<raspi-mac>/<device-mac>
after the pairing and after reboot.
Doeshcitool name <MAC>
work after reboot?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. -
@OrTiN said in [Solved] Pimatic Netcheck installation:
Sorry for highjacking this thread, but
When <some condition> then check <NetCheckDevice> [if present exec rule <RuleID>] [if absent exec rule <RuleID>]
This would be nice to have generally for rules like this e.g.:
When <some condition> then [if s.th. is closed set $variableBla = "jagga"] [if s.th. is open set $variableBla = "tuktuk"]
This would save one of two rules. Is this possible?
@mwittig marcus would this be possible for rules in “general” ?
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
@pmueller said in [Solved] Pimatic Netcheck installation:
@S7EN said in [Solved] Pimatic Netcheck installation:
The Plugin does not recognize the bluetooth of an device. I tried pair it with bluetoothctl and after that it worked a while but after rebooting the pi it only works with networkipadress and bluetooth not.
Sounds like the pairing is lost after reboot. Your device should be listed in
/var/lib/bluetooth/<raspi-mac>/<device-mac>
after the pairing and after reboot.
Doeshcitool name <MAC>
work after reboothcitool name <MAC>
works but i cannot get the Smartphone connected to rpi. In bluetoothctl i always get this error:Attempting to connect to 94:65:2D:7B:97:12 Failed to connect: org.bluez.Error.Failed
info <MAC>
saisName: OnePlus 5 Alias: OnePlus 5 Class: 0x5a020c Icon: phone Paired: yes Trusted: yes Blocked: no Connected: no LegacyPairing: no UUID: Dialup Networking (00001103-0000-1000-8000-00805f9b34fb) UUID: OBEX Object Push (00001105-0000-1000-8000-00805f9b34fb) UUID: OBEX File Transfer (00001106-0000-1000-8000-00805f9b34fb) UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb) UUID: PANU (00001115-0000-1000-8000-00805f9b34fb) UUID: NAP (00001116-0000-1000-8000-00805f9b34fb) UUID: Handsfree Audio Gateway (0000111f-0000-1000-8000-00805f9b34fb) UUID: SIM Access (0000112d-0000-1000-8000-00805f9b34fb) UUID: Phonebook Access Server (0000112f-0000-1000-8000-00805f9b34fb) UUID: Message Access Server (00001132-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) UUID: Vendor specific (10000000-328e-0fbb-c642-1aa6699bdada) UUID: Vendor specific (badbadba-dbad-badb-adba-badbadbadbad) Modalias: bluetooth:v001Dp1200d1436
is it possible to descover bluetooth devices only without beeing connected? I had a shell presence device before with code like this…
hcitool name AA:BB:CC:DD:CC:BB |grep -q iPhone_lxz echo 0 echo 1
-
@leader21 said in [Solved] Pimatic Netcheck installation:
@mwittig marcus would this be possible for rules in “general” ?
Well, for a general solution it would be required to have condition expressions as part of the action statement. It should be possible to implement this, but I don’t think the current implementation provides for this. With pimatic-netcheck it is a lot simpler as “if present” are just token tied to a specific behavior.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@S7EN
You don’t need to connect your device. It’s sufficient if it is paired.
The plugin just callshcitool -i hci0 name <MAC>
and checks if a name is returned.If you enable the debug option in the plugin config, you should see debug messages for each check. E.g.
bluetooth <MAC> present (<name>)
orbluetooth <MAC> absent
.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. -
I enabled the option but i didnt see anything from the plugin in debug messages.
-
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 filepimatic-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 usedhcitool
command sometimes don’t get a connection to the device. I will test to usel2ping
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.