Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2018-09-24 02:47:57

gizmo
Member
From: USA Blackshear, GA
Registered: 2017-01-05
Posts: 24

OwsDrv module - Sensor/Actuator Path

I am planning on converting over from DHT sensors with DHT_Addafruit python scripts to One-Wire Sensors. For my project this would make a lot of sense for me because depending on the size of the build the count of sensors could change.

The grand scheme of this project is to have everything parameter based so that the actual rex algorithms need not to be changed.  Before putting the OwsDrv in effect and alpha testing, I assumed that the configuration could be made external while online. This does not seem to be the case with how the driver works that I know of. My next thought was to use alias names added to the sensor on the OWFS server then use this alias for the OwsDrv, this way if I replace a sensor I could just use the OWFS_HTTP server to add alias to new sensor. This failed to workout as well so I am stumped at the moment.


My main goal of this is to be able to replace sensors without having to use rexygen studio.

Am I missing something hear or just not seeing the obvious?

Anyone have any thoughts or ideas?

I am also thinking that maybe I can create a FAKE Sensor/Actuator on the OWFS side and symbolically mirror the real sensor to the fake that is dedicated to the OwsDrv.


Thanks,

Offline

#2 2018-09-24 02:56:24

gizmo
Member
From: USA Blackshear, GA
Registered: 2017-01-05
Posts: 24

Re: OwsDrv module - Sensor/Actuator Path

Wow please forgive me, I found the solution, 

I thought I searched all topics but I have missed this one a few times. I did not think to look in the (version 2.10.x) forums.

https://www.rexygen.com/oldforum/viewtopic.php?id=45

jaroslav_sobota wrote:

The aliases you ask for are supported by the OWFS package (namely the owserver), which the 1-Wire driver relies on. Please add the following line to your /etc/owfs.conf:

alias = /etc/ow-alias

Now create the file with aliases definition:

sudo nano /etc/ow-alias

And put the following content in:

/28.063BC8040000 = sensor1
/28.1FBFBC020000 = sensor2

Save the file and restart owserver:

sudo service owserver restart

Now run owdir and you should see your aliases. Also you can use

owread /sensor1/temperature12

to read the temperature.

Immediately you can use /sensor1/temperature12 in the OwsDrv driver configuration and therefore you achieved what you were asking for. Except the XML format which we can't do anything about because OWFS is not our product. Hope this helps!

Last edited by gizmo (2018-09-24 13:49:51)

Offline

#3 2018-09-24 11:39:27

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: OwsDrv module - Sensor/Actuator Path

Hi Gizmo,
great question, nice solution ;-) Thanks!

Kind regards,
Jaroslav

Offline

#4 2018-09-24 13:42:44

gizmo
Member
From: USA Blackshear, GA
Registered: 2017-01-05
Posts: 24

Re: OwsDrv module - Sensor/Actuator Path

I have successfully tested this and found that this is the key to what I am needed. I have also tried adding multi pointers in the /etc/owfs.conf configuration file: The goal for this is to be able to use the SILOS function to edit the /etc/ow-alias from an symbolic link inside of the /rex/data/ directory for each individual sensor. This should then allow to be able to edit sensor data from HMI.

Steps I am going to try.
Edit /etc/owfs.conf:

 sudo nano /etc/owfs.conf

Add lines to owfs.conf and save:

alias = /etc/ow-ts1
alias = /etc/ow-ts2
alias = /etc/ow-ds1

Create file ow-ts1 with single alias definition:

sudo nano /etc/ow-ts1

Put the following content in and save:

/28.FFD7816C1403 = ts1

Create file ow-ts2with single alias definition:

sudo nano /etc/ow-ts2

Put the following content in and save:

/10.67C6697351FF = ts2

Create file ow-di1with single alias definition:

sudo nano /etc/ow-ds1

Put the following content in and save:

/05.4AEC29CDBAAB = ds1

Restart owserver:

sudo service owserver restart

Check results with owdir command.

owdir

Results should look very similar to the following:

pi@BETA:~ $ owdir
/ts2
/ds1
/ts1
/bus.2
/bus.1
/bus.0
/uncached
/settings
/system
/statistics
/structure
/simultaneous
/alarm
pi@BETA:~ $

You should now be able to use, /ts1/temperature12,/ts2/temperature,/ds1/sensed, in the OwsDrv driver configuration.

Create SymLink in /rex/data/owfs:
First create the /rex/data/owfs directory:

 sudo mkdir /rex/data/owfs

Next create the Symlink for the three alias files:

sudo ln -s /etc/ow-ts1 /rex/data/owfs/ow-ts1
sudo ln -s /etc/ow-ts1 /rex/data/owfs/ow-ts1
sudo ln -s /etc/ow-ts1 /rex/data/owfs/ow-ts1

List information about the files in the /rex/data/owfs folder:

ls /rex/data/owfs

Results should look exactly to the following providing you used the same file names in this example:

pi@BETA:/ $ ls /rex/data/owfs
ow-ds1  ow-ts1  ow-ts2

Hear is a screenshot of my working example.
OwsDrv_Aliases.png

Last edited by gizmo (2018-09-24 17:52:53)

Offline

#5 2018-09-25 01:38:30

gizmo
Member
From: USA Blackshear, GA
Registered: 2017-01-05
Posts: 24

Re: OwsDrv module - Sensor/Actuator Path

Everything is working out great for me with the OwsDrv module alias.

I have included a zip file link and GitHub link of the example that I screenshot. This example has HMI included.

OwsDrv_Aliases.zip

https://github.com/Thegizmo82/REXYGENexamples-Gizmo

I hope this helps others.

Last edited by gizmo (2018-09-25 01:43:08)

Offline

#6 2018-09-25 07:17:35

mikeyh
Member
From: New Zealand
Registered: 2016-04-28
Posts: 44

Re: OwsDrv module - Sensor/Actuator Path

Thanks gizmo, I actually have a use for something similar on my next project.

Mike

Offline

Board footer

Powered by FluxBB