Announcement

Collapse
No announcement yet.

Delays in Reading Digital Pins

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Delays in Reading Digital Pins

    I have recently expanded my Arduino set-up to cover some digital inputs consisting of two magnetic reed switch sensors on my garage doors (one per door indicating open or closed) and a Relay Sheld driving two relays (one per door opener.) The problem is that there seems to be a delay with the Arduino reporting changes to the sensor status. A 2-10 second delay is often noticed, but the delay may extend to as much 30-60 seconds or more, especially after the system has been running for a while. The experience so far is that the data eventually catches up, or so it seems, but it's nowhere near as instant as I'd expect. FWIW, outputs for the relay shield are almost instantaneous.

    Edit: One more thing... I notice that my Analog Sensor Input reads occur every 10 seconds, could this be related/tied to the read frequency to the Digital Input Reads??

    In other threads dating back to August, mentioned was made about some USB issues being corrected in an upcoming release. Any ideas as to if my issue could be related to a USB read delay?



    My set-up is as follows:

    Lenovo M70q PC w/16 GB
    HomeSeer Version: HS3 Pro Edition 3.0.0.548
    Operating System: Microsoft Windows 11 Pro - Work Station
    System Uptime: 0 Days 0 Hours 13 Minutes 26 Seconds
    IP Address: 192.168.1.xxx
    Number of Devices: 221
    Number of Events: 43
    Available Threads: 1200
    HSTouch Enabled: True
    Event Threads: 0
    Event Trigger Eval Queue: 0
    Event Trigger Priority Eval Queue: 0
    Device Exec Queue: 0
    HSTouch Event Queue: 0
    Email Send Queue: 0
    Anti Virus Installed: Windows Defender
    In Virtual Machine: No MFG: lenovo
    Enabled Plug-Ins
    1.0.0.131: Arduino Plugin
    3.4.1.0: Caddx
    3.0.7806.23606: UltraWeatherWU3
    3.0.0.54: UPBSpud
    3.0.7.0: Z-Wave

    The Arduino is hooked up to a USB 2.0 port on the PC that IDs as Com3.

    Here is a screen shot of the Arduino Config page in HomeSeer:

    Click image for larger version  Name:	image.png Views:	0 Size:	74.2 KB ID:	1572036

    #2
    Delays are not normal. I have 4 Arduino Megas and 5 NodeMCU boards. I do not ever see a delay in inputs reporting. I wrote about it 5 years ago here and I still run the tests occasionally. My Arduino delays remain at .01 seconds or just over.
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Thanks for that! As an experiment, I changed the Analog Input refresh times to 1 second (1000 ms) from 10 seconds (10,000 ms). And… the Digital Input refresh shorted to 1 second. Based on Randy’s response my assumption is that these refresh rates (Digital vs Analog) should not necessarily be linked, yet mine are. I really don’t need the analog inputs to refresh that often, but if I have to live with it, then so be it.

      I have tested this on two UNO boards (my original and the backup), so this does not appear to be a Arduino hardware issue. That would seem to leave it as a Sketch problem or a Plug-in problem.

      Any other thought or ideas?

      Comment


        #4
        Originally posted by Techvet View Post
        Thanks for that! As an experiment, I changed the Analog Input refresh times to 1 second (1000 ms) from 10 seconds (10,000 ms). And… the Digital Input refresh shorted to 1 second. Based on Randy’s response my assumption is that these refresh rates (Digital vs Analog) should not necessarily be linked, yet mine are. I really don’t need the analog inputs to refresh that often, but if I have to live with it, then so be it.

        I have tested this on two UNO boards (my original and the backup), so this does not appear to be a Arduino hardware issue. That would seem to leave it as a Sketch problem or a Plug-in problem.

        Any other thought or ideas?
        Hopefully Greig will weigh in. I don’t use analog inputs on all but one board. It is a Mega. I’ll see if I can confirm the same issue on mine.

        HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

        Comment


          #5
          Originally posted by randy View Post
          Hopefully Greig will weigh in. I don’t use analog inputs on all but one board. It is a Mega. I’ll see if I can confirm the same issue on mine.
          This should not be linked in any way but may be a bug in the HS3 version of the plugin running on USB. Sorry but as I am now only supporting the HS4 version of the plugin I have no way to test or fix it in HS3.

          Greig.
          Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
          X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
          Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
          Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
          Scripts =
          Various

          Comment


            #6
            No worries. Everything updates every second and the analog inputs are temperature reads that usually change slowly. There are only 3 of them so it’s not too taxing for the system. I plan on a HS 4 migration in the not too distant future.

            Comment

            Working...
            X