Cannot acces counters DS2423 with ownet.php

Help
2010-03-14
2012-09-14
  • Erich Freibert

    Erich Freibert - 2010-03-14

    When trying to access DS2423 with ownet.php there is a error message regarding
    the not declared function "bccmp" in ownet.php line 521. In special this is
    the line: " if (bccmp($ret,0,0)==-1){ "

    I cannot find this function. If i change it to bccomp the counter readings are
    always zero.

    All other readings (temp, voltage, humitity) work well.

    Any idea?

    Regards

    Erich

     
  • Erich Freibert

    Erich Freibert - 2010-03-14

    One more information!

    I have changed the bccmp to bccomp in ownet.php. I think this is right.

    Now line 516(nb .depending on owfs version) is if (bccomp($ret,0,0)==-1){

    When i now use
    var_dump($ow->get("/1D.AF310D000000/counters.A",OWNET_MSG_READ,true));

    the result is:

    array(9) {

    =>

    int(0)

    =>

    int(12)

    =>

    int(12)

    =>

    int(258)

    =>

    int(12)

    =>

    int(0)

    =>

    string(12) " 5825572"

    =>

    int(12)

    =>

    string(1) "0"

    }

    So 'data' shows the right counter value and 'data_php' the wrong.

    I think there must be an error in ownet.php.

    But i'm only a beginner in php programing, so it's hard for me to find the
    error.

    Regards

    Erich

     
  • Erich Freibert

    Erich Freibert - 2010-03-14

    Oh, excuse me for the wrong formating (where are my line feeds???)

    Here again hopefully with linefeeds.

    One more information!

    I have changed the bccmp to bccomp in ownet.php. I think this is right.

    Now line 516(nb .depending on owfs version) is if (bccomp($ret,0,0)==-1){

    When i now use
    var_dump($ow->get("/1D.AF310D000000/counters.A",OWNET_MSG_READ,true));

    the result is:

    array(9) { => int(0)

    => int(12)

    => int(12)

    => int(258)

    => int(12)

    => int(0)

    => string(12) " 5825572"

    => int(12)

    => string(1) "0" }

    So 'data' shows the right counter value and 'data_php' the wrong.

    I think there must be an error in ownet.php. But i'm only a beginner in php
    programing, so it's hard for me to find the error.

    Regards

    Erich

     
  • Erich Freibert

    Erich Freibert - 2010-05-17

    Hi Folks!

    I just had a look on owfs-2.7-p37 and i recognized the problem still exists
    ("bccmp" is wrong, must be "bccomp" and bcadd fails, i think because of the
    spaces in the data).

    No one here to have a look on it?

    Regards

    Erich

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks