Discussion:
[Owfs-developers] owhttpd - get "clean" output
somewire
2014-10-14 20:24:07 UTC
Permalink
Nevermind, I managed to find a way to get those temperatures. I take the
whole answer (html headers, links, text) as a big string then I extract the
only interesting part (from character 1000 to 1004, by example), knowing
that the lenghth of the answering string is constant.




--
View this message in context: http://owfs-developers.1086194.n5.nabble.com/owhttpd-get-clean-output-tp10885p10886.html
Sent from the OWFS Developers mailing list archive at Nabble.com.
Paul Alfille
2014-10-14 20:47:30 UTC
Permalink
If you add /text to the path the result is easier to parse.

For that matter, owhttpd isn't the easiest way to get pure data (as opposed
to a nice display). The file system, shell utilities, ownet within your own
program all give pure text.
Post by somewire
Nevermind, I managed to find a way to get those temperatures. I take the
whole answer (html headers, links, text) as a big string then I extract the
only interesting part (from character 1000 to 1004, by example), knowing
that the lenghth of the answering string is constant.
--
http://owfs-developers.1086194.n5.nabble.com/owhttpd-get-clean-output-tp10885p10886.html
Sent from the OWFS Developers mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Owfs-developers mailing list
https://lists.sourceforge.net/lists/listinfo/owfs-developers
somewire
2014-10-14 21:36:51 UTC
Permalink
Thank you very much for your answer, Paul!

I didn't manage to get a proper way of using /text. I've tried to append it
after "temperature" but I get the following answer: "null</BODY></HTML>".
Were you talking about a command line parameter for wget/lynx?

Anyway, is there another way to remotely access (local network) the owfs
filesystem? May I access the owserver directly (the only one who's listening
on a TCP port - beside owhttpd/owftpd)?

Thanks again for your help. You did a great job with owfs! I first used it 9
(nine!) years ago, when I wrote interfaces using Visual Basic and Delphi!



--
View this message in context: http://owfs-developers.1086194.n5.nabble.com/owhttpd-get-clean-output-tp10885p10888.html
Sent from the OWFS Developers mailing list archive at Nabble.com.
Stefano Miccoli
2014-10-14 22:01:59 UTC
Permalink
Let me tune in; with owserver you should prepend /text to the pathspec:

e.g.
http://localhost:2121/26.8CE2B3471711/temperature

should become
http://localhost:2121/text/26.8CE2B3471711/temperature

or, if you like json,
http://localhost:2121/json/26.8CE2B3471711/temperature

As already pointed out by Paul, for remote access to owserver you have many options: running owdir/owread/owget from the shell or writing your own script in one of the language bindings in module/ownet.

Stefano
Post by somewire
Thank you very much for your answer, Paul!
I didn't manage to get a proper way of using /text. I've tried to append it
after "temperature" but I get the following answer: "null</BODY></HTML>".
Were you talking about a command line parameter for wget/lynx?
Anyway, is there another way to remotely access (local network) the owfs
filesystem? May I access the owserver directly (the only one who's listening
on a TCP port - beside owhttpd/owftpd)?
Thanks again for your help. You did a great job with owfs! I first used it 9
(nine!) years ago, when I wrote interfaces using Visual Basic and Delphi!
--
View this message in context: http://owfs-developers.1086194.n5.nabble.com/owhttpd-get-clean-output-tp10885p10888.html
Sent from the OWFS Developers mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Owfs-developers mailing list
https://lists.sourceforge.net/lists/listinfo/owfs-developers
somewire
2014-10-14 22:15:36 UTC
Permalink
"http://localhost:2121/*text*/26.8CE2B3471711/temperature" it's working
great! I get a plain " 24.25" (including quotes) which is what I
really wanted.

Many thanks, Stefano!



--
View this message in context: http://owfs-developers.1086194.n5.nabble.com/owhttpd-get-clean-output-tp10885p10892.html
Sent from the OWFS Developers mailing list archive at Nabble.com.
Charles Hooper
2014-10-14 21:42:03 UTC
Permalink
Paul,

Do you mean something like this?
http://XXX.XXX.XXX.XXX:2121/28.45E6BD030000/fasttemp/text/

That give me "null</BODY></HTML>".

Would like to get just the fasttemp with no HTML at all.

Charles
Post by Paul Alfille
If you add /text to the path the result is easier to parse.
For that matter, owhttpd isn't the easiest way to get pure data (as
opposed to a nice display). The file system, shell utilities, ownet within
your own program all give pure text.
Post by somewire
Nevermind, I managed to find a way to get those temperatures. I take the
whole answer (html headers, links, text) as a big string then I extract the
only interesting part (from character 1000 to 1004, by example), knowing
that the lenghth of the answering string is constant.
--
http://owfs-developers.1086194.n5.nabble.com/owhttpd-get-clean-output-tp10885p10886.html
Sent from the OWFS Developers mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Owfs-developers mailing list
https://lists.sourceforge.net/lists/listinfo/owfs-developers
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Owfs-developers mailing list
https://lists.sourceforge.net/lists/listinfo/owfs-developers
--
Charles Hooper
+44 7986 841714
Roberto Spadim
2014-10-14 22:14:40 UTC
Permalink
use
http://XXX.XXX.XXX.XXX:2121/
<http://xxx.xxx.xxx.xxx:2121/28.45E6BD030000/fasttemp/text/>text/
<http://xxx.xxx.xxx.xxx:2121/28.45E6BD030000/fasttemp/text/>
28.45E6BD030000/fasttemp
<http://xxx.xxx.xxx.xxx:2121/28.45E6BD030000/fasttemp/text/>
Post by Charles Hooper
Paul,
Do you mean something like this?
http://XXX.XXX.XXX.XXX:2121/28.45E6BD030000/fasttemp/text/
That give me "null</BODY></HTML>".
Would like to get just the fasttemp with no HTML at all.
Charles
Post by Paul Alfille
If you add /text to the path the result is easier to parse.
For that matter, owhttpd isn't the easiest way to get pure data (as
opposed to a nice display). The file system, shell utilities, ownet within
your own program all give pure text.
Post by somewire
Nevermind, I managed to find a way to get those temperatures. I take the
whole answer (html headers, links, text) as a big string then I extract the
only interesting part (from character 1000 to 1004, by example), knowing
that the lenghth of the answering string is constant.
--
http://owfs-developers.1086194.n5.nabble.com/owhttpd-get-clean-output-tp10885p10886.html
Sent from the OWFS Developers mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Owfs-developers mailing list
https://lists.sourceforge.net/lists/listinfo/owfs-developers
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Owfs-developers mailing list
https://lists.sourceforge.net/lists/listinfo/owfs-developers
--
Charles Hooper
+44 7986 841714
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Owfs-developers mailing list
https://lists.sourceforge.net/lists/listinfo/owfs-developers
--
Roberto Spadim
SPAEmpresarial
Eng. Automação e Controle
Loading...