Russound rnet

If you do still have issues with the serial ports, just use ser2sock and expose the serial device on tcp, then connect to localhost. That would work fine too.

So you mean running OH and ser2sock on the same RP? I’m not yet that familiar with Linux, still learning.
I now have installed OH on a pi3 (Openhabian), still the same issue, so definitly changing over to ser2sock. But I presume I can’t install ser2sock on Openhabian and that I need Rasbian?
Sorry for the off-topic questions!

Yes, I do this no matter where devices actually are.

Here is an example of the line in my ser2net config file which exposes the usb-serial connection to the resounds.

7777:telnet:0:/dev/ttyUSB0:19200 8DATABITS NONE 1STOPBIT banner tr=tr1 timestamp

Then when you create the rnet device, the connection string becomes:
/tcp/192.168.1.30:7777

@craigh is the source code still available over on github? I may be wrapping up (finally) on the sony one in a few weeks and if you want, I’ll try to import the code and get it merged (with your permission of course)

@tmrobert8 yes the source code is here:

https://github.com/QuailAutomation/openhab2-addons/tree/russound-rnet2

Absolutely you have my permission, don’t worry about attribution or anything. Would he happy to see it more accessible for others, I just don’t spend much time with openhab add on development right now.

One feature that would be nice that I never go to would be auto-discovery of zones. I was thinking when the user creates the connection to the resounds, could send one status queries to a bunch of possible zone/controllers and maybe the russound would respond in a way that would make it obvious if there was a zone there or not.

7777:telnet:0:/dev/ttyUSB0:19200 8DATABITS NONE 1STOPBIT banner tr=tr1 timestamp

where do I put this? in /etc/ser2sock/ser2sock.conf?
the layout is different than you suggest.

# Fork into the background?  Default: 0
daemonize = 1

# Serial device

device = /dev/ttyUSB0

# Serial device baudrate
baudrate = 19200

# Port to listen for connections on.  Default: 10000
port = 7777

I believe there are different formats for exposing the usb port

put line like mine at bottom of ser2sock.conf. fix up USB port and tcp port of course.

then restart the service.

you can test with:

telnet <server-port> 7777

Ok, will try that. does it run automatically when the RP is booting?

It really should. Default behavior when you install the package is to start up on boot. So unless you have changed it’s defaults you can expect it to be running. Once you get that line in there and the telnet test spitting you out feedback from the resounds, you can reboot the PI and telnet again when it is done. that’ll let u know.

I installed telnet, got it running, it sees that ser2sock is connected.
My binding went from offline to online after a restart of Openhab,
But telnet isn’t receiving anything, the only time I get something is when I power my russond on, then I get some strange characters.

Trying 192.168.1.38...
Connected to 192.168.1.38.
Escape character is '^]'.
!SER2SOCK Connected
!SER2SOCK SERIAL_CONNECTED
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒^]

I used the same port as you, and of course I changed my IP in the configuration.

I still find it strange that there is nothing mentioned in de conf-file of the above paramters in the documentation of ser2sock (or I looked over it)

I also don’t understand why ‘telnet’ is mentioned in you configuration-line, as I understand it us just a tool to check the tcp transport data? Or is it used for something else? As I mentioned, telnet wasn’t installed when I installed ser2sock.

nevermind, its working!
thanks for the quick and excellent help!
it’s been my first raspbian install, my first git clone and it has been already blood, sweat and tears. I think there’s more to come when i dig deeper :smiley:

glad to hear you got it working. you were delving into details about ser2sock I wasn’t going to be able to answer!

It has been rock solid and worked great for me over the years, so I really don’t remember much about config, etc.

Hi Craig,
thanks for letting us into the Russound RNET! :wink:

I’d like to add the CAV6.6 into my openHAB2 (2.5.10) and just dropped your 2.2.0-SNAPSHOT.jar into /srv/openhab2-addons/ on my openHABian and got the following:

2020-10-30 11:37:04.834 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.russound-2.2.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.russound [223]
  Unresolved requirement: Import-Package: gnu.io; resolution:="optional"
  Unresolved requirement: Import-Package: org.apache.commons.net.util
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]

