Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

RFSniffer - Can't get it working

Fri Dec 16, 2016 11:29 pm

I am using an RPi 3. I have run the following based on a number of different tutorials and using a 433MHz wireless receiver.

Code: Select all

git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
Testing out the GPIO I do the following.

Code: Select all

pi@raspberrypi:~/wiringPi $ gpio -v
gpio version: 2.36
Copyright (c) 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Pi 3, Revision: 02, Memory: 1024MB, Maker: Embest 
  * Device tree is enabled.
  *--> Raspberry Pi 3 Model B Rev 1.2
  * This Raspberry Pi supports user-level GPIO access.
pi@raspberrypi:~/wiringPi $ gpio readall
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |
 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
pi@raspberrypi:~/wiringPi $ 

Code: Select all

git clone git://github.com/timleland/rfoutlet.git /var/www/html/rfoutlet
sudo chown root.root /var/www/html/rfoutlet/codesend
sudo chmod 4755 /var/www/html/rfoutlet/codesend
To sniff the codes I run the RFSniffer.

Code: Select all

sudo /var/www/rfoutlet/RFSniffer

RFSniffer runs and seems to be waiting. I can't get anything to be picked up using different remotes and show in terminal.

Here is how I have the sensor connect to the RPi 3. This again is verified on a number of other blogs.
IMG_2105.JPG
IMG_2105.JPG (36.31 KiB) Viewed 17334 times
What else can I do to test I have everything correctly setup?

Thank you.
Ed

User avatar
joan
Posts: 14940
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: RFSniffer - Can't get it working

Sat Dec 17, 2016 9:15 am

Try my sniffer http://abyz.co.uk/rpi/pigpio/examples.html#pdif2__433D

Make sure you are using the correct GPIO. You can check GPIO activity with http://abyz.co.uk/rpi/pigpio/piscope.html

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 2:45 pm

joan wrote:Try my sniffer http://abyz.co.uk/rpi/pigpio/examples.html#pdif2__433D

Make sure you are using the correct GPIO. You can check GPIO activity with http://abyz.co.uk/rpi/pigpio/piscope.html
Thank you. I have installed your sniffer but no luck getting anything to get displayed for codes. I installed piscope and I can see activity flying by on any gpio that I attached the sensor to. I tried gpio 21 and 27. I can see that frequency does change when I press a button on a remote.

Any other suggestions?
Ed

User avatar
joan
Posts: 14940
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 3:19 pm

Which sort of remotes are you using? Do you have an aerial attached to the receiver?

Do the signals look consistent when you keep the remote pressed? Can you capture and post a piscope image?

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 3:43 pm

joan wrote:Which sort of remotes are you using? Do you have an aerial attached to the receiver?

Do the signals look consistent when you keep the remote pressed? Can you capture and post a piscope image?
When I launch Piscope it is receiving something all the time. Is that normal? It is goes so fast I can't really tell if it is consistent or not. L
Ed

User avatar
joan
Posts: 14940
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 3:46 pm

Husar wrote:
joan wrote:Which sort of remotes are you using? Do you have an aerial attached to the receiver?

Do the signals look consistent when you keep the remote pressed? Can you capture and post a piscope image?
When I launch Piscope it is receiving something all the time. Is that normal? It is goes so fast I can't really tell if it is consistent or not. L
That's static. Try the following command on the receiver GPIO.

pigs fg GPIO 150 # ignore edges shorter than 150 µs

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 4:05 pm

This is the static I see all the time that runs by.
The attachment IMG_2123.jpg is no longer available
Attachments
IMG_2123.jpg
IMG_2123.jpg (49.11 KiB) Viewed 17081 times
Last edited by Husar on Sun Dec 18, 2016 4:19 pm, edited 1 time in total.
Ed

User avatar
joan
Posts: 14940
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 4:10 pm

I don't recognise that signal. It doesn't look like Manchester encoding which is what the sniffer type utilities expect.

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 4:12 pm

IMG_2126-copy.jpg
IMG_2126-copy.jpg (55.23 KiB) Viewed 17049 times
This is when I press a button remote.
Ed

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 4:21 pm

joan wrote:
Husar wrote:
joan wrote:Which sort of remotes are you using? Do you have an aerial attached to the receiver?

Do the signals look consistent when you keep the remote pressed? Can you capture and post a piscope image?
When I launch Piscope it is receiving something all the time. Is that normal? It is goes so fast I can't really tell if it is consistent or not. L
That's static. Try the following command on the receiver GPIO.

pigs fg GPIO 150 # ignore edges shorter than 150 µs
This is what I get when I try to issue that commend in Termina.

pi@raspberrypi:~ $ pigs fg GPIO 150
fg: bad parameter, pigs h for help
Ed

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 4:36 pm

Does anyone have an RPi 3 working with an RF sensor? Every tutorial I have seen is not using the 3. I'd love to see a start to finish tutorial on setting it up with a 3 if anyone knows of one.
Ed

User avatar
joan
Posts: 14940
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 4:52 pm

Husar wrote:Does anyone have an RPi 3 working with an RF sensor? Every tutorial I have seen is not using the 3. I'd love to see a start to finish tutorial on setting it up with a 3 if anyone knows of one.
There is nothing special about the RPi 3 for RF. The same RF decoder software will run on all the Pi models. You need to identify your type of remote control and see if you can find the proper type of decoder software.

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 5:14 pm

I have ready just about every tutorial online for the RF readers/receiver and they all differ a bit. They are not the same and none of them use a RPi 3. I just don't think there are any update to date clear tutorials. If you know of one that you think works for sure please post it. Thanks!
Ed

User avatar
joan
Posts: 14940
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 5:33 pm

Husar wrote:I have ready just about every tutorial online for the RF readers/receiver and they all differ a bit. They are not the same and none of them use a RPi 3. I just don't think there are any update to date clear tutorials. If you know of one that you think works for sure please post it. Thanks!
The sniffer software is used to decode a particular type of RF remote. You need to identify your type of RF remote and then you can see if there is an appropriate tutorial. If your RF remote doesn't use a standard protocol it's unlikely you will find a tutorial.

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 5:38 pm

How would someone identify their type of RF remote? I literally have 10 of them to test with.
Ed

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Sun Dec 18, 2016 7:56 pm

I noticed this person had the same issue. He was also using an RPi 3.

viewtopic.php?f=28&t=150619&p=1083853#p1083853
Ed

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Tue Dec 20, 2016 2:19 am

I am finally able to capture codes. Yea!

I gave up on getting any of the code to work that I tried earlier in this thread. I ended up using this Python 3 script I pulled off one of the home automation sites. Everything is working really good to capture the codes. Now I am working on sending the codes via PHP.

I anyone has trouble with the any of of the tutorials that I tried give this script go. Way easier!

Code: Select all

 
#!/usr/bin/env python3

import argparse
import signal
import sys
import time
import logging

from rpi_rf import RFDevice

rfdevice = None

# pylint: disable=unused-argument
def exithandler(signal, frame):
    rfdevice.cleanup()
    sys.exit(0)

logging.basicConfig(level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S',
                    format='%(asctime)-15s - [%(levelname)s] %(module)s: %(message)s', )

parser = argparse.ArgumentParser(description='Receives a decimal code via a 433/315MHz GPIO device')
parser.add_argument('-g', dest='gpio', type=int, default=27,
                    help="GPIO pin (Default: 27)")
args = parser.parse_args()

signal.signal(signal.SIGINT, exithandler)
rfdevice = RFDevice(args.gpio)
rfdevice.enable_rx()
timestamp = None
logging.info("Listening for codes on GPIO " + str(args.gpio))
while True:
    if rfdevice.rx_code_timestamp != timestamp:
        timestamp = rfdevice.rx_code_timestamp
        logging.info(str(rfdevice.rx_code) +
                     " [pulselength " + str(rfdevice.rx_pulselength) +
                     ", protocol " + str(rfdevice.rx_proto) + "]")
    time.sleep(0.01)
rfdevice.cleanup()

The above code will output something like the following.

Code: Select all

pi@raspberrypi:~ $ python3 rfrx.py 
/usr/local/lib/python3.4/dist-packages/rpi_rf/rpi_rf.py:167: RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
  GPIO.setup(self.gpio, GPIO.IN)
2016-12-19 20:15:52 - [INFO] rfrx: Listening for codes on GPIO 27
2016-12-19 20:15:52 - [INFO] rfrx: 1 [pulselength 1180, protocol 4]
2016-12-19 20:15:57 - [INFO] rfrx: 1054003 [pulselength 184, protocol 1]
2016-12-19 20:15:57 - [INFO] rfrx: 1054003 [pulselength 186, protocol 1]
Ed

andies
Posts: 141
Joined: Mon Nov 11, 2013 8:12 pm
Location: Berlin

Re: RFSniffer - Can't get it working

