[prev in list] [next in list] [prev in thread] [next in thread] 

List:       owfs-developers
Subject:    Re: [Owfs-developers] write to the server
From:       Henry Pootel <henry.pootel () regall ! net>
Date:       2016-10-08 12:02:15
Message-ID: 4f35b535-2198-47d3-9533-527967cb12f2 () typeapp ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thank you very much.   I'll try it! 

Henry Pootel 



На 8 окт 2016 г., 13:56, в 13:56, Jan Kandziora <jjj@gmx.de> \
написал:п>Am 08.10.2016 um 12:06 schrieb Henry Pootel:
> > 
> > By another world, I need to make transfer some data from a client
> > to the owserver and read it on the owserver host for other apps.
> > 
> You have to employ the "external" mechanism. First, update to 3.1p1
> or newer as "external" was heavily broken before it. Then see this
> 
> 	http://owfs.org/index.php?page=external-sensor-design
> 
> Example
> =======
> In my setups, I want to control GPIOs on a Raspberry Pi through
> owserver, along with accessing some ownewire sensors connected to
> the Pi through a DS2482.
> 
> My /etc/owfs.conf reads as this:
> ---------------------------------------------------------------------
> i2c=/dev/i2c-1:ALL
> external
> SENSOR: "mysensor@$(hostname)", "myfamily", "myname", "myparameters",
> SCRIPT: "indicator",    "myfamily", y, 1, v, /opt/ow/bin/owgpio,
> /opt/ow/bin/owgpio, "gpio4", "unused",
> SCRIPT: "switch0",      "myfamily", y, 1, v, /opt/ow/bin/owgpio,
> /opt/ow/bin/owgpio, "gpio17", "unused",
> SCRIPT: "switch1",      "myfamily", y, 1, v, /opt/ow/bin/owgpio,
> /opt/ow/bin/owgpio, "gpio18", "unused",
> ---------------------------------------------------------------------
> 
> Obviously, the "i2c=/dev/i2c-1:ALL" line is for the local onewire
> sensors. Below "external", things get interesting.
> 
> 
> SENSOR: defines a single "sensor" within the onewire network.
> 
> First parameter is a unique id of that "sensor". As I have multiple
> Pis in my setup, I included the hostname there to keep the name
> unique.
> 
> Second parameter is the "sensor" family, that is, which "chip type"
> it has. As you may have multiple "sensor"s of that type.
> 
> Third parameter is a name or comment which isn't used by owfs but
> only displayed at some places.
> 
> Fourth parameter are additional parameters passed to the access
> programs when that specific sensor is accessed. It can be used have
> the same family scripts access different underlying devices
> depending on the "sensor". Typically, a filename, device node name,
> or some enumerator is placed here
> 
> 
> SCRIPT: defines an access script for a single property within all
> "sensor"s of a family.
> 
> First parameter is the property name as displayed in the owfs
> directories.
> 
> Second parameter is the family ("chip type") that line belongs to.
> 
> Third parameter is the type of the property. In my case, "yes-no"
> (boolean).
> 
> Fourth parameter is the array type of the property. In my case,
> scalar (single value).
> 
> Fifth parameter is the cache policy, Should be v for volatile for
> parameters which my change without owserver may notice, and s for
> stable for things which usually stay as written by owserver. It is
> debateable whether write-only properties should be "v" at all.
> 
> Sixth and seventh parameter is a program or script called when the
> property is accessed. More on this below.
> 
> Eighth parameter is a parameter passed to the script.
> 
> Ninth parameter is (IIRC, can't find the documentatuion) an alias
> associated with the property.
> 
> 
> And now my magic /opt/ow/bin/owgpio:
> ---------------------------------------------------------------------
> #!/bin/sh
> RW=$4
> GPIO=$8
> 
> case "$RW" in
> read)  cat /sys/class/gpio/$GPIO/value ;;
> write) cat >/sys/class/gpio/$GPIO/value ;;
> esac
> ---------------------------------------------------------------------
> Simple, isn't it?
> 
> 
> Feel free to ask if you have more questions.
> 
> Kind regards
> 
> 	Jan
> 
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most 
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Owfs-developers mailing list
> Owfs-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/owfs-developers


