Announcement

Collapse
No announcement yet.

Issue after adding new sensor to DB

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

    Issue after adding new sensor to DB

    mcsTemperature V6.1.3
    I added a 'switch' sensor to the DB, saved and all seemed ok. Added that sensor to one of my charting pages that contains several other sensors, saved and went to the chart. No chart was displayed and these errors appeared in the HS log:
    Code:
    11/21/2010 10:30:14 AM  mcsTemperature  Creating database table for Sensor RainGaugeTip in C:\Program Files\Homeseer 2\DATA\mcsTemperature\mcsTemperature.mdb 
    11/21/2010 10:30:14 AM  mcsTemperature  NewTable: on line 770 Operation is not allowed in this context. 
    11/21/2010 10:31:56 AM  mcsTemperature  BarChartDurationMaxMin on line 90 No value given for one or more required parameters. 
    11/21/2010 10:32:03 AM  mcsTemperature  Draw CD Chart on line 13050 No value given for one or more required parameters. 
    11/21/2010 10:32:15 AM  mcsTemperature  BarChartDurationMaxMin on line 90 No value given for one or more required parameters. 
    11/21/2010 10:32:21 AM  mcsTemperature  BarChartDurationMaxMin on line 90 No value given for one or more required parameters. 
    11/21/2010 10:32:21 AM  mcsTemperature  BarChartMax on line 70 Subscript out of range 
    11/21/2010 10:32:21 AM  mcsTemperature  PopulateBarChart on line 230 No value given for one or more required parameters.
    No data for that sensor has been added to the DB yet so this may be the problem. Just thought you'd like to know about it.
    Best regards,
    -Mark-

    If you're not out on the edge, you're taking up too much room!
    Interested in 3D maps? Check out my company site: Solid Terrain Modeling

    #2
    It looks like the table was not created due the error on statement below. Dont know why property to allow null entries would not be allowed in your specific case. It is a common function used within mcsTemperature.

    770 .Properties("Jet OLEDB:Allow Zero Length") = True

    After the error "NewTable: on line 770 Operation is not allowed in this context. " then all others occur because the table does not exist. You can fix it manually by creating the table using Access with fields of ID (autoincrement), Discrete (Integer/Number), Duration (Integer/Number)

    Comment


      #3
      Actually, the table does exist but is empty (no entries.) mcsTemp created the table with these fields: ID, SampleDate and Duration instead of ID, Discrete and Duration which probably explains the log below. Looking at a table that works I see these fields: ID, SampleDate, Discrete and Duration...

      I triggered this sensor two times (four events: off, on, off, on) to place some entries into the DB and got these in the HS log:
      Code:
      11/21/2010 11:41:05 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:04 AM# AS QT,0 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:05 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:05 AM# AS QT,0 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:07 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:07 AM# AS QT,1 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:08 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:07 AM# AS QT,1 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:27 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:27 AM# AS QT,0 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:27 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:27 AM# AS QT,0 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:30 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:30 AM# AS QT,1 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:30 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:30 AM# AS QT,1 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:45 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:45 AM# AS QT,0 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:45 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:45 AM# AS QT,0 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:50 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:50 AM# AS QT,1 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:41:50 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:41:50 AM# AS QT,1 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:42:38 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:42:38 AM# AS QT,0 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:42:38 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:42:38 AM# AS QT,0 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:42:41 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:42:41 AM# AS QT,1 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again. 
      11/21/2010 11:42:41 AM  mcsTemperature  Log_Discrete: INSERT INTO RainGaugeTip (SampleDate,Discrete) SELECT #2010-11-21 11:42:41 AM# AS QT,1 AS Q1 on line 250 The INSERT INTO statement contains the following unknown field name: 'Discrete'. Make sure you have typed the name correctly, and try the operation again.
      Here's a screen clip of the 'sensors' page showing the new sensor ($8) and another discrete sensor that has been working for a long time:
      Attached Files
      Last edited by mfisher; November 21, 2010, 04:19 PM.
      Best regards,
      -Mark-

      If you're not out on the edge, you're taking up too much room!
      Interested in 3D maps? Check out my company site: Solid Terrain Modeling

      Comment


        #4
        I also see that when this sensor is added, the charting settings for all chart pages are wrong (looks like an offset). I've attached an image that shows the settings for one of my pages and the resulting chart. When I remove this sensor everything returns to normal.

        I am unable to change the polarity of this sensor (won't save.)
        I noticed that deleting the sensor in mcsTemp does not delete the table in the DB - is this by design?
        Attached Files
        Best regards,
        -Mark-

        If you're not out on the edge, you're taking up too much room!
        Interested in 3D maps? Check out my company site: Solid Terrain Modeling

        Comment


          #5
          The error was produced on the allow null for the discrete field and that is why it was not included. I dont recall why I set it up that way. I can remove the logic to set it or just ignore the error if it occurs. Did you try to manually fix it with Access?

          The database values are by design not deleted. Save operations are not allowed when an error appears while a setup page is open.

          Dont want to chase charting issues when it could be caused by what is already known to be a missing entry in the database table.

          Comment


            #6
            Manually added 'Discrete' to the DB & activated the sensor.
            mcsTemp enters data for SampleDate and Discrete but no data for Duration.
            No errors in the HS log.

            Charting issues return when this sensor is added and disappear when it's removed.
            Attached Files
            Last edited by mfisher; November 22, 2010, 10:48 AM.
            Best regards,
            -Mark-

            If you're not out on the edge, you're taking up too much room!
            Interested in 3D maps? Check out my company site: Solid Terrain Modeling

            Comment


              #7
              I started to look into this and need a little more help understanding what problem you are experiencing. It is not obvious to me what is wrong with the posted chart so I do not understand what offset you are referencing. What is wrong with the chart?

              Is $8 a device interfaced via mcsTemperature or a virtual device from somewhere else. If mcsTemperature then what interface?

              Probably the easiest thing for me to work with is two of your mcsTemperature.ini files. One with new sensor and one without. Do you have a problem without the $8 added to a group? It looks like the chart does not use $8.

              Comment


                #8
                The issue with all of my chart pages after adding this sensor is which items are displayed. Notice in the 'setup' page clip above the chart page that "Wx DewPoint", "Wx Outdoor Humidity (F26)" and "Wx Outdoor Temp (128)*" are selected to be drawn. However, when the chart page is displayed "Indoor Humidity", "DS Tempreature" and "Wx Outdoor Temp (128)*" are being drawn. This is what I referred to as a possible "offset."

                $8 is an X10 security sensor (DS11a) interfaced through the ACRF plugin as a HS device. As a point of reference, device $9 is also one of these sensors and has been working correctly in mcsTemp for several years.

                I've attached both versions of my .ini and they are named appropriately.

                Yes, you are correct, $8 was not yet used in any chart pages. I added the sensor, went to add $8 to a chart page, noticed the error and began troubleshooting.

                So, to sum up the issues:
                1) mcsTemp does not correctly create the DB tables when adding a 'switch' sensor: the field 'Discrete' is not created.
                2) Items drawn on a chart page do not correspond to what is set on the 'Group Setup' page for that chart when this sensor is added. They return to normal when it is removed.

                Thanks for your help!
                Attached Files
                Best regards,
                -Mark-

                If you're not out on the edge, you're taking up too much room!
                Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                Comment


                  #9
                  I have been playing with this for awhile and cannot reproduce with my configuration and dont really understand how it could happen. I noticed that your new entry $8 was sorted to the top of the group where it was added while when I add a sensor it goes to the bottom of the .ini group. After a sensor is added on the Sensor page the .ini group is reread and the internal sensor list is rebuilt based upon the new settings following the save. If there are other pages open with mcsTemperature then it is possible that the old list in the post data in the browser page would conflict. I did not reproduce this theory because my new sensor does not change the order since it is at the end.

                  The content of the .ini for your before and after do not show anything that is unusual.

                  Another thing that you can try is to restart mcsTemperature or HS after you save new sensors. Also be certain that mcsTemperature browser pages are closed except the Sensor page when Sensor is added.

                  I know what to do about the database error, but want to resolve the other before a change is made.

                  In my case I am using HS 2.24.0.1 and mcsTemperaure 6.1.27 that are on laptop.

                  Comment


                    #10
                    Thanks for looking into this.

                    Restarting HS (and therefore mcsTemp) has no effect on the charting issue.

                    No other mcsTemp browser pages are open while adding the sensor, nor are any other clients connected.

                    A bit more testing reveals that the charting issue occurs when I add any type of sensor - not just a switch.

                    I was curious about the adding of ini entries to the top of the list rather than the end as you stated, so I tried moving them to the bottom of each section - no change. I then added another device (_78) and it was not added at the top but in sort-order after _73 and before E7. So it seems that the list of devices is sorted and written to the ini as a section rather than as individual keys. This appears to be true for both the [Cals] and [Database] sections.

                    Adding the second 'new' device (_78) did not chage the charting item display error and chart pages are the same as with just one new device added.

                    Can you think of any other tests I might perform to help narrow things down for you?

                    Question: is the proper setting for 'Device Display Order' 'RCur'"? Is this setting related to charting displays?
                    Last edited by mfisher; November 29, 2010, 02:13 PM.
                    Best regards,
                    -Mark-

                    If you're not out on the edge, you're taking up too much room!
                    Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                    Comment

                    Working...
                    X