Tue Dec 20, 2016 9:58 pm

Husar wrote:Does anyone have an RPi 3 working with an RF sensor?
I am still trying but until now I failed (see viewtopic.php?t=164177): Those sensors pick up too much "noise" (in fact they show me those signal-numbers all the time without any button pressed, the reason seems to be that they are built that way - look for On-Off-Key receiver).

The problem is that I cannot distinguish "noise" from signal. Although I see something in Piscope I cannot record it and I have not tried sending this noise/signal back to the garage door opener. Have you been successful with receiving and sending with your remote?
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA
Contact: Website

Re: RFSniffer - Can't get it working

Wed Dec 21, 2016 6:14 am

andies wrote:
Husar wrote:Does anyone have an RPi 3 working with an RF sensor?
I am still trying but until now I failed (see viewtopic.php?t=164177): Those sensors pick up too much "noise" (in fact they show me those signal-numbers all the time without any button pressed, the reason seems to be that they are built that way - look for On-Off-Key receiver).

The problem is that I cannot distinguish "noise" from signal. Although I see something in Piscope I cannot record it and I have not tried sending this noise/signal back to the garage door opener. Have you been successful with receiving and sending with your remote?
Have you tried that Python script I posted? I got noise too but when I pressed a button Periscope pick it up. Try what I post and see if you get a valid code back. It worked like a charm for me.
Ed

andies
Posts: 141
Joined: Mon Nov 11, 2013 8:12 pm
Location: Berlin

Re: RFSniffer - Can't get it working

Thu Dec 22, 2016 3:02 pm

I have difficulties installing it:

Code: Select all

pi@Zimmer:~/433Utils/python $ pip3 install rpi-rf
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip3')()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2476, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2190, in load
    ['__name__'])
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 74, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python3/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python3/dist-packages/pip/download.py", line 25, in <module>
    from requests.compat import IncompleteRead
ImportError: cannot import name 'IncompleteRead'
Can you help?

Code: Select all

pi@RPI ~ $ python3 -V
Python 3.2.3
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

andies
Posts: 141
Joined: Mon Nov 11, 2013 8:12 pm
Location: Berlin

Re: RFSniffer - Can't get it working

Thu Dec 22, 2016 3:16 pm

Found it:

Code: Select all

 sudo easy_install3 -U pip
Last edited by andies on Thu Dec 22, 2016 5:51 pm, edited 1 time in total.
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

andies
Posts: 141
Joined: Mon Nov 11, 2013 8:12 pm
Location: Berlin

Re: RFSniffer - Can't get it working

Thu Dec 22, 2016 5:34 pm

I borrrowed an oscilloscope and record the "noise" as well as the signal from the button. Difference (according to the adjustments from the oscilloscope) is about 0.45V, the signal starts with a 400us pulse.

Noise:
noise.gif
noise.gif (38.99 KiB) Viewed 16143 times
The signal (button pressed)
signal.gif
signal.gif (52.28 KiB) Viewed 16143 times
The adjustments of the oscilloscope
buttons.gif
buttons.gif (44.7 KiB) Viewed 16143 times
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

andies
Posts: 141
Joined: Mon Nov 11, 2013 8:12 pm
Location: Berlin

Re: RFSniffer - Can't get it working

Thu Dec 22, 2016 6:00 pm

Got it working. But I do not receive anything:

Code: Select all

pi@RPi:~/433Utils/python $ python3 signal.py
2016-12-22 18:58:09 - [INFO] signal: Listening for codes on GPIO 27
^Cpi@RPi:~/433Utils/python $
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

SuperToma
Posts: 5
Joined: Thu Dec 22, 2016 10:51 pm
Location: Paris

Re: RFSniffer - Can't get it working

Thu Dec 22, 2016 10:58 pm

Hey guys !

I have the same problem on my RPi 3...

RFSniffer is working but receiving nothing.
Nothing from _433.py too

I checked thousand times the pins.

@Husar : like andies I receive nothing :(

Code: Select all

pi@raspberrypi:~ $ python3 rfrx.py
2016-12-22 22:56:56 - [INFO] rfrx: Listening for codes on GPIO 27
Any idea is welcomed ;)

User avatar
joan
Posts: 14940
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: RFSniffer - Can't get it working

Fri Dec 23, 2016 8:57 am

Are you receiving something which looks like a signal and is not just noise?

http://abyz.co.uk/rpi/pigpio/piscope.html

Return to “Automation, sensing and robotics”