Closed ramizh closed 5 years ago
Sorry for late reply after Easter-Holidays! Ok, that's strange! The adapter sends a scan via Noble BT-module and this module normally lists the devices found. If it goes up within one scan more than once it could be only if Noble lists the same device multiple times, but if it goes down multiple times then it's strange because it cannot 'be not here' multiple times! I hope you are not running BLE-Adapter at the same time because it also uses Noble and interferes with Radar. This is the only problem I know at the moment. The only other idea I have is that Noble did not finish the scan in the 30 seconds and is re-scanning before finishing.
Can you log the value with history and look when and how it happens and see the history?
No worries! Happy Easter btw! I thought I attached a screenshot of the logs but seems that I forgot, here is the log when posting this issue. I did not have BLE before but after I had this issue I installed it to try it, the issue continued but now BLE is removed, I will monitor the log and send another one later on.
**Just in case BLE will interfere now, is there a way to make sure its completely removed other than removing the instance/deleting the adapter?
Ok, good to see. Actually G-Tags are BT-LE and only Noble can find them. Other BT devices can answer also to l2ping command but I see in your log that l2ping generates a lot of errors, even some like 'operation already in progress'... The host is down can happen if the device is out of reach, others should not happen.
Can you check with 'sudo l2ping -c1 BTMACADDRESS' on commandline if it works for your devices which are near? CHeck also how long it takes if a device is not here. If you have too many devices to test which take a too long time then we may get in conflict with the 30 seconds. L2ping takes up to 7 seconds for me if a device is not ready and completes in 2-3 seconds if a device is here and answers (like my mobile at the moment).. How many devices do you test and can it be that they need more than the 30 seconds?
Correction: I used radar for my iPhone without having BLE on, when I got the Gigaset Keeper I used BLE to get the MAC address of my device (stupid, i know since I could have simply checked unknown BT object in Radar). Anyhow and the log I posted above is when BLE was still installed, so as you said maybe BLE interfered and it was scanning during other scans. I will test it through out the day tomorrow and see if the problem persists, for now I will also keep scans at 30 sec intervals.
Okay i posted before reading your reply.
l2ping actually caused me a huge network issue when my Raspberry Pi 3 was working on WiFi, while its on WiFi every time the l2ping command is sent (also manually) it jams my whole network, anything streaming on the internet or on local network (apple tv, chromecast ...etc) will start lagging for few seconds and then it stops. This happens every time I run sudo l2ping with BTMAC. After days of trying to solve it, it turns out that the issue only happens when the Pi is on Wifi and I couldn't find a reason for it anywhere. For now my Pi is connected over ethernet and the problem does not occur.
For now i only have 2 devices on Radar, later on there will be 4. in total. When entering sudo l2ping directly it does not take that long to give back a result, so I doubt that it needs more than 30 seconds. As you said and as I wrote in the other reply maybe BLE is indeed causing the problem, does BLE use l2ping as well?
Edit: checked logs again while BLE not installed and the error with "l2ping .... operation already in progress" still exists.
If not then I am not sure why it generates a lot of errors. Any other Ideas regarding that?
Sorry for bothering you with long text!!! Thanks in advance!
l2ping should not generate anything on the network (W-LAN), it pings only on Bluetooth and tries to find a certain bluetooth-MAC!
Anyhow, when new Raspi 3+ was announced I have seen a test comparison of his W-Lan and the old Raspi-3 one: The old Raspi could handle only the first 3-4 channels of W-Lan very well, so if your router used a higher one it was generating a lot of error-retry traffic. Now I know as well why I had problems also!
Exactly I found it weird that something that just pings BT is affecting my network, but literally every time I type in Putty l2ping -c1 "BTMAC" and press enter, network jams, and 100% reproducible.
Anyhow I am checking the logs further now, I have restarted my Pi and set Radar to 60 seconds. The "operation already in progress" keeps popping out.
radar.0 | 2018-04-09 22:59:45.465 | debug | Noble found Gigaset |
---|---|---|---|
radar.0 | 2018-04-09 22:59:14.461 | debug | l2ping for ***_iPhone err: "Error: Command failed: l2ping -c1 6X:XX:XX:XX:XX Can't connect: Operation already in progress " |
radar.0 | 2018-04-09 22:59:14.321 | debug | Error: Command failed: l2ping -c1 6X:XX:XX:XX:XX Can't connect: Operation already in progress |
On the other side the Gigaset is counting normally with no issues so far. (usually one of the issues happen within few minutes) I will keep monitoring it and keep you posted! As for the errors I have no clue :/
Okay update about Gigaset, so today in the morning the count was at 114 and then i refreshed the page and suddenly it switches the .here to false and the count is suddenly -18. For my iPhone it was also -18 which didnt make sense since BT on my phone was off since yesterday evening and the count was at about -870 or so.
I don't know what causes this sudden change but its causing my presence scripts to react to false information.
Ramizh, did you set your iPhone IP also to watch? if yes, it will flag it .here if either the BT or the PI is visible.
I really have a problem generating the error message you have: '... Operation already in progress '. I never get this, and it's from l2ping internally. Do you get it only with iPhone?
p.s.: On my list for new Radar2-Adapter is to support also IPV6 which many services start to use now.
Hello,
I have not set any IPs in the settings, I only use Radar for BT devices. Although its a very weird error but it doesn't really affect the functionality at the moment since the Phone with BT works 99% normally. My bigger issue is with the Gigaset Keeper which still persists and its limiting me from using certain scripts the relate to presence (i.e check if lights are off if no one is home, if on turn off/ turn hallway lights on when someone arrives home). Unfortunately without a stable reaction in Radar those wont work properly. (I am happy and open for alternatives if you know any to realize the functionalities I need xD)
Thanks again for putting the time in this!!!
Hello,
Any new ideas by any chance?
I cannot reproduce the problem in my environment at the moment, the only difference for me is that I use BT 4.0 USB sticks instead of the built in Raspi BT because I use and test on different older Raspi's and also OrangepPi's .
Hello Frankjoke,
I know you havent been able to reproduce the problem, but I got another set if Gigaset Keepers and I tried out with them, same issue for the count number happens. Now the the device is found it switches to true but the count stays at the negative number of the previous state. Has anyone else reported such a problem?
Please switch to radar2 adapter. I will not make changes to older radar anymore.
Okay first of thanks for the great adapter and sorry for the long description!
I just got a Gigaset Keeper and set it up for Radar, the value of count makes weird changes and gives wrong values sometimes.
Example: (for this one I have scan frequency set to 30 sec and after 8 times it declares device absent)
If Keeper is around then I have gigaset.here and gigaset.btHere as true which is correct and the count resets to 0 at the beginning. Now when the device is not there anymore, the btHere is false and technically at count= -9 it should change gigaset.here to false as well. This works sometimes but sometimes the numbers just jump from -1 to -4 within the 30 seconds, or -7 to -11 and the gigaset.here stays as true.
Some other times when the device goes absent the count number stays stuck at a certain value i.e "-3" and does not change even if device is there again and btHere and gigaset.here are true. (this causes issues for scripts to check for presence)
And occasionally it works as intended.
What makes me wonder is my iPhone was the first one to be connected with radar and I haven't had this issue with it. It only happens to objects under the Gigaset device. I tried reinstalling the Adapter, re-configuring it, deleting the object and restarting it multiple times, unfortunately that did not solve the problem and the bigger issue is that its not consistent, at anytime any of the above 3 cases could happen.
Any clue?
Thanks in advance!