Do I miss some prerequisite for this? Otherwise it’s and vanilla openHABian [stable]v1.6-880(769ea17) with openHAB 2.5.10-1.

Thanks!

edit:
Sorry, got it myself:
adding serial1 and network binding did the trick!

Just to have it here as a reference, what I did and as a howto for others:

  1. install a vanilla openHAB2 (not yet tested with OH3)
  2. installed serial1 and network binding
  3. copied @craigh’s JAR (see Russound rnet in /srv/openhab2-addons)
  4. installed and activated ser2sock [1]
  5. my things-file:
    Bridge russound:rnet:rnet [ connectionString="/tcp/192.168.xxx.xxx:7777",numControllers=2,zonesPer=6]{

        Thing russound:rnetzone:1_1 "Zone 1" [controller=1, zone=1]
        Thing russound:rnetzone:1_2 "Zone 2" [controller=1, zone=2]
        Thing russound:rnetzone:1_3 "Zone 3" [controller=1, zone=3]
        Thing russound:rnetzone:1_4 "Zone 4" [controller=1, zone=4]
        Thing russound:rnetzone:1_5 "Zone 5" [controller=1, zone=5]
        Thing russound:rnetzone:1_6 "Zone 6" [controller=1, zone=6]
        
    }
  1. my items file
Group	Russound			"Russound"							// Alle Items überhaupt

Switch 	RS_Rnet_1_1_Status 	"Russound Zone1.1 Status" 			(Russound)	{channel="russound:rnetzone:1_1:status" }
Dimmer	RS_Rnet_1_1_Volume 	"Russound Zone1.1 Lautstärke" 		(Russound)	{channel="russound:rnetzone:1_1:volume" }
Number 	RS_Rnet_1_1_Source 	"Russound Zone1.1 Quelle" 			(Russound)	{channel="russound:rnetzone:1_1:source" }
Switch 	RS_Rnet_1_1_Mute 	"Russound Zone1.1 Stumm" 			(Russound)	{channel="russound:rnetzone:1_1:mute" }

Switch 	RS_Rnet_1_2_Status 	"Russound Zone1.2 Status" 			(Russound)	{channel="russound:rnetzone:1_2:status" }
Dimmer	RS_Rnet_1_2_Volume 	"Russound Zone1.2 Lautstärke" 		(Russound)	{channel="russound:rnetzone:1_2:volume" }
Number 	RS_Rnet_1_2_Source 	"Russound Zone1.2 Quelle" 			(Russound)	{channel="russound:rnetzone:1_2:source" }
Switch 	RS_Rnet_1_2_Mute 	"Russound Zone1.2 Stumm" 			(Russound)	{channel="russound:rnetzone:1_2:mute" }

Switch 	RS_Rnet_1_3_Status 	"Russound Zone1.3 Status" 			(Russound)	{channel="russound:rnetzone:1_3:status" }
Dimmer	RS_Rnet_1_3_Volume 	"Russound Zone1.3 Lautstärke" 		(Russound)	{channel="russound:rnetzone:1_3:volume" }
Number 	RS_Rnet_1_3_Source 	"Russound Zone1.3 Quelle" 			(Russound)	{channel="russound:rnetzone:1_3:source" }
Switch 	RS_Rnet_1_3_Mute 	"Russound Zone1.3 Stumm" 			(Russound)	{channel="russound:rnetzone:1_3:mute" }

Switch 	RS_Rnet_1_4_Status 	"Russound Zone1.4 Status" 			(Russound)	{channel="russound:rnetzone:1_4:status" }
Dimmer	RS_Rnet_1_4_Volume 	"Russound Zone1.4 Lautstärke" 		(Russound)	{channel="russound:rnetzone:1_4:volume" }
Number 	RS_Rnet_1_4_Source 	"Russound Zone1.4 Quelle" 			(Russound)	{channel="russound:rnetzone:1_4:source" }
Switch 	RS_Rnet_1_4_Mute 	"Russound Zone1.4 Stumm" 			(Russound)	{channel="russound:rnetzone:1_4:mute" }

