Closed kpiyushkumar closed 6 years ago
Hi kpiyushkumar, Can you cat these two files from your system please?
/sys/class/net/mon0/type
/sys/class/net/mon0/operstate
Also do you have mon0
in /etc/rpi-security.conf
?
cat /sys/class/net/mon0/type
gives me "803"
cat /sys/class/net/mon0/operstate
gives me "down"
Yes I do have mon0
in /etc/rpi-security.conf
FYI I'm using Raspberry Pi 3B which has built in WiFi.
The interface is down, that's the problem. Can you run ifconfig mon0 up
?
Apologies for the late reply. After running the above command, the operstate turned to "unknown". When I ran the program in debug mode, I got the following error message
2018-03-05 23:12:24 CRITICAL exit_clean.py:22 MainThread Configuration error: KeyError(2,)
I'm too getting the same error as kpiyushkumar got pls help
@1997mohan can you also cat these two files from your system please?
/sys/class/net/mon0/type
/sys/class/net/mon0/operstate
Also, what model of wifi adapter are you using?
First command executes unknown Second command executes 803
RT 5370 WiFi adapter
I am using raspberry pi 3 model B which has inbuilt WiFi module but it doesn't support monitor mode so I bought RT 5370 WiFi adapter and I followed this link https://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/setting-up-wifi-with-occidentalis and I made ifconfig mon0 up and as u said I cat those commands which results in type as 803 and operstate as unknown
OK cool.
803
and unknown
are fine.
Can you try this?
# python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
import logging
import rpisec
rpis = rpisec.RpisSecurity('/etc/rpi-security.conf', '/var/lib/rpi-security/data.yaml')
camera = rpisec.RpisCamera(rpis.photo_size, rpis.gif_size, rpis.motion_size,
rpis.camera_vflip, rpis.camera_hflip, rpis.motion_detection_setting,
rpis.camera_capture_length, rpis.camera_mode)
And paste me the error?
(cv) pi@raspberrypi:~ $ sudo systemctl daemon-reload (cv) pi@raspberrypi:~ $ sudo systemctl enable rpi-security.service (cv) pi@raspberrypi:~ $ sudo systemctl start rpi-security.service (cv) pi@raspberrypi:~ $ sudo su root@raspberrypi:/home/pi# /usr/local/bin/rpi-security.py -d 2018-03-13 06:05:53 DEBUG rpis_security.py:69 MainThread Data file read: /var/lib/rpi-security/data.yaml 2018-03-13 06:05:53 CRITICAL exit_clean.py:22 MainThread Configuration error: KeyError(2,) root@raspberrypi:/home/pi#
(cv) pi@raspberrypi:~ $ python Python 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170124] on linux Type "help", "copyright", "credits" or "license" for more information.
import logging import rpisec Traceback (most recent call last): File "
", line 1, in ImportError: No module named 'rpisec'
Hi @1997mohan
2 things.
First, you can't start it like /usr/local/bin/rpi-security.py -d
without first adding the mon0
interface manually. So try like this:
root@raspberrypi:~# iw phy phy0 interface add mon0 type monitor
root@raspberrypi:~# ifconfig mon0 up
root@raspberrypi:~# rpi-security.py -d
Second, it looks like in your second example you are using a virtualenv called cv
? Also you are not running it as root.
superb man, now all threads are working fine but it fails to send the photo and gif. i think the resolution u have given is too high i'm using raspberry pi noir camera v 2.1. is there any possibilities to reduce the resolution or what is the problem arising can u explain?
Cool.
Yes, the resolution can be too high and it can also crash the RPI when it runs out of memory. Try changing the values here: https://github.com/FutureSharks/rpi-security/blob/master/etc/rpi-security.conf#L33-L40
Hey, I updated the readme with some missing packages: https://github.com/FutureSharks/rpi-security/commit/506738fcdd23585b3663a28404bd2a8235bb050d
Could you retest?
After running the debug program, I get
To setup the wifi adapter, I referred to this link after which I ran the following command:
iw phy phy0 interface add mon0 type monitor
My current network arrangement is
The wifi adapter I'm using is mt7601u which has monitor mode according to this.