curtbraz / WhosHere

Notifies You of Chosen People in Your Vicinity via Their Wifi Probe Requests From an Simple Web GUI
67 stars 26 forks source link

Can't get the WhosHere service to run #6

Closed RD31419 closed 4 years ago

RD31419 commented 5 years ago

Hello Curt, I think the concept is really cool, but I am struggling getting it to run. If you have any ideas please let me know. I am a network engineer by trade, so my skills in linux are lets say very weak. Anyhow, I bought a Pi 3 and monitor mode capable wireless adapter. I installed the latest raspbian from the raspberry pi's web site, and it looks like everything installed OK (I did not see any errors). I figured out how the IFTTT setup works. I just cant get the whoshere.service to start. I read about a closed case. My pi is running python3.5 but it did not fix it when I tried to edit the whoshere.service to call python3.5 instead of just python. I am stumped. If anyone can give me something to try please do. PS. I need specifics as I don't know much about this OS in general but can navigate the files system with basic commands.

Thanks Randy

IanB999 commented 5 years ago

run this from the promt and post the output

sudo /usr/bin/python /boot/WhosHere/run.py

RD31419 commented 5 years ago

Hi, sorry about the delay. Apparently I toasted my image and had to start over because it was jumping to 100% cpu. I tried installing an older Jessie release and ran into a lot of problems trying to get it to install. Oddly. I loaded it on the latest os release which I did not think would work. That is because of the comments in another post about the newest images having Mariadb. It seemed to install ok and the service is running now, but I don't see any data. I did get one error, but I am not sure if it is because I had run the install script more than once. Below is what printed out during installation. I changed 2 lines so as not to post my link to IFTTT. Is this release going to work or do I need to go to an earlier version. Thanks for the help by the way Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018

Randy

pi@raspberrypi:~/Downloads/WhosHere-master $ sudo ./INSTALL.sh Initiating Install.. Updating Repositories.. Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB] Get:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB] Get:3 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB] Get:4 http://archive.raspberrypi.org/debian stretch/main armhf Packages [199 kB] Get:5 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [39.2 kB] Fetched 11.9 MB in 16s (739 kB/s)
Reading package lists... Done Installing Required Packages.. You Will Have to Create a Database Password if Installing MySQL For the First Time.. Reading package lists... Done Building dependency tree
Reading state information... Done Note, selecting 'php7.0-mysql' instead of 'php-mysqlnd' apache2 is already the newest version (2.4.25-3+deb9u6). mysql-client is already the newest version (5.5.9999+default). mysql-server is already the newest version (5.5.9999+default). php is already the newest version (1:7.0+49). php7.0-mysql is already the newest version (7.0.30-0+deb9u1). python-mysqldb is already the newest version (1.3.7-1.1). python3-pymysql is already the newest version (0.7.10-1). tshark is already the newest version (2.6.3-1~deb9u1). 0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded. Setting Up wlan Interface.. If you Haven't Already, Plug in Your WiFi Adapter Now and Hit Enter to Continue:

Which interface would you like to set up? The following wlan interfaces were detected: wlan1 wlan0 wlan1 Using Interface wlan1.. Please enter your MySQL password.. mypassword -------------changed------------------ This script uses IFTTT.com (If Then Then That) Incoming Webhooks for Slack/SMS/etc Notifications/Automation What is your IFTTT.com Webhook URL? (Should look like https://maker.ifttt.com/trigger/WhosHere/with/key/IFTTT_WEBHOOK_GOES_HERE) https://maker.ifttt.com/use/myIFTTT --------------changed--------------- Setting Up the Web Server.. mkdir: cannot create directory ‘/var/www/html/WhosHere/’: File exists Configuring MySQL Server and WhosHere Database.. ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'whoshere'@'%' Setting up Scheduled Cron Jobs and Autostart Background Services.. Installation Complete! Visit "http://localhost/WhosHere" to Begin!

RD31419 commented 5 years ago

Wow - not sure why it put all the lines in the text, but you get the idea : )

IanB999 commented 5 years ago

Do you have characters like @%*& etc .... in your password ?

echo "Please enter your MySQL password.."; read MySQLPassword; mysql -u root -p$MySQLPassword -e "CREATE USER 'whoshere' IDENTIFIED BY '$MySQLPassword';"

Also did you run my other command ?

RD31419 commented 5 years ago

There is nothing special in the password just 3 lower case letters followed by 4 numbers. The other command fails so I guess my installation is more goofed up than I realized. Apparently directory /boot/WhosHere does not even exist so it fails to even start - unless maybe that is where I was supposed to install it. I had just unzipped it under my home directory. If that is the path I should have used, this is the output.

pi@raspberrypi:~/Downloads/WhosHere-master $ sudo /usr/bin/python ./run.py command failed: Too many open files in system (-23) Running as user "root" and group "root". This could be dangerous. tshark: Some fields aren't valid: wlan_mgt.ssid

It looks like tshark is complaining about something to do with what looks to me like the wireless management protocol filter. Also, it seems to goof up on the interfaces when I boot with the "monitor" adapter connected to usb. I never know which interface it is going to boot as.

IanB999 commented 5 years ago

I had this exact message last night

sudo vi run.py remove this bit ,'-e','wlan_mgt.ssid' from the uncommented tshark line

not sure why tshark doesn't like it , not had time to look into it

and you will need to change the following l

AP=""

go for a reboot for good measure stop the service if it is running # systemctl stop .......

sudo /usr/bin/python ./run.py ,

this should now start to display lines to the screen. If it does and data can be seen in the webpage.

kill the process started above

systemctl start .......

RD31419 commented 5 years ago

Sigh, I am kind of struggling with it. I have been trying this on two different raspbian images. I went back to trying it on my release below: 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 Its seems some things work ok when trying to go to an earlier os, but it seems to cause problems in other areas. Oddly, I did learn that the older release with tshark installed seems to behave when using the field below, it seems to fail only when using the newer release some reason. -e wlan_mgt.ssid

$ sudo tshark -l -i mon0 -Y 'wlan.fc.type_subtype eq 4' -T fields -e wlan.sa -e radiotap.dbm_antsignal -e wlan_mgt.ssid Running as user "root" and group "root". This could be dangerous. Capturing on 'mon0' 1c:91:48:6b:36:73 -33 1c:91:48:6b:36:73 -33 1c:91:48:6b:36:73 -53 12:d0:ed:75:26:9c -29 12:d0:ed:75:26:9c -29 ee:a2:83:a1:6d:9f -29 ee:a2:83:a1:6d:9f -29 1c:91:48:6b:36:73 -31 homenet b8:27:eb:c2:55:26 -19 b8:27:eb:c2:55:26 -25 b8:27:eb:c2:55:26 -35 1c:91:48:6b:36:73 -31 homenet 1c:91:48:6b:36:73 -29 homenet 1c:91:48:6b:36:73 -53 homenet

You can see it spitting out my home ssid "homenet". Oh well, I couldn't think of an SSID at the time. Anyhow it works on that with the older release, I just cant get any data to show up on the web page. The good thing is that I got the service running - just no data being displayed. I seem to have difficulty with the interfaces swapping after a reboot, so I hard coded my phy0 interface and that seemed to help in getting the service starting automatically.

This is what happens when I start run.py on my older raspbian:

pi@raspberrypi:~/Downloads/WhosHere-master $ sudo systemctl stop whoshere.service

pi@raspberrypi:~/Downloads/WhosHere-master $ sudo /usr/bin/python ./run.py command failed: Too many open files in system (-23) Running as user "root" and group "root". This could be dangerous. Capturing on 'mon0' ['Legra_79:da:c4', '', ''] 1 ['dc:a9:04:30:89:54', '-73', ''] ['dc:a9:04:30:89:54', '-83', ''] ['Legra_79:da:c4', '', ''] 4 ['Legra_79:da:c4', '', ''] 5 ['Legra_79:da:c4', '', ''] 7 ['Legra_79:da:c4', '', ''] ['Legra_79:da:c4', '', '']

I don't know what it is complaining about regarding the error: command failed: Too many open files in system (-23)

Do you think I should stick with the older raspbian - jessie release or the newer one ?

Randy

RD31419 commented 5 years ago

I think I am getting pretty close on the older release of raspbian. I don't get any errors when I manually start tshark on my mon0 interface, and it displays captured info when I turn my phone wifi on and off. Still, I still get this error if I try to run "run.py" manually: command failed: Too many open files in system (-23) That is the only error I can find now. The whoshere service starts automatically. I just dont see any data on the web page. I did have one goof up in that I was missing a module, but I got that fixed. I am not sure what else to do, but it seems to be closer than when I try to use my newest release of raspbian. Thanks for the tips.

RD31419 commented 5 years ago

Hi again IanB,

