-->
Page 1 of 2

Infinity problem

PostPosted: Mon Mar 16, 2015 1:49 pm
by jankop
I read periodically sensor, everything is fine and suddenly result incomprehensible infinity .
What to do?

Code: Select allCode...
function ReadHTU()
    htu=require("htu21")
   htu.init(sda,scl)
   humi=htu.getHumidity()
   temp=htu.getTemperature()
   fare=(temp*9/5+32)
   print("Humidity:    "..string.format("%.1f",humi).."%")
   print("Temperature: "..string.format("%.1f",temp).." deg C")
   print("Temperature: "..string.format("%.1f",fare).." deg F")
   -- release module
   htu=nil
   package.loaded["htu"]=nil
   end

and Output......
NodeMCU 0.9.5 build 20150311  powered by Lua 5.1.4
I2C init done
Humidity:    51.8%
Temperature: 22.6 deg C
Temperature: 72.6 deg F
Wake up run 4.7 s
>
Hard Restart 16. bÅ™ezen 2015  19:31:54
I2C init done
Humidity:    51.8%
Temperature: Infinity deg C
Temperature: 72.6 deg F

Wake up run 4.8 s

Re: Infinity problem

PostPosted: Mon Mar 16, 2015 10:10 pm
by zeroday

Re: Infinity problem

PostPosted: Wed Mar 18, 2015 5:44 am
by jankop
I tried the new version and it looks fine, thank you.

Re: Infinity problem

PostPosted: Thu Mar 26, 2015 7:54 am
by jankop
Version 20150213 has problems with arithmetic (not with wakeup) and later versions (0.9.5_20150318 for example) have major problems with excitation from a deep sleep. I do not know why this is. I lost a lot of time with it, but without effect. Just after a few minutes or hours to stop the wakeup. Zombie returns!