main.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. PROJECT = "Rlian-GATEWAY-G33"
  2. VERSION = "1.0.35"
  3. PRODUCT_KEY = "ddd0422aef65441cbe1c6cccd84e2fa0"
  4. require 'log'
  5. LOG_LEVEL = log.LOGLEVEL_TRACE
  6. _G.COROUTINE_ERROR_RESTART = true
  7. require 'sys'
  8. require "ntp"
  9. require "common"
  10. require "net"
  11. require "nvm"
  12. require "config"
  13. nvm.init("config.lua")
  14. --开机次数+1
  15. nvm.set("bootNum", nvm.get("bootNum") + 1)
  16. net.startQueryAll(60000,600000) --1分钟查询1次信号强度,10分钟查询1次基站信息
  17. require "netLed"
  18. ntp.timeSync()
  19. require "errDump"
  20. -- errDump.request("udp://ota.airm2m.com:9072")
  21. errDump.setNetworkLog(true)
  22. local errorLogReportUrl = nvm.get("errorLogReportUrl") or "udp://47.114.185.186:11114"
  23. local errorLogReportInterval = nvm.get("errorLogReportInterval") or 600
  24. errDump.request(errorLogReportUrl,errorLogReportInterval*1000)
  25. require "devTool"
  26. require "sdModuel"
  27. require "logModuel"
  28. require "gpsTask"
  29. require "ledTask"
  30. require "g33mqtt"
  31. require "modbusTT"
  32. require "otaTask"
  33. require "powerManage"
  34. -- 自动垃圾回收
  35. collectgarbage("setpause", 90)
  36. sys.init(0, 0)
  37. sys.run()