I think I am getting really close. I know nothing about mysql; however, (with google's help), I was able to poke around in the database and see that I am actually getting data in the database. I assume that means a lot of the software is working correctly. I am guessing there is some problem between the web interface and the database since nothing is being displayed. The only thing I can think of at this point is the error about "Too many open files in system (-23)". I only see it when I start run.py manually. Any ideas ? Thanks again for any assistance.

mysql> SELECT * FROM SSIDs -> ; +-------------------+---------+ | MAC | SSID | +-------------------+---------+ | Legra_79:da:c4 | | | Raspberr_c2:55:26 | | | dc:a9:04:30:89:54 | | | ac:63:be:71:4f:bc | homenet | | e4:a4:71:fa:8b:c4 | homenet | | e4:a4:71:fa:8b:c4 | | | LiteonTe_ca:7f:c8 | | | Apple_24:47:fd | | +-------------------+---------+ 8 rows in set (0.00 sec)

mysql> SELECT * FROM assets; Empty set (0.00 sec)

mysql> show tables; +--------------------+ | Tables_in_WhosHere | +--------------------+ | SSIDs | | assets | | config | | log | +--------------------+ 4 rows in set (0.00 sec)

IanB999 commented 5 years ago

Can you connect to the database, list tables and select data in them . I think one is asset s.

On Thu, 6 Dec 2018, 01:30 RD31419, notifications@github.com wrote:

Sigh, I am kind of struggling with it. I have been trying this on two different raspbian images. I went back to trying it on my release below: 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 Its seems some things work ok when trying to go to an earlier os, but it seems to cause problems in other areas. Oddly, I did learn that the older release with tshark installed seems to behave when using the field below, it seems to fail only when using the newer release some reason. -e wlan_mgt.ssid

$ sudo tshark -l -i mon0 -Y 'wlan.fc.type_subtype eq 4' -T fields -e wlan.sa -e radiotap.dbm_antsignal -e wlan_mgt.ssid Running as user "root" and group "root". This could be dangerous. Capturing on 'mon0' 1c:91:48:6b:36:73 -33 1c:91:48:6b:36:73 -33 1c:91:48:6b:36:73 -53 12:d0:ed:75:26:9c -29 12:d0:ed:75:26:9c -29 ee:a2:83:a1:6d:9f -29 ee:a2:83:a1:6d:9f -29 1c:91:48:6b:36:73 -31 homenet b8:27:eb:c2:55:26 -19 b8:27:eb:c2:55:26 -25 b8:27:eb:c2:55:26 -35 1c:91:48:6b:36:73 -31 homenet 1c:91:48:6b:36:73 -29 homenet 1c:91:48:6b:36:73 -53 homenet

You can see it spitting out my home ssid "homenet". Oh well, I couldn't think of an SSID at the time. Anyhow it works on that with the older release, I just cant get any data to show up on the web page. The good thing is that I got the service running - just no data being displayed. I seem to have difficulty with the interfaces swapping after a reboot, so I hard coded my phy0 interface and that seemed to help in getting the service starting automatically.

This is what happens when I start run.py on my older raspbian:

pi@raspberrypi:~/Downloads/WhosHere-master $ sudo systemctl stop whoshere.service

pi@raspberrypi:~/Downloads/WhosHere-master $ sudo /usr/bin/python ./run.py command failed: Too many open files in system (-23) Running as user "root" and group "root". This could be dangerous. Capturing on 'mon0' ['Legra_79:da:c4', '', ''] 1 ['dc:a9:04:30:89:54', '-73', ''] ['dc:a9:04:30:89:54', '-83', ''] ['Legra_79:da:c4', '', ''] 4 ['Legra_79:da:c4', '', ''] 5 ['Legra_79:da:c4', '', ''] 7 ['Legra_79:da:c4', '', ''] ['Legra_79:da:c4', '', '']

I don't know what it is complaining about regarding the error: command failed: Too many open files in system (-23)

Do you think I should stick with the older raspbian - jessie release or the newer one ?

Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-444715089, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVWTLr0GuaymuOjhohyyw_ctlMRwaks5u2HNAgaJpZM4YxrU_ .

RD31419 commented 5 years ago

Ian For some reason "assets" is empty but the others are populated. Also, I went into options and changed the detection threshold from -100 to -99, and ran the "SELECT * from config;" command again and you can see it changed. It seems like it is close to working. See attached info. - thanks Randy mysql> use WhosHere Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Database changed mysql> show tables; +--------------------+ | Tables_in_WhosHere | +--------------------+ | SSIDs | | assets | | config | | log | +--------------------+ 4 rows in set (0.00 sec)

mysql> SELECT * from SSIDs -> ; +----------------------------------+---------+ | MAC | SSID | +----------------------------------+---------+ | Legra_79:da:c4 | | | Raspberr_c2:55:26 | | | dc:a9:04:30:89:54 | | | ac:63:be:71:4f:bc | homenet | | e4:a4:71:fa:8b:c4 | homenet | | e4:a4:71:fa:8b:c4 | | | LiteonTe_ca:7f:c8 | | | Apple_24:47:fd | | | Apple_61:40:39 | Ashouse | | d6:36:20:7c:94:46 | | | d4:a3:3d:16:2d:69 | | | 1a:cf:c2:f6:2b:44 | | | 86:48:f6:91:a4:db | | | 98:84:e3:21:3e:8b | | | f2:8f:68:9d:24:52 | | | ac:63:be:71:4f:bc | | | MS-NLB-PhysServer-29_c7:31:95:f4 | | | 22:09:20:e9:69:9c | | +----------------------------------+---------+ 18 rows in set (0.01 sec)

mysql> SELECT * from assets; Empty set (0.00 sec)

mysql> SELECT * from config; +-----------------------+-------+ | Name | Value | +-----------------------+-------+ | NotifyNewlyDiscovered | true | | DefaultNotifyTreshold | -100 | +-----------------------+-------+ 2 rows in set (0.00 sec)

mysql> SELECT * from config; +-----------------------+-------+ | Name | Value | +-----------------------+-------+ | NotifyNewlyDiscovered | true | | DefaultNotifyTreshold | -99 | +-----------------------+-------+ 2 rows in set (0.00 sec)

mysql>

IanB999 commented 5 years ago

I haven't quite understood what the notify level means. I guess dbi means signal strength , the higher the weaker signal, and more distant away. So if I set level lower I will only get notified by devices near by. Do you agree.

On Thu, 6 Dec 2018, 16:43 Ian Buckle, ian.buckle@gmail.com wrote:

The assets table is populated from the log table I think . I think there is a stored procedure called assets that does this. Details shoul be on install script. Try to grab the SQL and run manually.

On Thu, 6 Dec 2018, 16:29 RD31419, notifications@github.com wrote:

Ian For some reason "assets" is empty but the others are populated. Also, I went into options and changed the detection threshold from -100 to -99, and ran the "SELECT * from config;" command again and you can see it changed. It seems like it is close to working. See attached info. - thanks Randy mysql> use WhosHere Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Database changed mysql> show tables; +--------------------+ | Tables_in_WhosHere | +--------------------+ | SSIDs | | assets | | config | | log | +--------------------+ 4 rows in set (0.00 sec)

mysql> SELECT * from SSIDs -> ; +----------------------------------+---------+ | MAC | SSID | +----------------------------------+---------+ | Legra_79:da:c4 | | | Raspberr_c2:55:26 | | | dc:a9:04:30:89:54 | | | ac:63:be:71:4f:bc | homenet | | e4:a4:71:fa:8b:c4 | homenet | | e4:a4:71:fa:8b:c4 | | | LiteonTe_ca:7f:c8 | | | Apple_24:47:fd | | | Apple_61:40:39 | Ashouse | | d6:36:20:7c:94:46 | | | d4:a3:3d:16:2d:69 | | | 1a:cf:c2:f6:2b:44 | | | 86:48:f6:91:a4:db | | | 98:84:e3:21:3e:8b | | | f2:8f:68:9d:24:52 | | | ac:63:be:71:4f:bc | | | MS-NLB-PhysServer-29_c7:31:95:f4 | | | 22:09:20:e9:69:9c | | +----------------------------------+---------+ 18 rows in set (0.01 sec)

mysql> SELECT * from assets; Empty set (0.00 sec)

mysql> SELECT * from config; +-----------------------+-------+ | Name | Value | +-----------------------+-------+ | NotifyNewlyDiscovered | true | | DefaultNotifyTreshold | -100 | +-----------------------+-------+ 2 rows in set (0.00 sec)

mysql> SELECT * from config; +-----------------------+-------+ | Name | Value | +-----------------------+-------+ | NotifyNewlyDiscovered | true | | DefaultNotifyTreshold | -99 | +-----------------------+-------+ 2 rows in set (0.00 sec)

mysql>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-444934596, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVcHC1orT1Is463r35zBf3v66kx_pks5u2UXKgaJpZM4YxrU_ .

IanB999 commented 5 years ago

The assets table is populated from the log table I think . I think there is a stored procedure called assets that does this. Details shoul be on install script. Try to grab the SQL and run manually.

On Thu, 6 Dec 2018, 16:29 RD31419, notifications@github.com wrote:

Ian For some reason "assets" is empty but the others are populated. Also, I went into options and changed the detection threshold from -100 to -99, and ran the "SELECT * from config;" command again and you can see it changed. It seems like it is close to working. See attached info. - thanks Randy mysql> use WhosHere Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Database changed mysql> show tables; +--------------------+ | Tables_in_WhosHere | +--------------------+ | SSIDs | | assets | | config | | log | +--------------------+ 4 rows in set (0.00 sec)

mysql> SELECT * from SSIDs -> ; +----------------------------------+---------+ | MAC | SSID | +----------------------------------+---------+ | Legra_79:da:c4 | | | Raspberr_c2:55:26 | | | dc:a9:04:30:89:54 | | | ac:63:be:71:4f:bc | homenet | | e4:a4:71:fa:8b:c4 | homenet | | e4:a4:71:fa:8b:c4 | | | LiteonTe_ca:7f:c8 | | | Apple_24:47:fd | | | Apple_61:40:39 | Ashouse | | d6:36:20:7c:94:46 | | | d4:a3:3d:16:2d:69 | | | 1a:cf:c2:f6:2b:44 | | | 86:48:f6:91:a4:db | | | 98:84:e3:21:3e:8b | | | f2:8f:68:9d:24:52 | | | ac:63:be:71:4f:bc | | | MS-NLB-PhysServer-29_c7:31:95:f4 | | | 22:09:20:e9:69:9c | | +----------------------------------+---------+ 18 rows in set (0.01 sec)

mysql> SELECT * from assets; Empty set (0.00 sec)

mysql> SELECT * from config; +-----------------------+-------+ | Name | Value | +-----------------------+-------+ | NotifyNewlyDiscovered | true | | DefaultNotifyTreshold | -100 | +-----------------------+-------+ 2 rows in set (0.00 sec)

mysql> SELECT * from config; +-----------------------+-------+ | Name | Value | +-----------------------+-------+ | NotifyNewlyDiscovered | true | | DefaultNotifyTreshold | -99 | +-----------------------+-------+ 2 rows in set (0.00 sec)

mysql>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-444934596, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVcHC1orT1Is463r35zBf3v66kx_pks5u2UXKgaJpZM4YxrU_ .

RD31419 commented 5 years ago

Ian Interesting. I will poke around and see if I can figure it out. I do know that the log table is populating and looks good to me. It has the time stamps, mac addresses and signal strength along with an occasional ssid. The assets table says it is empty. Seems kind of odd that its not working since it seems so close. I assume the notify level is because you may not want to be notified until a mac address is showing up close enough that you know it is nearby. -100 is quite weak, Of course a stronger signal is less negative. I would probably set mine up for about -50 or higher (less negative). For my purposes I am trying to get notified when bad guys are showing up at 3 am try to break into our cars. It is an ongoing problem. I have 4 security cameras up. I am wanting to match the phone to the video so if they show up at 3 am again I will be notified. Their mistake - they are using phones to talk to each other - you can see the lights. Also, they like to break in at the same time, around 3 am. I hope to use that against them if I can get it working. They have been covering license plates some times so I have not been able to nail them with the plates yet, but I am getting a lot better at tweaking the cameras. Randy

IanB999 commented 5 years ago

lol. Im doing this for exactly the same reason. When I get on my computer tonight I will try to put some code together for you. I'm guessing you are the USA thoug not UK.

On Thu, 6 Dec 2018, 18:04 RD31419, notifications@github.com wrote:

Ian Interesting. I will poke around and see if I can figure it out. I do know that the log table is populating and looks good to me. It has the time stamps, mac addresses and signal strength along with an occasional ssid. The assets table says it is empty. Seems kind of odd that its not working since it seems so close. I assume the notify level is because you may not want to be notified until a mac address is showing up close enough that you know it is nearby. -100 is quite weak, Of course a stronger signal is less negative. I would probably set mine up for about -50 or higher (less negative). For my purposes I am trying to get notified when bad guys are showing up at 3 am try to break into our cars. It is an ongoing problem. I have 4 security cameras up. I am wanting to match the phone to the video so if they show up at 3 am again I will be notified. Their mistake - they are using phones to talk to each other - you can see the lights. Also, they like to break in at the same time, around 3 am. I hope to use that against them if I can get it working. They have been covering license plates some times so I have not been able to nail them with the plates yet, but I am getting a lot better at tweaking the cameras. Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-444969633, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVQjQPSBuI56ex7Ot3tezOt-4APPtks5u2VwUgaJpZM4YxrU_ .

IanB999 commented 5 years ago

I'm trying to get locals to install the same boxes, and get earlier notification that crims are in the area. Working on something to share data on Google sheets between raspberry pi. Mybalerting via ittf seems to be an issue. I can manually run the command , and it works ,but some reason the php code is not calling it.

On Thu, 6 Dec 2018, 18:07 Ian Buckle, ian.buckle@gmail.com wrote:

lol. Im doing this for exactly the same reason. When I get on my computer tonight I will try to put some code together for you. I'm guessing you are the USA thoug not UK.

On Thu, 6 Dec 2018, 18:04 RD31419, notifications@github.com wrote:

Ian Interesting. I will poke around and see if I can figure it out. I do know that the log table is populating and looks good to me. It has the time stamps, mac addresses and signal strength along with an occasional ssid. The assets table says it is empty. Seems kind of odd that its not working since it seems so close. I assume the notify level is because you may not want to be notified until a mac address is showing up close enough that you know it is nearby. -100 is quite weak, Of course a stronger signal is less negative. I would probably set mine up for about -50 or higher (less negative). For my purposes I am trying to get notified when bad guys are showing up at 3 am try to break into our cars. It is an ongoing problem. I have 4 security cameras up. I am wanting to match the phone to the video so if they show up at 3 am again I will be notified. Their mistake - they are using phones to talk to each other - you can see the lights. Also, they like to break in at the same time, around 3 am. I hope to use that against them if I can get it working. They have been covering license plates some times so I have not been able to nail them with the plates yet, but I am getting a lot better at tweaking the cameras. Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-444969633, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVQjQPSBuI56ex7Ot3tezOt-4APPtks5u2VwUgaJpZM4YxrU_ .

IanB999 commented 5 years ago

Sorry I mislead you the .sql file is what you need to look at. Connect to the database and run this sql

INSERT INTO assets(Mac,Nickname,FirstSeen,SignalStrength) SELECT lg.Mac,lg.Mac,MIN(lg.seen),lg.decibel AS FirstSeen FROM log lg LEFT JOIN assets ass ON ass.Mac = lg.Mac WHERE ass.Mac IS NULL GROUP BY lg.Mac;

On Thu, Dec 6, 2018 at 6:04 PM RD31419 notifications@github.com wrote:

Ian Interesting. I will poke around and see if I can figure it out. I do know that the log table is populating and looks good to me. It has the time stamps, mac addresses and signal strength along with an occasional ssid. The assets table says it is empty. Seems kind of odd that its not working since it seems so close. I assume the notify level is because you may not want to be notified until a mac address is showing up close enough that you know it is nearby. -100 is quite weak, Of course a stronger signal is less negative. I would probably set mine up for about -50 or higher (less negative). For my purposes I am trying to get notified when bad guys are showing up at 3 am try to break into our cars. It is an ongoing problem. I have 4 security cameras up. I am wanting to match the phone to the video so if they show up at 3 am again I will be notified. Their mistake - they are using phones to talk to each other - you can see the lights. Also, they like to break in at the same time, around 3 am. I hope to use that against them if I can get it working. They have been covering license plates some times so I have not been able to nail them with the plates yet, but I am getting a lot better at tweaking the cameras. Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-444969633, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVQjQPSBuI56ex7Ot3tezOt-4APPtks5u2VwUgaJpZM4YxrU_ .

IanB999 commented 5 years ago

this is why I dont get alerted . This is what the cron runs to send the alerts I need to work out what the issue is

php /var/www/html/WhosHere/CheckAlerts.php

PHP Notice: Trying to get property of non-object in /var/www/html/WhosHere/CheckAlerts.php on line 32

On Thu, Dec 6, 2018 at 6:04 PM RD31419 notifications@github.com wrote:

Ian Interesting. I will poke around and see if I can figure it out. I do know that the log table is populating and looks good to me. It has the time stamps, mac addresses and signal strength along with an occasional ssid. The assets table says it is empty. Seems kind of odd that its not working since it seems so close. I assume the notify level is because you may not want to be notified until a mac address is showing up close enough that you know it is nearby. -100 is quite weak, Of course a stronger signal is less negative. I would probably set mine up for about -50 or higher (less negative). For my purposes I am trying to get notified when bad guys are showing up at 3 am try to break into our cars. It is an ongoing problem. I have 4 security cameras up. I am wanting to match the phone to the video so if they show up at 3 am again I will be notified. Their mistake - they are using phones to talk to each other - you can see the lights. Also, they like to break in at the same time, around 3 am. I hope to use that against them if I can get it working. They have been covering license plates some times so I have not been able to nail them with the plates yet, but I am getting a lot better at tweaking the cameras. Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-444969633, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVQjQPSBuI56ex7Ot3tezOt-4APPtks5u2VwUgaJpZM4YxrU_ .

IanB999 commented 5 years ago

actually it might be that it's not find any rows to alert on , however when there are rows in the table I get a different error.

On Thu, Dec 6, 2018 at 9:07 PM Ian Buckle ian.buckle@gmail.com wrote:

this is why I dont get alerted . This is what the cron runs to send the alerts I need to work out what the issue is

php /var/www/html/WhosHere/CheckAlerts.php

PHP Notice: Trying to get property of non-object in /var/www/html/WhosHere/CheckAlerts.php on line 32

On Thu, Dec 6, 2018 at 6:04 PM RD31419 notifications@github.com wrote:

Ian Interesting. I will poke around and see if I can figure it out. I do know that the log table is populating and looks good to me. It has the time stamps, mac addresses and signal strength along with an occasional ssid. The assets table says it is empty. Seems kind of odd that its not working since it seems so close. I assume the notify level is because you may not want to be notified until a mac address is showing up close enough that you know it is nearby. -100 is quite weak, Of course a stronger signal is less negative. I would probably set mine up for about -50 or higher (less negative). For my purposes I am trying to get notified when bad guys are showing up at 3 am try to break into our cars. It is an ongoing problem. I have 4 security cameras up. I am wanting to match the phone to the video so if they show up at 3 am again I will be notified. Their mistake - they are using phones to talk to each other - you can see the lights. Also, they like to break in at the same time, around 3 am. I hope to use that against them if I can get it working. They have been covering license plates some times so I have not been able to nail them with the plates yet, but I am getting a lot better at tweaking the cameras. Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-444969633, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVQjQPSBuI56ex7Ot3tezOt-4APPtks5u2VwUgaJpZM4YxrU_ .

IanB999 commented 5 years ago

Actually my alerts seem to be working . I wish he would have written notes on his logic around when an alert is fires

On Thu, Dec 6, 2018 at 6:04 PM RD31419 notifications@github.com wrote:

Ian Interesting. I will poke around and see if I can figure it out. I do know that the log table is populating and looks good to me. It has the time stamps, mac addresses and signal strength along with an occasional ssid. The assets table says it is empty. Seems kind of odd that its not working since it seems so close. I assume the notify level is because you may not want to be notified until a mac address is showing up close enough that you know it is nearby. -100 is quite weak, Of course a stronger signal is less negative. I would probably set mine up for about -50 or higher (less negative). For my purposes I am trying to get notified when bad guys are showing up at 3 am try to break into our cars. It is an ongoing problem. I have 4 security cameras up. I am wanting to match the phone to the video so if they show up at 3 am again I will be notified. Their mistake - they are using phones to talk to each other - you can see the lights. Also, they like to break in at the same time, around 3 am. I hope to use that against them if I can get it working. They have been covering license plates some times so I have not been able to nail them with the plates yet, but I am getting a lot better at tweaking the cameras. Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-444969633, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVQjQPSBuI56ex7Ot3tezOt-4APPtks5u2VwUgaJpZM4YxrU_ .

RD31419 commented 5 years ago

Ian,

Well that is interesting, when I ran your mysql command, it populated the web interface with a bunch of info. Oddly, the "number of times seen" is zero for all mac addresses. Seems close but not quite right. Thanks for the help.

Randy

RD31419 commented 5 years ago

Ian

Oh one other thing I just noticed. The "first seen" column looks ok, but the "last seen" column says this "12/31/1969 07:00:00 PM" on all of the macs.

Randy

IanB999 commented 5 years ago

seems you clock on your device is wrong .. what does the command date give you

date

change date under raspberry pi -> preferences

On Thu, Dec 6, 2018 at 11:02 PM RD31419 notifications@github.com wrote:

Ian

Oh one other thing I just noticed. The "first seen" column looks ok, but the "last seen" column says this "12/31/1969 07:00:00 PM" on all of the macs.

Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-445062081, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVTHfWLvIL0wSnmeLoGt8IDSGlyRYks5u2aH_gaJpZM4YxrU_ .

RD31419 commented 5 years ago

pi@raspberrypi:~/Downloads/WhosHere-master $ date Thu Dec 6 18:17:48 EST 2018

I don't understand. I guess I have some digging to do still.

IanB999 commented 5 years ago

I got a feeling the time thing might be why your data is not being populated. I don't thing that date is the start of EPOC time I'm sure it was 1st July 72

On Thu, 6 Dec 2018, 22:55 RD31419, notifications@github.com wrote:

Ian,

Well that is interesting, when I ran your mysql command, it populated the web interface with a bunch of info. Oddly, the "number of times seen" is zero for all mac addresses. Seems close but not quite right. Thanks for the help.

Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-445060308, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVRIe6PCVS0RVXHWX-LSprr-bCGfUks5u2aBggaJpZM4YxrU_ .

RD31419 commented 5 years ago

Hi Ian,

The thing is mysql seems to know the correct time. If you look in the log, the time stamps are correct, but it is not dumping anything into the assets table:

The log looks like this (just a few lines): | Legra_79:da:c4 | 2018-12-07 17:54:15 | | | | Legra_79:da:c4 | 2018-12-07 17:54:15 | | | | ac:63:be:71:4f:bc | 2018-12-07 17:54:22 | -61 | homenet | | ac:63:be:71:4f:bc | 2018-12-07 17:54:22 | -61 | homenet | | ac:63:be:71:4f:bc | 2018-12-07 17:54:22 | -61 | homenet | | ac:63:be:71:4f:bc | 2018-12-07 17:54:22 | -61 | homenet |

When looking at the the file MySQLSchema.sql, it has this in it: FOR EACH ROW UPDATE assets SET SignalStrength = NEW.decibel WHERE MAC = NEW.MAC */;;

Where each row is in reference to the log file. It seems like it should be dumping something into the assets table from the log file, but it is not. I am gradually figuring out how it works, but it is a steep learning curve since this is not my area of expertise for sure.

Randy

IanB999 commented 5 years ago

I may get a chance to look this weekend, come back to me if still stuck.

On Fri, 7 Dec 2018, 23:10 RD31419, notifications@github.com wrote:

Hi Ian,

The thing is mysql seems to know the correct time. If you look in the log, the time stamps are correct, but it is not dumping anything into the assets table:

The log looks like this (just a few lines): | Legra_79:da:c4 | 2018-12-07 17:54:15 | | | | Legra_79:da:c4 | 2018-12-07 17:54:15 | | | | ac:63:be:71:4f:bc | 2018-12-07 17:54:22 | -61 | homenet | | ac:63:be:71:4f:bc | 2018-12-07 17:54:22 | -61 | homenet | | ac:63:be:71:4f:bc | 2018-12-07 17:54:22 | -61 | homenet | | ac:63:be:71:4f:bc | 2018-12-07 17:54:22 | -61 | homenet |

When looking at the the file MySQLSchema.sql, it has this in it: FOR EACH ROW UPDATE assets SET SignalStrength = NEW.decibel WHERE MAC = NEW.MAC */;;

Where each row is in reference to the log file. It seems like it should be dumping something into the assets table from the log file, but it is not. I am gradually figuring out how it works, but it is a steep learning curve since this is not my area of expertise for sure.

Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-445393531, or mute the thread https://github.com/notifications/unsubscribe-auth/ArRRVR91vSVB2qvY4TxvKiNBu1dJpug8ks5u2vVogaJpZM4YxrU_ .

curtbraz commented 5 years ago

Hey guys! Sorry, I've been super busy lately with moving into a new home and haven't had a time to check or respond to emails. Thanks for helping @IanB999 ! I've been bothered for some time now that this was written several years ago and the install script has been updated without being retested.. that's on me. As soon as I have some time I'll go back with a fresh install of the newest Raspbian distro and work out any kinks I run into.

I've been running it straight for a couple of years now without issue. I'll dump the DB and start again. Updates to come!

RD31419 commented 5 years ago

Curtis, Hey there, Thanks for the post. Its seems like I am so close, but I just can't get it to fully function. Anyhow, I am out of time for the time being. I have to go out of town for work for a few days. By using a jessie release of raspbian, I got it to a point the database is collecting data in the log table, but the asset table stays empty. I can't seem to figure out why. It would be nice for sure if we could have the info regarding what versions were used in your testing for everything. I thought I had the import pymysql.cursors issue resolved, but that seems to keep popping up as part of the problem I suspect. I will probably give it a try again during the holidays. Thanks again. Randy

curtbraz commented 5 years ago

Just let me know how I can help in the meantime, until I'm able to start the install from scratch and fix any dependency issues! I could always troubleshoot with you via a screen share or something if you're up for it. I'm a big fan of running the SQL manually.. I often edit the PHP to echo out the SQL statement, then paste that directly into MySQL to see if there's an error or something helpful. I suspect if you're getting data in everything but "assets", there's an error for some reason on the insert into that table. Enabling "display_errors" in your php.ini may give you some additional insight as well.

Like I said, let me know if I can help!

Thanks,

On Sun, Dec 9, 2018 at 11:00 PM RD31419 notifications@github.com wrote:

Curtis, Hey there, Thanks for the post. Its seems like I am so close, but I just can't get it to fully function. Anyhow, I am out of time for the time being. I have to go out of town for work for a few days. By using a jessie release of raspbian, I got it to a point the database is collecting data in the log table, but the asset table stays empty. I can't seem to figure out why. It would be nice for sure if we could have the info regarding what versions were used in your testing for everything. I thought I had the import pymysql.cursors issue resolved, but that seems to keep popping up as part of the problem I suspect. I will probably give it a try again during the holidays. Thanks again. Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-445664924, or mute the thread https://github.com/notifications/unsubscribe-auth/ARAfILKO-_FTaTATBpJ3rWH9sWSaVQbwks5u3dxdgaJpZM4YxrU_ .

RD31419 commented 5 years ago

Curtis, Thanks I appreciate the help. I won't have time until next week or so. I will let you know when I am back home again. later.. Randy

RD31419 commented 5 years ago

Curtis, I was Just checking to see if you will have a chance to get whoshere working with the lastest Raspbian at some point. If you do please let me know. I have never been able to get it to work fully. Its just a little beyond my skill set without specific instructions about exactly what versions of everything to install. I don't want to be a bother, but would really like to get it working at some day. Thanks in advance, Randy

curtbraz commented 5 years ago

Hey there!

I actually have been working to port the whole thing to docker, so nobody has to deal with installation issues and versions of dependencies. I'm hoping to finish up soon but it's a bit of a challenge for me. Stay tuned!

On Sat, Jan 12, 2019, 1:45 PM RD31419 <notifications@github.com wrote:

Curtis, I was Just checking to see if you will have a chance to get whoshere working with the lastest Raspbian at some point. If you do please let me know. I have never been able to get it to work fully. Its just a little beyond my skill set without specific instructions about exactly what versions of everything to install. I don't want to be a bother, but would really like to get it working at some day. Thanks in advance, Randy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/curtbraz/WhosHere/issues/6#issuecomment-453771563, or mute the thread https://github.com/notifications/unsubscribe-auth/ARAfIBDemUfzm8kkv1EXABIVrWCksasNks5vCi0ugaJpZM4YxrU_ .

RD31419 commented 5 years ago

Sounds cool. Thanks.

curtbraz commented 4 years ago

Closing issue. After all of these years (thank COVID19) I'm finally getting around to fixing this stuff. :)