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.6k 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.
  • J Offline
    J 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
    • H Offline
      H 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.

      J 1 Reply Last reply
      0
      • H 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.

        J Offline
        J 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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        11

        Online

        12.0k

        Users

        11.2k

        Topics

        113.4k

        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