Page 1 of 1

Advice Please. GNRadio, Osmocom Libraries, Straight Python?

Posted: Wed Feb 13, 2019 4:02 am
by petec
Newbie Alert! Newbie Alert!

Please forgive me if it seems I am lost because most likely I am.
I have a project where in I want to receive serial data streams from door and window sensors.
I have used GNURadio Companion to optimize my setup so i know exactly what I need to do. I use an osmocom Source, Low Pass Filer, Complex to Mag, Multiply Constant, Float to UChar and File Sink. Then a python program to decode the file.

Going forward I want to encapsulate everything above into one package that, say for now, lights a light if a certain code is received. There is no need for any GUI. I would run this on a Raspberry Pi. I think I have three alternatives:
(1) Use GNRadio to recreate what I did with Companion and intercept the data stream before it goes to the file and use a variation of my python program to decode the stream and light the light.

(2) Use a library from Osmocom to setup the RTL-SDR then write a python program to implement the Low Pass filter, conversion to characters and a variation of my python program to decode the stream and light the light. Or, maybe there are other osmocom components to implement more of the GNURadio components.

(3) Just write a python program to setup the RTL-SDR and do everything else.

My RPi is on order. I have never used one. I have no experience with Linux. 30 or more years ago I did some stuff with Unix. I have a steep learning curve there. I have very little experience with C. I have done mostly assembly language programming with a little Visual Basic and Java.

Am I close to understanding my situation? What are the obstacles I will encounter with each of the alternatives?
I hope I'm not asking too much.
Thanks
Pete

Re: Advice Please. GNRadio, Osmocom Libraries, Straight Python?

Posted: Wed Jun 19, 2019 11:43 am
by crrkrieger
Have you tried decode345 on GitHub? It seems to do most of what you ask. It is designed for Honeywell sensors, but would probably be adaptable to your needs. https://github.com/denglend/decode345

Re: Advice Please. GNRadio, Osmocom Libraries, Straight Python?

Posted: Thu Jun 20, 2019 1:16 am
by petec
Actually it was Dan Englender's post on:

https://denglend.github.io/decode345/

that inspired me to buy the dongle and RPi. But at the time his steps 3 and 4 were still to be done. That is the MQTT & OpenHab and "what's next".
I didn't know he had completed them.
In the mean time I plunged ahead. I couldn't get GNURadio to run reliability on my RPi (segment faults, other hick ups). Just last night I completed my C program that starts RTL_SDR (Osmocom program) and, using a FIFO file type. filters the data stream, pulls out the bit stream. and compares it to the partial list of the sensors on my doors, windows, CO detectors, etc. It identifies which sensor is reporting what (open, closed tamper, low battery, etc). I had to change from Python to C because the RPi couldn't keep up. From his "What's up" section, he had the same problem.

It seems I am reinventing the wheel.

But I still have lots to do to take over the security system that was installed in this house when I bought it. I probability have an equal number of sensors still to hack. And there are also door locks and thermostats that are Z-Wave so I will need a transceiver type dongle.

I will certainly study his MQTT and OpenHab work.

He is doing great things for us.

Re: Advice Please. GNRadio, Osmocom Libraries, Straight Python?

Posted: Thu Jun 27, 2019 4:19 pm
by crrkrieger
Would you care to post your process and code? I know I am interested in doing the same thing on my Mac.

Re: Advice Please. GNRadio, Osmocom Libraries, Straight Python?

Posted: Thu Jun 27, 2019 11:13 pm
by petec
I am still working my way through some issues and things are not that reliable yet.
For example I cannot get a flow graph to run on my Pi if it contains any Osmocom blocks.

If you can make it run on your computer I would recommend jumping right in with Dan's code.
I do intend to make what I have available when it is in suitable condition. I will post the necessary info here.