avian2 / ec3k

Use rtl-sdr to receive EnergyCount 3000 transmissions
https://pypi.python.org/pypi/ec3k/
GNU General Public License v3.0
18 stars 7 forks source link

Add a tcp server to serve received readings to systems like domotics #3

Open llagendijk opened 8 years ago

llagendijk commented 8 years ago

I have created a TCP server based on EC3K to serve readings to external systems like domoticz (I am about to submit the driver for Domoticz as well). Would you be interested in merging this into EC3K? I also mad a small modification to the ece3k module to make it work with new osmo-sdr versions.

llagendijk commented 8 years ago

Just for your information: the driver that reds information from the ec3k-server has been merged into Domoticz

avian2 commented 8 years ago

Hi. Thanks for making the pull request. I merged your osmo-sdr fix. I'm not sure about including ec3k-server here. I don't use Domoticz and you did not include any test cases, so I can't test it in a simple way. I'm hesitant to include code in my repo that I can't maintain. Maybe it would be better if you package the server separately (and make it depend on ec3k)?

llagendijk commented 8 years ago

hi Thanks for the feedback.

Testing is fairly simple: just start the server and telnet localhost 3001 and you will see the received readings pass by as json strings. I considered making the server a separate package and was not sure what would be best. I will setup a separate repository for the server which depend on ec3k as you suggested.

molobrakos commented 7 years ago

Maybe you can skip the TCP-server stuff and just keep the output as json on stdout? (adding the TCP-server can easily be done by an external wrapper script in python or using netcat and does not neccessarily have to live in this package).

I am basically trying to do the same by integrating ec3k with Home Assistant (https://home-assistant.io/) and what I currently miss is the scan frequency as a command line argument to the ec3k_recv-script, as well as structured output from the script that can easily be parsed. I am currently using this modified version of ec3k_recv but would like to have the functionality integrated in the ec3k package: https://github.com/molobrakos/ec3kscan/blob/master/ec3k-listen

Edit: Now submitted as https://github.com/avian2/ec3k/pull/4/files