EDS OW-SERVER Emulator for 1-wire devices



  • This is not really a topic related to MySensors devices, but rather an alternative for some to converting to MySensors 1-wire devices.

    Do you have a setup where you are using Dallas 1-wire devices on an existing 1-wire network on a Raspberry Pi or similar device? I had this setup that I was using with Domoticz before I got my Vera. The setup used a 1-wire USB interface and I had multiple sensors already wired in an inline setup. This, and I already had OWFS installed and working on my Pi device.

    I noticed that Vera had a 1-wire plugin, but it was for a 1-wire to ethernet device called OW-SERVER-ENET. In some searching on this device, I cam across a post on the Vera forum called "MiPi 1wire plugin". This guy had written a perl script that created an XML file that emulated the one that the OW-SERVER device used. In researching his plugin, it did not work for me. It did however give me enough information to build my own using PHP. The emulator that I wrote can be modified to support a number of different 1-wire devices. I currently have temp sensors (DS18S20 and DS18B20) support, 1-wire RTC support (Might need a tweak or two) and a DS2890 1-wire digital pot. It is only 55 lines of PHP code. It uses two commands from the OW File System, "owdir" and "owread" to get the devices and create the XML file.

    Once you have that set up on your Pi device, you will need to set up Apache2 and PHP. I will not go into the setup of these. Place the owserver.php file in the root web folder and add a root cron job to run every minute.

    The last thing is to install the EDS OWServer plugin and set it up using the instructions here . On your Vera, navigate to Devices > OWServer > Add Devices, and you should see something like this:
    0_1482611453768_upload-a3018d6a-a960-4963-b139-fc0ba1f0fb33

    Anyways, here is the github link to the file:
    https://github.com/dbemowsk/OW-SERVER_Emulator

    Happy trails and Merry Christmas
    Dan



  • I had some trouble trying to add my new temp sensors using UI7 on my Vera Plus. I tracked the problem down to the J_OWServer.js file. The original was trying to use a Hash object which gave me errors in my Firefox browser. I made changes to use a plain javascript Object, and I can now add the sensors. I have made changes to that file and have a copy of it in my github repo.


Log in to reply
 

Suggested Topics

  • 5
  • 1
  • 1
  • 3
  • 1

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts