jchassin / homebridge-owfs

Home bridge plugin interfaced to OWFS (1-wire)
MIT License
5 stars 3 forks source link

Remote owserver issue #2

Closed mroi-perso-49 closed 6 years ago

mroi-perso-49 commented 7 years ago

Hi,

Thanks for sharing the great job !

I am trying to connect to a remote owserver, I have successfully tested remote access using owread : owread -s 192.168.0.8:4304 /28.FF5DD5641501/temperature 22.4375

In homebridge I have configured a DS18B20 : [Temp] Initializing OWFS_DS18B20 accessory... [Temp] Configuring device : 28.FF5DD5641501 on 192.168.0.8:4304

But retrieving the temperature fails : [Temp] Error reading /28.FF5DD5641501/temperature

In the examples on owjs repo the instanciation looks like : var client = new owjs.Client({host:'192.168.0.8'});

At line 28 of the remote host instanciation there is : this.OwfsCnx = new Client(this.hostPort, this.hostIp);

I do not know much of js but maybe there is something related to this.

Thanks a lot for your help,

Maximilien.

jchassin commented 7 years ago

Hi Maximilien, I'll check asap and I'll bet that you've found the issue, I don't have lot of hardware to test it now, don't hesitate to propose a fix, I'll merge it Anyway, as soon as I have some testing capabilities, I'll fix this this Regards, Jean

mroi-perso-49 commented 7 years ago

Thanks for your quick reply. I forked your project and changed line 28 to : this.OwfsCnx = new Client({host:this.hostIp, port:this.hostPort}); And now the temperature is fetched from the remote owserver. I tried to make a pull request but I could not commit this only change. For publishing on npm and testing on homebridge I had to change the name of the package ; those modifications should not be merged to your project. If I create a pull request with all the modifications I have made can you accept only what is really needed ?

Regards,

Maximilien.

jchassin commented 7 years ago

Not fully familiar with GIT, otherwise, just give me the modified ligne here and I'll change it in the main branch directly Jean

mroi-perso-49 commented 7 years ago

Change line 28 to : this.OwfsCnx = new Client({host:this.hostIp, port:this.hostPort}); Been working fine here for a few days now :-)

Maximilien.

wolfiesax commented 6 years ago

Good catch Maximilien, works for me too. This is how I got it working:

  1. Uninstall current homebridge-owfs plugin

    sudo npm uninstall -g --unsafe-perm homebridge-owfs

  2. Cloned latest code on master branch to downloads folder:

    cd ~/downloads; git clone https://github.com/jchassin/homebridge-owfs.git

  3. Changed row #28 in file /home/pi/downloads/homebridge-owfs/index.js according to your instruction above.
  4. Install updated plugin

    sudo npm install -g --unsafe-perm /home/pi/downloads/homebridge-owfs

and whola, values are finally being shown on Apple Home app :-)

jchassin commented 6 years ago

Commited => to be packages in version 1.3.2