Using OWServer with complex path ?

Begonnen von lebardix, 06 Juni 2017, 00:33:57

Vorheriges Thema - Nächstes Thema

lebardix

Hi,
I using a 1wire network controled with a soekris PC than more ten years
the server is running on FDQN:4304 very well

But the bus include a 1wire Hub , also the compoment address as this form
/1F.0AC004000000/main/26.A157B6000000/temperature
also i can't read value

my conf marc.cfg

fhemdebug enable
attr global userattr cmdIcon devStateIcon devStateStyle icon sortby webCmd widgetOverride
attr global autoload_undefined_devices 1
attr global logfile log/fhem.log
attr global modpath .fhemdebug enable
attr global userattr cmdIcon devStateIcon devStateStyle icon sortby webCmd widgetOverride
attr global autoload_undefined_devices 1
attr global logfile log/fhem.log
attr global modpath .
attr global motd SecurityCheck:\
\
WEB has no basicAuth attribute.\
telnetPort has no password/globalpassword attribute.\
\
Restart FHEM for a new check if the problem is fixed,\
or set the global attribute motd to none to supress this message.\

attr global room 1
attr global statefile log/marc.save
attr global verbose 5
define telnetPort telnet 7072 global
define WEB FHEMWEB 8083 global

define autocreate autocreate
define JARDOTIQUE OWServer 192.168.1.99:4304
attr JARDOTIQUE room OWDevice

define SWE3 OWDevice 26.A157B600000056 180
attr SWE3 IODev JARDOTIQUE
attr SWE3 event-min-interval .*:3600
attr SWE3 event-on-change-reading .*
attr SWE3 model DS2438
attr SWE3 room OWDevice
attr SWE3 stateFormat { sprintf( "T: %.5f H: %.5f ", ReadingsVal( "SWE3", "temperature", 0), ReadingsVal( "SWE3", "humidity", 0) ) }
attr SWE3 userReadings humidity { ReadingsVal( "SWE3", "humidity", 0 ) }, temperature { ReadingsVal( "SWE3", "temperature", 0 ) }

define Filelog_SWE3 FileLog ./log/SWE3-%Y-%m.log SWE3
attr FileLog_SWE3 logtype text
attr FileLog_SWE3 room Logs


but error SWE3: reading temperature did not return a value
see log files
I am using fhem 5.7 from a virtual box tinycore

Howto add global path to compoment ? /1F.0AC004000000/main/
is-it possible ?

Thanks you



Dr. Boris Neubert

Hi,

would you mind checking the attached modified version (did not test it, so not sure if it even compiles :^)?

Use

define SWE3 OWDevice /1F.0AC004000000/main/26.A157B600000056 180

Please send log.

Kind regards
Boris



Globaler Moderator, Developer, aktives Mitglied des FHEM e.V. (Marketing, Verwaltung)
Bitte keine unaufgeforderten privaten Nachrichten!

lebardix

Hello

I have check with your 11_OWDevice.pm updated

test with
define SWE3 OWDevice /1F.0AC004000000/main/26.A157B600000056 180
define SWE3 OWDevice /1F.0AC004000000/main/26.A157B6000000 180
is same result, No Data

i send files (log + screenshoot of 1wire access from web interface OWFS for 1wire compoment)

thank's

lebardix

Hi Boris,

I found another solution, i have installed in  the virtual linux machine owfs, and i call measure with CustomReadings

define myReadings CustomReadings
attr myReadings room 0-Test
attr myReadings group Readings
attr myReadings interval 10
attr myReadings readingDefinitions temperature:qx(owread -s 192.168.1.99:4304 /1F.0AC004000000/main/26.A157B6000000/temperature),\
humidity:qx(owread -s 192.168.1.99:4304 /1F.0AC004000000/main/26.A157B6000000/humidity)

define myReadingsDisplay weblink htmlCode {CustomReadings_GetHTML('myReadings')}
attr myReadingsDisplay group Readings
attr myReadingsDisplay room 0-Test


this can help you about OWDevice ?

Best regards
Marc


Dr. Boris Neubert

Hi Marc,

allright, I see you found a clever solution.

Anyway I meditated over the code and did not see the reason for getting no value. Would you please mind to run another test for me with the attached module? I added a single line that logs the path to the 1wire device. I expect to see

DEBUG>OWDevice_ReadValue NAME=SWE3 path=/1F.0AC004000000/main/26.A157B6000000/temperature

in the log.

Thank you in advance and best regards
Boris
Globaler Moderator, Developer, aktives Mitglied des FHEM e.V. (Marketing, Verwaltung)
Bitte keine unaufgeforderten privaten Nachrichten!

lebardix

Hi Boris, it's better  ;)

But i do delete first "/" in the path (in my cfg) to receive value


attr global userattr cmdIcon devStateIcon devStateStyle icon sortby webCmd widgetOverride
attr global autoload_undefined_devices 1
attr global logfile log/fhem.log
attr global modpath .
attr global motd SecurityCheck:\
\
WEB has no associated allowed device with basicAuth.\
telnetPort has no associated allowed device with password/globalpassword.\
\
Restart FHEM for a new check if the problem is fixed,\
or set the global attribute motd to none to supress this message.\

attr global room 1
attr global statefile log/marc.save
attr global verbose 5
define telnetPort telnet 7072 global
define WEB FHEMWEB 8083 global

define autocreate autocreate
define JARDOTIQUE OWServer 192.168.1.99:4304
attr JARDOTIQUE room OWDevice
---------------------------------------------------------------------------------------------------------------
define SWE3 OWDevice /1F.0AC004000000/main/26.A157B6000000 180
                                        ^
                                        i do remove this first '/'
--------------------------------------------------------------------------------------------------
define SWE3 OWDevice /1F.0AC004000000/main/26.A157B6000000 180


attr SWE3 IODev JARDOTIQUE
attr SWE3 event-min-interval .*:3600
attr SWE3 event-on-change-reading .*
attr SWE3 model DS2438
attr SWE3 room OWDevice
attr SWE3 stateFormat { sprintf( "T: %5.5f H: %5.5f ", ReadingsVal( "SWE3", "temperature", 0), ReadingsVal( "SWE3", "humidity", 0) ) }
attr SWE3 userReadings temperature { ReadingsVal( "SWE3", "temperature", 0 ) }, humidity { ReadingsVal( "SWE3", "humidity", 0 ) }

define Filelog_SWE3 FileLog ./log/SWE3-%Y-%m.log SWE3



In the same way with (owfs) owread (see screenshot )
owread /1F.0AC004000000/main/26.A157B6000000/temperature return the value
owread //1F.0AC004000000/main/26.A157B6000000/temperature return ServerRead: Data error on //1F.......

You are approaching the right result \\o o// \\o

Thanks
Marc



lebardix

Oops read


#---------------------------------------------------------------------------------------------------------------
#define SWE3 OWDevice /1F.0AC004000000/main/26.A157B6000000 180
#                     ^
#                     i do remove this first '/'
#--------------------------------------------------------------------------------------------------
define SWE3 OWDevice 1F.0AC004000000/main/26.A157B6000000 180

as

---------------------------------------------------------------------------------------------------------------
define SWE3 OWDevice /1F.0AC004000000/main/26.A157B6000000 180
                     ^
                     i do remove this first '/'
--------------------------------------------------------------------------------------------------
define SWE3 OWDevice /1F.0AC004000000/main/26.A157B6000000 180

Dr. Boris Neubert

Thank you, Marc.

I think then we got it. There should be no leading slash in the address specification.

As you would write

define SWE3_direct OWDevice 26.A157B6000000 180

for a 1wire device directly connected to the bus, you would write

define SWE3 OWDevice 1F.0AC004000000/main/26.A157B6000000 180

the device path without leading slash.

I removed the Debug messages, added the DS2409 (address family 1F) to the list of devices, added some documentation, and fixed another bug. Please find attached the release candidates.

Could please report back if these work for you? I will then commit the changes to the repo and make the new versions available for distribution via update.

Best regards
Boris
Globaler Moderator, Developer, aktives Mitglied des FHEM e.V. (Marketing, Verwaltung)
Bitte keine unaufgeforderten privaten Nachrichten!

lebardix

Hi Boris, it's more and more but somes fails ....

1) file downloaded 10_OWServer.pm date  8jun2017 is same as the file 10_OWServer.pm of release 5.8 date 19feb2017 (size = 27232) --> is it okay ?