[Attachment #5 (text/html)]

<html><head></head><body><p dir="ltr">Thank you very much.&nbsp; I'll try it! </p>
<p dir="ltr"><!-- tmjah_g_1299s -->Henry Pootel <!-- tmjah_g_1299e --></p>
<div class="gmail_quote" >На 8 окт 2016 г., в 13:56, Jan Kandziora &lt;<a \
href="mailto:jjj@gmx.de" target="_blank">jjj@gmx.de</a>&gt; \
написал:п<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <pre class="blue">Am \
08.10.2016 um 12:06 schrieb Henry Pootel:<br><blockquote class="gmail_quote" \
style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: \
1ex;"><br> By another world, I need to make transfer some data from a client<br> to \
the owserver and read it on the owserver host for other apps.<br> \
<br></blockquote>You have to employ the "external" mechanism. First, update to \
3.1p1<br>or newer as "external" was heavily broken before it. Then see this<br><br> \
<a href="http://owfs.org/index.php?page=external-sensor-design">http://owfs.org/index.php?page=external-sensor-design</a><br><br>Example<br>=======<br>In \
my setups, I want to control GPIOs on a Raspberry Pi through<br>owserver, along with \
accessing some ownewire sensors connected to<br>the Pi through a DS2482.<br><br>My \
/etc/owfs.conf reads as this:<br><hr><br>i2c=/dev/i2c-1:ALL<br>external<br>SENSOR: \
"mysensor@$(hostname)", "myfamily", "myname", "myparameters",<br>SCRIPT: "indicator", \
"myfamily", y, 1, v, /opt/ow/bin/owgpio, /opt/ow/bin/owgpio, "gpio4", \
"unused",<br>SCRIPT: "switch0",      "myfamily", y, 1, v, /opt/ow/bin/owgpio, \
/opt/ow/bin/owgpio, "gpio17", "unused",<br>SCRIPT: "switch1",      "myfamily", y, 1, \
v, /opt/ow/bin/owgpio, /opt/ow/bin/owgpio, "gpio18", \
"unused",<br><hr><br><br>Obviously, the "i2c=/dev/i2c-1:ALL" line is for the local \
onewire<br>sensors. Below "external", things get interesting.<br><br><br>SENSOR: \
defines a single "sensor" within the onewire network.<br><br>First parameter is a \
unique id of that "sensor". As I have multiple<br>Pis in my setup, I included the \
hostname there to keep the name<br>unique.<br><br>Second parameter is the "sensor" \
family, that is, which "chip type"<br>it has. As you may have multiple "sensor"s of \
that type.<br><br>Third parameter is a name or comment which isn't used by owfs \
but<br>only displayed at some places.<br><br>Fourth parameter are additional \
parameters passed to the access<br>programs when that specific sensor is accessed. It \
can be used have<br>the same family scripts access different underlying \
devices<br>depending on the "sensor". Typically, a filename, device node name,<br>or \
some enumerator is placed here<br><br><br>SCRIPT: defines an access script for a \
single property within all<br>"sensor"s of a family.<br><br>First parameter is the \
property name as displayed in the owfs<br>directories.<br><br>Second parameter is the \
family ("chip type") that line belongs to.<br><br>Third parameter is the type of the \
property. In my case, "yes-no"<br>(boolean).<br><br>Fourth parameter is the array \
type of the property. In my case,<br>scalar (single value).<br><br>Fifth parameter is \
the cache policy, Should be v for volatile for<br>parameters which my change without \
owserver may notice, and s for<br>stable for things which usually stay as written by \
owserver. It is<br>debateable whether write-only properties should be "v" at \
all.<br><br>Sixth and seventh parameter is a program or script called when \
the<br>property is accessed. More on this below.<br><br>Eighth parameter is a \
parameter passed to the script.<br><br>Ninth parameter is (IIRC, can't find the \
documentatuion) an alias<br>associated with the property.<br><br><br>And now my magic \
/opt/ow/bin/owgpio:<br><hr><br>#!/bin/sh<br>RW=$4<br>GPIO=$8<br><br>case "$RW" in<br> \
read)  cat /sys/class/gpio/$GPIO/value ;;<br>        write) cat \
&gt;/sys/class/gpio/$GPIO/value ;;<br>esac<br><hr><br>Simple, isn't \
it?<br><br><br>Feel free to ask if you have more questions.<br><br>Kind \
regards<br><br> Jan<br><br><hr><br>Check out the vibrant tech community on one of the \
world's most <br>engaging tech sites, <a href="http://SlashDot.org">SlashDot.org</a>! \
<a href="http://sdm.link/slashdot">http://sdm.link/slashdot</a><br><hr><br>Owfs-developers \
mailing list<br>Owfs-developers@lists.sourceforge.net<br><a \
href="https://lists.sourceforge.net/lists/listinfo/owfs-developers">https://lists.sour \
ceforge.net/lists/listinfo/owfs-developers</a><br></pre></blockquote></div></body></html>




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic