This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

rscalc error
#1
Dear all,

I just reflashed my SD card after becoming read-only (LM4). After the recovery, I updated to firmware 20200720.

After restoring my backup I noticed the common rscalc function I use to check if the sun is up is not working any more on my system. 

Code:
function sun_is_up()

  -- returns number of minutes from 0:00 until sunrise and sunset
  latitude = 57
  longitude = 24.15
  log('gerund')
  sunrise, sunset = rscalc(latitude, longitude)

    date = os.date('*t')
    now = date.hour * 60 + date.min

    -- from 0:00 to sunrise
        if now < sunrise then
          alert('before sunrise')
    return false
    -- from sunset to 23:59
        elseif now > sunset then
          alert('after sunset')
    return false
        else
          alert('day')
    return true
        end
end


I always get the following error:


Common functions:7: attempt to call global 'rscalc' (a nil value)
stack traceback:


Does anybody have an idea what this is causing? 
Or does anybody know where the sourcecode of rscalc can be found to check what is going wrong?

thanks
Reply


Messages In This Thread
rscalc error - by s0161038 - 23.01.2021, 11:09
RE: rscalc error - by buuuudzik - 23.01.2021, 12:48
RE: rscalc error - by s0161038 - 23.01.2021, 13:32
RE: rscalc error - by buuuudzik - 23.01.2021, 14:18

Forum Jump: