mknx / smarthome

http://mknx.github.io/smarthome/
GNU General Public License v3.0
126 stars 68 forks source link

Generic Serial Plugin #9

Open mishoboss opened 11 years ago

mishoboss commented 11 years ago

Hi, is there a generic serial plugin? Seems there isn't one, and this is a key feature, especially for DIY projects like Arduino.

mknx commented 11 years ago

Hi,

no there is no generic plugin. What should it do? You have to implement some kind of protocol for the communication. And reading/writing to the serial interface is quite simple. See the dmx plugin as a reference.

so long

Marcus

mishoboss commented 11 years ago

Hi, it would be useful for all kind of serial communications (rs-232, rs-485, etc.). Controlling serial devices via ASCII protocol, receiving strings from the serial bus, etc. Also if a regular expression is applied above the serial, it could be used to parse the received string to useful data and feed bool or numeric items.

For example I have made a DIY Arduino based thermostat, that communicate over serial via custom very simple ASCII protocol (e.g. zone1_heating=on\n - turns ON the heating on Zone 1). The device sends data of type "zone1_temp=23.5\n", "zone2_humidity=64\n", etc.

mishoboss commented 10 years ago

Is there any progress in that issue? Is there any solution to the example I gave? How you deal with custom Arduino hardware?

mknx commented 10 years ago

I don't use an arduino, so I don't have to deal with it. Right now: if you want a plugin, you have to write it by yourself.

mishoboss commented 10 years ago

Thanks for the answer. Actually the idea is to have a generic serial plugin and to provide the protocol mapping as a regex, so it could be highly reusable with any ASCII serial hardware. I'm not sure if I could do this, as I'm not a python guy at all, but I could try if you provide some bootstrapping. Can I start by modifying some of the existing plugins that use serial communication? Which one would you reccomend?