Hopefully I am asking in the right place, being electrical and code, not sure. In short, I want to create a plug and play setup for different devices(mostly sensors and relays) to be attached.

Originally I paid someone to do this, and it technically works, but he wrote a custom protocol to do it. After talking with some other people, they mentioned a standard protocol I can maybe use, but forgot the name.

What I need to accomplish:

  • 300ft communication via custom wired RJ45 cable (using for power ect, not tcp)
  • When a device is plugged in, it should tell the system it's typeId and uniqueId
    • Devices will have a typeId such as 1234 for all temperature sensors
    • Devices will have a uniqueId so the Pi can differentiate between multiple of the same sensors.
  • Virtually unlimited connected devices (so something like a 2wire setup won't work)
  • Should only use a few gpio ports for all connections, not 1 for each device.

Mostly looking for a more standard protocol I can use vs a custom one if possible. All the code is C++ and some pic16 code right now. Still learning all this, so any direction would be helpful.

Thanx ahead of time.

  • I would have thought we would all be using such a protocol if it existed. Given that we are not it is probably non-existent or terribly expensive. Possibly why your developer went for a custom solution.
    – joan
    Nov 27, 2015 at 20:18
  • For anyone else looking, I wanted to give an update, but no answer yet. From the information I have gathered, doing rs485 with modbus looks like it will work. There doesn't seem to be an issue with needing repeaters, tho I can't find when those are actually needed. As for P&P without defining the ID's ahead of time, the ID's can be changed on the fly. So it can have a Default id and then immediately change it to something not already used. Still working on getting it all working, but not my primary project. Jan 2, 2016 at 18:25

1 Answer 1


For Plug and Play you should check UPnP protocol (simply: Universal Plug'n'Play). Google it and check http://www.upnp-hacks.org/upnp.html

For wired connections of sensors and relays you can also try reading about KNX open standard - also try google.

Good luck!

  • Looking up KNX initially looked promising, though I saw that it is open in so far as everyone using it must use the same standards and not so much anyone could use it themselves - any place it is used must be installed by trained/licensed(?) installers. It seems there is standard software to design such things - but it is Windows only and licensed, which to my mind suggests that using KNX with Pis is not so likely. On the other hand OpenHAB looks more promising (though it does seem to know about KNX)...
    – SlySven
    Nov 27, 2015 at 22:15
  • 1
    Agreed SlySven. KNX doesn't look like it will work. Will take a look at OpenHAB. The KNX search also turned up Modbus which is what someone mentioned and looks promising also. Bunch to research tho. Nov 28, 2015 at 0:01
  • 1
    OpenHAB is a wonderful piece of software (I use it myself) so I highly recommend it. On the other hand if you want to try some alternatives to it - check AGO (agocontrol.com) or domoticz (domoticz.com)
    – lewiatan
    Nov 30, 2015 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.