Ankündigung

Einklappen
Keine Ankündigung bisher.

HS display flooded with error messages

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    HS/FS HS display flooded with error messages

    Hello,

    While working on the 4.1 to 4.5 update, I've noticed that each time I hit the icon "Météo" (weather forecast) in the Visu, the display get's flooded with many, many error messages. After a while the messages go away and the Visu still works.
    I guess there are about 2-3 pages of errors. It looks like it is Python errors, mainly 2 different types:

    Index Error: list index out of range
    [5012L,13077L,0L,'EI!=1 and SC[1],"str(__import__('string').strip(SN[1][3]",'
    ',4L,0L,2L,0L]
    File "./../hssrc/hs_logic.py",line 232, in calc
    Hitting the Visu icon triggers a connection to the weather forecast web server.
    The server's reply gets parsed via several GLE sheets and is used to provide the actual data (temp, wind etc) in the Visu.

    I've never seen this behaviour before although I must admit I usually don't connect a display to the HS.
    I suspect that the problem is related to the 4.1 to 4.5 update.

    My server has nothing special (besides the xxAPI).


    Any ides about what would be the best troubleshooting technique ?

    #2
    This logic module 13077.

    It has problems with decoding a string. This happens often when parsing websites due to website changes.

    If everything works fine, you can ignore that.
    Gruß Matthias
    EIB übersetzt meine Frau mit "Ehepaar Ist Beschäftigt"
    - PN nur für PERSÖNLICHES!

    Kommentar


      #3
      If everything works fine, you can ignore that.
      Baustein 13077 is from me.
      It has a bug which I'd like to fix.

      - What would be the best way to do some serious troubleshooting (debug, step etc) ?
      So far, I edit the source file, upload, run, no go ... and again

      - Where can I find the doc about Python, mainly the functions, which is most close to the HS's syntax. The official Python doc is very nice, but barely usable to write/debug a Baustein

      Kommentar


        #4
        While I'm still trying to fix my bug.....
        I'm looking for a way to manually enter data to test my Baustein with different patterns.
        So far, I've only found "Werteingabe", this is fine but accepts only numeric data.

        Is there a way to manually enter alphanumeric data ?

        Also, any trick to execute a Baustein with a pause like in MS-DOS batch file ?

        Thank you

        Kommentar


          #5
          There may be a module for it - I don't know. I found it easiest to use the HS-IP tool (http://service.knx-user-forum.de/?co...load&id=100001). Set up an IP telegram listener, tie whatever you receive to a test KO. You can then enter whatever text you want to send quickly, using your normal PC keyboard, and send it to the HS.

          Kommentar


            #6
            Great tip !
            Thanks a lot.
            The HS-IP is configured to point to the HS, port 7000, TCP
            The HS is configured for IP Empfang: port 7000, TCP

            I've still an understanding problem;
            how should I configure the receiving side to get the text from the sender ?
            I guess there must be a KO and 14 Byte text, but don't know how to fit it

            Test-HS-IP.jpg

            Kommentar


              #7
              The attachment shows an example. The logic is set up to receive data from a Raspberry, but I could nicely test it using the HS-IP tool. The 'IP Empfang' populates the KO you specify in the 'Receive' tab. The logic then will do the further handling. In my case the one data transmission has 4 data blocks, separated by a semi-colon (ascii 59).
              Bram
              Angehängte Dateien

              Kommentar


                #8
                > The 'IP Empfang' populates the KO you specify in the 'Receive' tab.
                It works :-)
                When a type several words (separated by a space) I get only the last item on display. Quite logical.

                > The logic then will do the further handling. In my case the one data transmission has 4 data blocks, separated by a semi-colon (ascii 59)
                I'll do almost the same. Now that I've a tool I can test if it is my Baustein going mad or a bug in the overall logic outside the function itself.

                Thanks again for your kind help

                Kommentar


                  #9
                  Hello,

                  Can someone help me decode those error messages ?

                  Some data is obvious but the remainder is mistery

                  5012L is a Baustein's command line (what's the "L" behind ?)
                  13077L is the ID number of the Baustein (what's the "L" behind ?)
                  0L ?
                  'EI!=1 and SC[1]'
                  The computation takes NOT place within the initialization and The value of the Variable has changed.

                  "str(__import__('string').strip(SN[1][3]))"
                  Import the text function string, strip the content of The current value memory variable (a 2 dim array)

                  '' ?
                  4L ?
                  0L ?
                  2L ?
                  0L ?
                  I guess the strip is the problem, I guess one of thoses index jumps out of range, probably due to incoherent
                  index value.

                  Any tip about how to debug, please ?


                  ​​​​​​​

                  Kommentar


                    #10
                    Debug Baustein-2.JPG

                    Kommentar


                      #11
                      Raymond, I don't know how to interpret the error data (the 2L, 0L etc), but in 'normal' python the 'list index out of range' message implies that you are trying to access an index number that does not exist. In 'normal' python the first element of a list has index number 0, does your Baustein consider that? In other words, if you loaded 5 elements in your list, the index number of the last one will be '4'. If the list has not been populated yet, any call of an index number will give the 'out of range' error.

                      If the Baustein would know the size of the list, then you can pre-populate it with blanks or null values using a 'for'-loop. Alternatively you can use the .append method to add elements to an existing list. To initialize an empty list, use something like 'list_13077 = []'.

                      I have never tried to program a Baustein, so I have no idea how the 5012-lines compare to 'normal' python code.

                      Maybe the information above helps :-).

                      Bram

                      Kommentar


                        #12
                        > in 'normal' python the 'list index out of range' message implies that you are trying to access an index number that does not exist
                        Agree

                        > In 'normal' python the first element of a list has index number 0
                        Agree, it is so for many languages, the HS being an exception

                        > does your Baustein consider that?
                        I firstly started with index 0, when I realized my mistake, I changed to start at 1, hoping for a quick fix...bad luck :-(

                        Kommentar


                          #13
                          > In 'normal' python the first element of a list has index number 0
                          Agree, it is so for many languages, the HS being an exception

                          Mmmmm (embarassed)
                          in several places in the doc, it is stated that arrays start at 1.
                          While debugging my Baustein (which is a pain) I tried to read the index starting from 0, and it worked perfectly well, as expected.
                          I guess the doc is talking about something else (maybe an input array?) or is it me walking besides my shoes ...

                          Kommentar


                            #14
                            Hi Bram,
                            Don't know how to reply to your previous message.

                            > the problem has been resolved?
                            No, not yet, I'm rather slooooow. A good diagnostic is the first step to a quick fix ;-|
                            The problem has been correctly identified (hope so)
                            I modified the Baustein in order to gather more info for debugging, and guess what ...
                            The error messages are correct :-(
                            When more than 4 fields are decoded, no problem, only the first 4 are taken into account
                            When less than 4 fields are decoded .... the array index gets corrupted and ...
                            So, it is a dumb programming mistake on my side. I found a similar Baustein where the case is handled correctly, I've to put it together

                            Now ... the Baustein is used for the weather forecast, and the forecasts are divided in 4 blocks (morning, noon, after-noon, evening)
                            Soooo, in the morning, 4 blocks are provided by the RSS feed and the parsing works well
                            After-noon, obviously there are no forecast for the morning (heck, they can't go wrong on that), hence only 3 blocks are send ... and here goes my nice index (in die Luft, ja)
                            Same for the evening, only 2 blocks.
                            Funny thing, I know this from day one, but didn't realize.
                            Funny thing #2, the output has always been correct, hence the problem went un-noticed... until a crummy put a display on the HS and hitting the forecast request

                            The HS-IP helped a lot for simulating the separator character and the input string.
                            Thank you

                            PS: in the past, I've heard rumors about a "true" programming language being available "soon". Any update ?

                            Kommentar


                              #15
                              If the programming method of the Baustein allows this, then you can initialize the list with 4 blank fields. The index then will never be out of range. If you populate your website readings in reverse order (evening, ...., morning), then your first x fields​ will always be valid, depending on the time of day. When a field is blank, that part of the day has passed. The rest can be displayed in your visu.

                              Kommentar

                              Lädt...
                              X