Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Vera
  4. Strange statstics with Ethernet GW and Vera

Strange statstics with Ethernet GW and Vera

Scheduled Pinned Locked Moved Vera
3 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jocke4uJ Offline
    jocke4uJ Offline
    jocke4u
    wrote on last edited by
    #1

    Hi,

    I experience some strange behavior with Vera3 and Ethernet GW.

    A little background

    In order to understand and collect some statistics of my sensor network I have hacked L_Arduino.lua in Vera3 to log values received by MySensor GW and timestamp.

    Change in L_Arduino.lua

    local function setVariable(incomingData, childId, nodeId)
        if (childId ~= nil) then
            -- Set variable on child sensor.
            local index = tonumber(incomingData[5]);
            local varType = tVarLookupNumType[index]
            local var = tVarTypes[varType]
            local value = incomingData[6]
            local timestamp = os.time()
            if (var[2] ~= nil) then 
                log("Setting variable '".. var[3] .. "' to value '".. value.. "'")
                setVariableIfChanged(var[2], var[3], value, childId)
        
                -- Handle special variables battery level and tripped which also
                -- should update other variables to os.time()
                if (varType == "TRIPPED" and value == "1") then
                    local variable = tVeraTypes["LAST_TRIP"]
                    setVariableIfChanged(variable[2], variable[3], timestamp, childId)
                else
                    local variable = tVeraTypes["LAST_UPDATE"]
                    setVariableIfChanged(variable[2], variable[3], timestamp, childId)
                end
                -- Start Jocke: adding statistics logging
                local file = io.open("/dataMine/JJLogs/JockeMonitor_"..childId.."_"..var[3]..".log", "a")
                file:write(timestamp.."\t"..value.."\n")
                file:close()
                -- End Jocke
            end
            //...snip...
        end
    end
    

    Then I can copy the data into Excel to do some very simple analysis e.g. see if no transmission was received as expected.
    The sensor used in this scenario is EnergyPulseSensor which send every 20 sec (not comparing the previously value for the test) so 20 sec between transmissions is expected (but tolerate up to 23 sec). Quite often I can see 40, 60 and in this case the transmission failed 1 or 2 times. Also I have got values in between e.g. 29 sec which can indicate that GW (or something is under heavy load)

    So to the issue...
    Yesterday I assembled a prototype for Ehernet GW to replace my current serial GW and let it run over night.
    I can now see quite many "duplicated" values i.e. time from previous is 0 but it's not consistent.
    This doesn't happen with serial GW so I suspect Ethernet GW calling setVariable(..) several times
    See Excel file
    Test5MySensors.xlsx

    Any idea? A bug?

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      @jocke4u said:

      Switching gateway shouldn't matter. It does not contain any logic related to this. In the plugin on the other hand the setVariableIfChanged is used to prohibit setting a variable to the same value.

      jocke4uJ 1 Reply Last reply
      0
      • hekH hek

        @jocke4u said:

        Switching gateway shouldn't matter. It does not contain any logic related to this. In the plugin on the other hand the setVariableIfChanged is used to prohibit setting a variable to the same value.

        jocke4uJ Offline
        jocke4uJ Offline
        jocke4u
        wrote on last edited by
        #3

        @hek
        Yes I know about setVariableIfChanged preventing to set unchanged Vera variables but I log all setVariable calls (unless childId or serviceId is null) and have not seen this with serial GW so I thought Ethernet GW was sending duplicate messages.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        12

        Online

        11.7k

        Users

        11.2k

        Topics

        113.1k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular