10 Replies Latest reply on Apr 11, 2016 4:19 PM by aanjan RSS
    rkmetz Explorer

    My Thing wont open, Locked up system.

    We are trying to set up our alert features for our door sensor by changing the value of IsTriggered, which is a property of the Thing from a Thing Shape. We are writing the subscription through the extension Twilio has given us. We are doing a few edits in that script and it works, every time we run we do get the text message from the Twilio account but  it seems to lock up the Thing that we Trigger that alert on within Thingworx. The Thing will not open, show properties, and in return locks up most of our system.

     

    Below is the script that we are using:

     

    if(Things["DoorOpenCloseSensor"].ArmedDisarmed==1){

                    if(Things["DoorOpenCloseSensor"].IsTriggered==true){

     

                                     var params = {

                                     to: "//MY PHONE NUMBER" /* STRING */,

                                     text: "Your Door Has been Opened!" /* STRING */

                                                    };

                    Things["DoorOpenCloseSensor"].IsTriggered=false;

                    // no return

                    Things["TwilioBaseThing"].SendSMSMessage(params);

     

                    }

    }

                    Things["DoorOpenCloseSensor"].IsTriggered=false;

     

    When going to the Thingworx Community forums we noticed a listing that was kind of similar to what is going on with our project. Here is the link to that listing: https://community.thingworx.com/thread/2469

     

    Is there a way to get out of this lockup? Is there something wrong in this script that could be causing this lockup?

      • Re: My Thing wont open, Locked up system.
        aanjan Heavyweight Champ

        To narrow this down, can you try using the mail extension to send mails instead of using Twilio to send texts? Does any error message get logged?

          • Re: My Thing wont open, Locked up system.
            rkmetz Explorer

            Just running a few more tests I've made a new script that sends the SMS messages with out getting locked out of the Thing. The only problem I'm having right now is the one Thing is still locked up, I can't access it. When clicked to see properties, or duplicate, or anything it just shows the loading screen but never actually loads up. I've implemented the new script on the Thing Shape but I still cant access that Thing.

             

            Is there a way that I can unlock that Thing? or get it unstuck so I can edit its properties?

             

            Below is the new scripts that work will all the Things, besides the Thing I cant access because it wont load.

             

            if(me.ArmedDisarmed==1){

            var params = {

              to: "//my number" /* STRING */,

              text: me.SensorName+ ""+ source + " " + eventData.description + " " + me.ArmedDisarmed + " " +me.IsTriggered/* STRING */

            };

             

            me.IsTriggered = false;

            // no return

            Things["TwilioBaseThing"].SendSMSMessage(params);

            }

              • Re: My Thing wont open, Locked up system.
                aanjan Heavyweight Champ

                Well, restarting Tomcat would clear that up, but I suppose you will run into this issue again. You can try restarting the Platform Subsystem though. Also, if you go to Monitoring -> Subsystems, how does the Event Processing and Platform Subsystem look like?

                  • Re: My Thing wont open, Locked up system.
                    rkmetz Explorer

                    When I got to the subsystems Event Processing goes as follows:

                     

                    Core pool size

                     

                     

                    16

                     

                     

                    corePoolSize

                     

                     

                    Max threads that will be created

                     

                     

                    500

                     

                     

                    maxPoolSize

                     

                     

                    Threads currently in pool

                     

                     

                    16

                     

                     

                    curentPoolSize

                     

                     

                    Active threads

                     

                     

                    11

                     

                     

                    activeThreads

                     

                     

                    Tasks awaiting execution

                     

                     

                    0

                     

                     

                    queueSize

                     

                     

                    Max number of threads that existed at one time

                     

                     

                    16

                     

                     

                    largestPoolSize

                     

                     

                    Total number of tasks submitted

                     

                     

                    205

                     

                     

                    submitedTaskCount

                     

                     

                    Total number of tasks completed

                     

                     

                    194

                     

                     

                    completedTaskCount

                     

                     

                    And the Platform Subsystem looks as follows:

                     

                    Event queue size

                     

                     

                    0

                     

                     

                    eventQueueSize

                     

                     

                    Stream queue size

                     

                     

                    0

                     

                     

                    streamQueueSize

                     

                     

                    Memory in use (bytes)

                     

                     

                    294,000,472

                     

                     

                    memoryInUse

                     

                     

                    Total memory allocated (bytes)

                     

                     

                    839,385,088

                     

                     

                    totalMemoryAllocated

                     

                     

                    Thing count

                     

                     

                    46

                     

                     

                    thingCount

                     

                     

                    How would I go about resetting the Tomcat and or the Platform Subsystem.

                    Just assuming when looking at the Subsystems I see a reset button at the top, would clicking that button do the job?

                    Also will I loose any work that was created by restarting our Subsystem?

                     

                    Thank you, sorry for the late reply.

                      • Re: My Thing wont open, Locked up system.
                        aanjan Heavyweight Champ

                        Rachel, I don't see anything abnormal in the thread counts or tasks either. You can see that about 9 tasks were skipped or had failed. I'm not sure if restarting the Subsystem would be as effective as restarting Tomcat, as that would re-initialize everything. You will not lose any work if you saved your Things, as this is equivalent to restarting your laptop/ desktop. To restart the Subsystem, you would need to go to Subystems -> Platform Subsystem and then hit the restart button there. As for Tomcat, is this a local instance or a cloud hosted instance? You would need to pretty much stop/ start the Tomcat service.