Switch 	RS_Rnet_1_5_Status 	"Russound Zone1.5 Status" 			(Russound)	{channel="russound:rnetzone:1_5:status" }
Dimmer	RS_Rnet_1_5_Volume 	"Russound Zone1.5 Lautstärke" 		(Russound)	{channel="russound:rnetzone:1_5:volume" }
Number 	RS_Rnet_1_5_Source 	"Russound Zone1.5 Quelle" 			(Russound)	{channel="russound:rnetzone:1_5:source" }
Switch 	RS_Rnet_1_5_Mute 	"Russound Zone1.5 Stumm" 			(Russound)	{channel="russound:rnetzone:1_5:mute" }

Switch 	RS_Rnet_1_6_Status 	"Russound Zone1.6 Status" 			(Russound)	{channel="russound:rnetzone:1_6:status" }
Dimmer	RS_Rnet_1_6_Volume 	"Russound Zone1.6 Lautstärke" 		(Russound)	{channel="russound:rnetzone:1_6:volume" }
Number 	RS_Rnet_1_6_Source 	"Russound Zone1.6 Quelle" 			(Russound)	{channel="russound:rnetzone:1_6:source" }
Switch 	RS_Rnet_1_6_Mute 	"Russound Zone1.6 Stumm" 			(Russound)	{channel="russound:rnetzone:1_6:mute" }
  1. put the Russound in a sitemap:
sitemap russound label="Russound"
{
	Frame label="Russound" {
		Group item=Russound label="Russound" icon="player"
	}
}

now I could turn on/off a Zone and mute it or do some volume stuff.

[1] install and configure ser2sock:
make all prerequisites:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libssl-dev telnet git

clone the git and install

git clone https://github.com/nutechsoftware/ser2sock.git
cd ser2sock/
./configure
make
sudo cp ser2sock /usr/local/bin/
sudo cp -R etc/ser2sock /etc/
sudo cp init/ser2sock /etc/init.d/
sudo update-rc.d ser2sock defaults

Configure ser2sock to run as the pi user:

sudo sed -i 's/^EXTRA_START_ARGS=.*$/EXTRA_START_ARGS=\"--chuid openhab:dialout\"/g' /etc/init.d/ser2sock

change the ser2sock configuration in /etc/ser2sock/ser2sock.conf (sudo rights needed):

...
device = /dev/ttyUSB0
baudrate = 19200
port = 7777
...

(adapt device accordingly, if you’re using another port (I have only one USB attached)

start the daemon

sudo /etc/init.d/ser2sock start

could be, you have to reboot your system once.

Hi all, anyone have any luck using this on OH3?

I guess, @craigh’s JAR is not OH3 compatible, I didn’t test it with OH3.
I use remote openHAB to connect to a OH2 running the binding:

Yes, I dropped in Craig’s JAR into OH3, and it was not recognized. Not sure it will get migrated over - but would be great if it was.

So you have OH3 as your main, and you also have an OH2 installation running just for this binding?

short answer: Yes!
long answer: Not quite - I had another two bindings, which weren’t initially on the migration list, one of it I dropped completely (ekey, which I integrated via NodeRed’s UDP functionality) or which were migrated nonetheless. So I used the Pi, which was intended for that for all my “not IP”-related bindings (so I have an USB-only openHAB). That Pi runs OH2 and also the Russound-JAR.

Whatever: using remote openHAB solves that underlying “it works only in OH2”-issue… I don’t think Craig will migrate the binding to OH3, but you’ll never know! :wink:

I have started to migrate to openhab 3.

Here is a binary which supports rnet protocol for russound. Make sure you have serial binding installed and place this file in your addons folder.

https://s3-us-west-2.amazonaws.com/craigham-pub/org.openhab.binding.russound-rnet-3.1.0-SNAPSHOT.jar

It seems to work as it did on 2.x of openhab.

If anyone has the bandwidth to merge this into the main russound binding would be great, I won’t be doing that.

Here is my repo:

Craig

2 Likes