ser2net: Serial USB Gateway to Ethernet. Test on RFLink with Domoticz

It is possible to move the bridge RFLink (read this previous article about how to make a Gateway) on another computer or Raspberry Pi by improve the reception of your devices for example. For this we will use ser2net, an Open Source project (official project page) that allows to publish on the Ethernet of the recovered data on the serial port.

Installation from the source

Is the shortest path, but I prefer to give the procedure in the case or your distribution does not support the apt–get command (under some configurations Docker).

We begin by downloading the latest version available on Sourceforge.

 wget https://sourceforge.net/projects/ser2net/files/ser2net/ser2net-3.0.tar.gz

sourceforge ser2net

Decompress the archive

tar xvfz ser2net-3.0.tar.gz

Then go to the folder

cd ser2net-3.0/

Now we launch the compilation and installation

./configure && make && sudo make install

We create a configuration file

 sudo nano /etc/ser2net.conf

Installation using apt-get

It is much easier to install ser2net help the command apt-get.

 sudo apt-get ser2net

in addition to install all resources, ser2net service is added to the list of services that are automatically started with the system. [

To know the status of the service, run

 sudo /etc/init.d/ser2net status

Configure ser2net for RFLink

Open the configuration file

 sudo nano /etc/ser2net.conf

Get the serial port on your gateway RFLink is plugged (more details in this previous article). Plug the gateway and run sudo dmesg -s 1024. This command allows to recover the system log. At the end of the log is located (the gateway RFLink) USB device just connect. In my case, it is connected to /deb/ttyACM0.

Go down the configuration file and comment out the last lines on telnet and add it.

 6000:raw:600: /dev/8DATABITS NONE 1STOPBIT ttyACM0:57600

The baud rate of the RFLink East of 57600 baud. The data will be returned to port 6000.

Save the configuration (Ctrtl + X then Y) file and then restart the service like this

 sudo /etc/init.d/ser2net restart

Configure serial gateway 1.x or 2.x

For Gateway USB MySensors, the configuration is similar. The method works regardless of the version of the MySensors library. Find the USB port that is connected to the gateway and changed the line below depending on your configuration:

  • 6000: Choose the correct port on your installation
  • USB port: for example / dev / ttyUSB0
  • 115200: baud rate indicated for the key MY_BAUD_RATE

This gives for example

6001:raw:600:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT banner

Restart ser2net to take into account the configuration.

Install a RFLink network Gateway under Domoticz

We now have a RFLink network Gateway very easy to install under Domoticz (or any other software automation also).

Attention . If you already have a USB gateway you want to transform Gateway network, change the configuration rather than create a new one so as not to lose your devices, events…

Go to settings then hardware then

  • Give a name to the Gateway
  • In the list of types choose RFLink Gateway with Lan interface
  • Specify the ip address of the machine on which the gateway is connected. If the gateway is connected on the same machine as the server Domoticz, you can specify either 127.0.0.1 or IP of the computer
  • Specify the port. In this case it will be 6000. You choose (without using a port that is already booked)
  • Save

ser2net gateway rflink domoticz

Go to the Log and trigger a device radio (presence detector, detector test of smoke…)

ser2net passerelle rflink domoticz journal log

That is, you now have a Gateway network at a lower cost (no need to add an Ethernet shield). You can deport the gateway on another post to improve reception for example. This method is not limited to RFLink, we can actually publish it on any data received on the serial port. We can for example use it to transform a serial (USB) MySensors gateway to a network (LAN) gateway.

Subscribe to the weekly newsletter

No spam and no other use will be made of your email. You can unsubscribe anytime.

Tags:

  • Lech Jonczyk

    Thanks for the great tutorial. I think the line below is not correct – I had to change it for me to work:
    6000:raw:600: /dev/8DATABITS NONE 1STOPBIT ttyACM0:57600

    • Hello Lech. Thank you very much for the tip. Have a good day

  • Przemysław Rafał

    Why /dev/8DATABITS?? I have RFLink433E and i dont see in my rasspberry /dev/8DATABITS.
    In log ser2com i see: “Mar 14 19:31:29 raspberrypi ser2net[31442]: Could not open device /dev/8DATABITS NONE 1STOPBIT ttyACM0 for port …ctory”
    I well try /dev/ttyACM0 its my rflink device but result is the same.

    Sorry for my English.

DIY Projects