RTL433 over rtl_tcp

Moderator: leecollings

Post Reply
DJBenson
Posts: 20
Joined: Wednesday 19 October 2016 19:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

RTL433 over rtl_tcp

Post by DJBenson »

I've just got a NooElec SDR dongle which I had planned to plug into my Raspbery Pi 4 directly (which lives outdoors in an IP66 case) but on doing so the temperature inside the case shot up by over 20 degrees so I've had to put the SDR dongle elsewhere.

On the remote host (the machine hosting the rtl_sdr) I have the device connected to rtl_tcp running on the default port of 1234. I have enabled the UFW rules for both IPv4 and IPv6.

In Domoticz, I've added the additional parameter to the RTL433 config of "-d rtl_tcp://host:1234" and Domoticz cannot connect to the host.

If I fire up rtl_433 from the commandline on the same host as Domotic, and pass the same parameter, it connects successfully to the host.

I noticed in the logs that the following is output, and I'm not sure if it's a quirk of how the log is output or if this is what is being passed to rtl_433:

Code: Select all

2020-01-30 17:17:20.122 Status: Rtl433: Worker started... (Extra Arguments: -d rtl_tcphostname1234)
Note the lack of slashes and colons in the address.

When I was setting up the rtl_sdr yesterday, I managed to get Domoticz to connect via rtl_tcp when the device was running locally, but for some reason, it doesn't like connecting to a remote host (despite rtl_433 itself being happy).

I also installed rtl_mus (which is a Python script which allows multiple clients to connect to rtl_tcp). This runs on the same host as Domoticz and again it can connect to my remote rtl_tcp connection fine. If I then point Domoticz at this "proxy" it still won't connect, despite the "proxy" running on localhost.

Any help would be greatly appreciated.
DJBenson
Posts: 20
Joined: Wednesday 19 October 2016 19:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RTL433 over rtl_tcp

Post by DJBenson »

rtl_tcp on the "server":
Image

rtl_433 on the "client" (same host as Domoticz):
Image

rtl_mus on the "client":
Image

rtl_433 config in Domoticz: (shown here connecting to the rtl_mus service but the same happens if I try to connect to my rtl_tcp instance):
Image

The error in Domoticz (and the URL issue I mentioned above):
Image
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: RTL433 over rtl_tcp

Post by freijn »

DJ

I am not familiair with the software, I am wel known to the dongle and I love the thingy !

You mentioned Server and Client. In your config I see "localhost" Which would mean server and client are the same machine?

Is that correct?
DJBenson
Posts: 20
Joined: Wednesday 19 October 2016 19:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RTL433 over rtl_tcp

Post by DJBenson »

freijn wrote: Friday 31 January 2020 14:30 DJ

I am not familiair with the software, I am wel known to the dongle and I love the thingy !

You mentioned Server and Client. In your config I see "localhost" Which would mean server and client are the same machine?

Is that correct?
No.

The screenshot shows a rather convoluted setup where rtl_mus is connecting to rtl_tcp which is connecting to rtl_tcp on the remote machine but even with a straight rtl_tcp connection between machines, Domoticz is unable to make the connection whereas I can start rtl_433 from the commandline and connect to my remote rtl_tcp session.

Here's the architecture for the two situations (neither work):
Image

So the most simple "out of the box" scenario is having Demoticz connect via rtl_tcp to the remote rtl_sdr host (192.168.1.211:1234). The rtl_433 plugin should support passing the "-d http://host:post" parameter to connect to remote hosts, but it doesn't work*

The second method, is having Domoticz connect to rtl_mus (which in turn connects to my remote rtl_sdr host using rtl_tcp at 192.168.1.211:1234). The communication between Domoticz/rtl_433 and rtl_mus is exactly the same protocol as the above, it's just rtl_mus allows multiple connections.

* When I had the rtl_sdr connected to the Pi directly, I set up rtl_tcp just to play around and Domoticz was able to connect using http://localhost:1234 so I've proven rtl_433 can/should connect via rtl_tcp, it's just it doesn't seem to work (via Domoticz). Again, if I call rtl_433 directly using either of the two options above, it works as expected (which rules out the Pi not being able to connect to rtl_tcp or any firewall issues).
DJBenson
Posts: 20
Joined: Wednesday 19 October 2016 19:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RTL433 over rtl_tcp

Post by DJBenson »

OK there is something definately scewey about how the Domoticz implementation of rtl_433 is trying to connect to remote rtl_tcp connections.

I have used ssh to forward port 1234 on the Domoticz server to port 1234 of the rtl_sdr server, my Domoticz rtl_433 config is still set to rtl_tcp://192.168.1.211:1234 and as soon as the tunnel is opened, the connection springs to life. Now the odd thing is, Domoticz isn't connecting via the tunnel, it's connecting directly, but the port only becomes visible to Domoticz when the ssh tunnel is up. As soon as I kill the ssh session, Domoticz stops responding.

If I switch the Domoticz/rtl_433 config to point to localhost, the connection also works.

So what is it about the Domoticz implementation of rtl_433 that needs the ssh tunnel to be open that vanilla rtl_433 does not need?!
DJBenson
Posts: 20
Joined: Wednesday 19 October 2016 19:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RTL433 over rtl_tcp

Post by DJBenson »

I thought perhaps the output flag (-F csv) which is hard-coded into the Domoticz code (Rtl433.cpp) might be conflicting with the rtl_tcp connection but I've just called the following on the commandline:

Code: Select all

rtl_433 -F csv -d rtl_tcp://192.168.1.211:1234
...and it both connects and returns CSV-formatted output as my devices transmit.

Code: Select all

2020-01-31T17:31:05,,,73,ASK,433.986,,,-0.119,21.982,-22.101,LaCrosse-TX141Bv2,,                                                                                                             124,1,0,-22.200,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,                                                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,No,,,,,,,,,,,,,,,,                                                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
2020-01-31T17:31:18,,,73,ASK,433.978,,,-0.118,21.307,-21.425,LaCrosse-TX141Bv2,,                                                                                                             9,2,0,4.000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,                                                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,No,,,,,,,,,,,,,,,,,,,,                                                                                                             ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
I'm out of ideas.
DJBenson
Posts: 20
Joined: Wednesday 19 October 2016 19:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RTL433 over rtl_tcp

Post by DJBenson »

For now I've created a systemd service (here) which creates an ssh tunnel between my Domoticz host and my rtl_sdr host and that seems to work.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests