After seeing a number of posts on this forum and thanks to some advice from @futzle, I’m trying to convert a linux based NAS into a ser2net server so that some USB serial devices can be accessible via and IP and Port in the Vera UI, rather than having to physically attach all the devices directly to Vera.
If this is possible then this ‘server’ can then act as the hub and be addressable for any number of serial devices (usb, rs232 etc.) I have within my ‘node central’ set up. In doing this it will also allow Vera, with it’s z-wave antenna, to be free from restriction and location (other than a need for a power socket)
Currently I’ve stumbled my way through and installed it, and can seem to run it from the SSH window like the following.
/ cd /home/Public/ser2net-2.8-rc2/ ./ser2net
Plus with @futzle’s help I have the entry in ser2net.conf for my USB to serial adapter that is connected to an current cost enviR monitor.
Other than to share the journey (and to get some much needed help on the way) I’m curious to know if i am on the right path and also how I can test it, outside of installing a plugin. Is there a bit of code I can use to see if data is available on the IP and port ?
So while I’ve already started this quest, (even as a newbie to Linux) I’m very keen to hear from people who have installed ser2net before and/ or have such a set up already.
Pasted from a discussion i had with futzle … (To keep it all together)
I have seen a number of mentions on Ser2net in this forum and the website itself is sadly not the most explanatory I've seen. It sounds like it provides you with the ability to hold (host) all your phsyical serial devices USB, RS232 and then allow them to be reference-able via an IP and Port combo.
Indeed, that’s what ser2net does (and it’s the only thing ser2net does).
I picked the port number more or less at random. The server is a Mac and it names the serial device /dev/tty.usbserial. You’ll need to change these accordingly.
And here’s the configuration on the Vera.[/quote]
I think that you are mistaken in thinking that ttyS0 has anything to do with the NAS’s USB system. Its name looks more like a regular serial port, probably one that can only be reached by connecting to jumpers on the NAS’s motherboard. (This is very common on embedded hardware.)
How do I open up port 49402 in linux ?
It’s not clear what you mean by “open up”. If you mean, what causes the port to be listened to for incoming connections, then ser2net does that. If you are talking about a firewall on the Linux machine blocking incoming connections, assuming you have one, then you will need to find the firewall configuration and turn off the firewall (seriously, firewalls on Unix machines inside your LAN aren’t any kind of security, just turn them off).
How do I check and ensure that ser2net is running ? - [i](I tried 'ps aux | less' but could not see it) [/i]
That should show ser2net. If it isn’t then ser2net isn’t running. ser2net has some command-line options that will stop it detaching into the background when you run it; these are useful with debugging. You can use ctrl-C to kill a running program in Linux, just as you do in a DOS shell.
Also you can speak to ser2net over the LAN with telnet:
telnet the-nas 49402
For the CurrentCost you’ll see the long XML strings every few seconds.[/quote]
I’ve been running ser2net on a Raspberry Pi for several months now. My CurrentCost unit is plugged into the Pi and the Pi makes the data available on my network via ser2net. The Vera CurrentCost plug-in gets its data from the Pi. This has worked flawlessly for several months now.
“Assign existing ports” suggests a misunderstanding about TCP networking. You have to pick a port that no one else is using, in the range 1024 to 65535. Only one process can listen on any given port.[/quote]
Agreed, what I meant to lead with was that I tried opening new ports using (the following command line), but they did not seem to register on the NAS, so I did a port scan and could see a number that suggested they might be unused, so as a last resort I tried some of those too.
Definitely switch to your Raspberry Pi if you can. It is more likely to have a working ser2net than a homebrew NAS.
iptables? Just turn the firewall off.
Another useful command is netstat. Use this to see which ports are being listened to:
netstat -l -n
While running ser2net you should see an extra line in the netstat output corresponding to your configured port.
That’s ambiguous. When reporting errors, say what did happen rather than what didn’t. Did it return immediately to the prompt? Did it hang indefinitely while producing no output. Was there an error message?
I’m now up and running on a Raspberry Pi, with Ser2net installed and the Current Cost USB to serial cable is plugged in and Vera is now reading from the EnviR monitor . Wow… Telneting to the port and ip allowed me to see the data being sent by the monitor…
That was so much easier on the Pi, than it was on the antiquated NAS I was using in the first place.