2) Some declarations in 11_OWDevice.pm not corresponding with my owfs read (see behind diff)

232c232
<                      qw(DATANAB/humidity),
---
>                      qw(HIH3600/humidity),
235c235
<                      qw(S3-R1-A/current S3-R1-A/illumination S3-R1-A/gain),
---
>                      qw(S3-R1-A/current S3-R1-A/illuminance S3-R1-A/gain),

with theses changes , i can read all values with fhem

------------------------------------------------------------------------------------------------
It is now possible that the remarks below are due only to a poor personal knowledge of the functioning of fhem.
I apologize ... so I have some work left ....

3) more importante (see my marc.cfg)
i have test with
attr SWE3 stateFormat { sprintf( "H: %f T: %f ", ReadingsVal( "SWE3", "humidity", 0), ReadingsVal( "SWE3", "temperature", 0) ) }
or
attr SWE3 stateFormat { sprintf( "H: %f T: %f ", ReadingsVal( "SWE3", "temperature", 0), ReadingsVal( "SWE3", "humidity", 0) ) }

but first start fhem.pl , the temperature is Okay but  the humidity value is always = 0  and no data for humidity in table Readings (see screenshoot1)
if i read from webpage the humidity value (screenshoot2) result is a good float value in SWE3 (screenshoot3)

vars and datas appear normaly in result page   (screenshot4)

after the var humidity appear in the table Readings with good value (screenshot5)

4) what is var in Readings tab state
state ????  VAD:2.42 VDD: 4.75 temperature: 20.625
perhaps it's normal

you can also see log file and dataread.log

Thank you for your help, fhem is a good application, scalable and effective, I congratulate you and all developers who participate
Best regards

Dr. Boris Neubert

Hi Marc,

I forgot to save 10_OWServer.pm before attaching it to the post. So please find it here again together with an updated version of 11_OWDevice.pm that includes the differently named readings.

Please be aware that FHEM only reads the values listed in the polls array. These are temperature VAD VDD. You need to set your own list of values to be polled with the polls attribute as

attr SWE3 polls temperature,humidity

Kind regards
Boris
Globaler Moderator, Developer, aktives Mitglied des FHEM e.V. (Marketing, Verwaltung)
Bitte keine unaufgeforderten privaten Nachrichten!

lebardix

Hi Boris, it's fun \\o o// \\o

The HUB controller is well recognized, as well as the specific names of my DS2438 model.

Thank you for attr;) ... I progress with FHEM

I am also progressing for the configuration of my PC soekris 4801 with the TinyCore distribution.
Especially for the packages to be installed and the configuration of Perl modules. I will post a documentation for this type of installation if it is useful to some.

I noticed that there were not all the definitions for the module DS2409, and in particular for the different branches "main" and "aux". (See screenshot). In relation to the documentation of Paul H Alfille http://owfs.org/index.php?page=ds2409

I do not know if that's of any interest, I'll let you judge.

However, access to some registers is important as:
"Discharge" for bus reset
"Event" and "clearevent"
"Control"
But this would undoubtedly result in the addition of a function in the OWDevice module, for a limited number of users, so ...

Thanks again, good weekend
Best regards
Marc

Dr. Boris Neubert

Zitat von: lebardix am 10 Juni 2017, 21:26:55
I am also progressing for the configuration of my PC soekris 4801 with the TinyCore distribution.
Especially for the packages to be installed and the configuration of Perl modules. I will post a documentation for this type of installation if it is useful to some.

I recommend getting an account for wiki.fhem.de and put the documentation there.

Zitat
I noticed that there were not all the definitions for the module DS2409, and in particular for the different branches "main" and "aux". (See screenshot). In relation to the documentation of Paul H Alfille http://owfs.org/index.php?page=ds2409

If you have a look at the OWDevice module, lines 124 to 129, you see that there are no read, write and poll functions defined. It is easy to add for you in the source code. Just copy the syntax from the other devices and test drive it. I would be happy to receive an amended OWDevice module back from you that includes the readings that you deem relevant.

Best regards
Boris
Globaler Moderator, Developer, aktives Mitglied des FHEM e.V. (Marketing, Verwaltung)
Bitte keine unaufgeforderten privaten Nachrichten!