Windy Community
    • Unread
    • Categories
    • Groups
    • Go to windy.com
    • Register
    • Login

    PWS - Occasional API Error

    Windy Stations
    2
    16
    3.2k
    Loading More Posts
    • 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.
    • Neil RatanN
      Neil Ratan
      last edited by

      I am new to all of this. I recently fixed some sensors outside and wanted to send them to Windy. I send all my data to an MQTT server (I made it on pythonanywhere.com) and the MQTT sends it to Windy.
      I have checked The data uploads, but occasionally I get an error "Unauthorised". See my server logs:

      THIS-> 2024-12-09 23:56:17 {"message":"Token signature invalid","error":"Unauthorized","statusCode":401}

      2024-12-10 00:11:12 {"update":{"update":{"stations":[],"observations":[{"si":0,"time":"2024-12-10T00:11:09.000Z","temp":18.91,"rh":80.48,"pressure":101449}]},"errors":{"observations":[],"stations":[]}},"result":{"0":{"stations":[],"observations":[{"success":true,"value":{"si":0,"time":"2024-12-10T00:11:09.000Z","temp":18.91,"rh":80.48,"pressure":101449}}]}}}

      THIS-> 2024-12-10 00:26:08 {"message":"Token signature invalid","error":"Unauthorized","statusCode":401}

      2024-12-10 00:41:04 {"update":{"update":{"stations":[],"observations":[{"si":0,"time":"2024-12-10T00:41:01.000Z","temp":18.81,"rh":79.94,"pressure":101493}]},"errors":{"observations":[],"stations":[]}},"result":{"0":{"stations":[],"observations":[{"success":true,"value":{"si":0,"time":"2024-12-10T00:41:01.000Z","temp":18.81,"rh":79.94,"pressure":101493}}]}}}

      Can you tell me why this happens?

      This is the link to my station: link

      SutyS 1 Reply Last reply Reply Quote 0
      • SutyS
        Suty Administrator @Neil Ratan
        last edited by

        @Neil-Ratan Hello there, do you still have the issue with the invalid token? I see your station already started to report since then.

        Neil RatanN 4 Replies Last reply Reply Quote 0
        • Neil RatanN
          Neil Ratan @Suty
          last edited by

          @Suty Yes, I still have the issue. It happens occasionally. I couldn't find any pattern or correlation in them. It just happens randomly.

          1 Reply Last reply Reply Quote 0
          • Neil RatanN
            Neil Ratan @Suty
            last edited by

            @Suty This is from today. It happened again, multiple times and there are more```
            code_text

            
            2024-12-12 11:01:25 {"update":{"update":{"stations":[],"observations":[{"si":0,"time":"2024-12-12T11:01:23.000Z","temp":23.2,"rh":42.64,"pressure":101275}]},"errors":{"observations":[],"stations":[]}},"result":{"0":{"stations":[],"observations":[{"success":true,"value":{"si":0,"time":"2024-12-12T11:01:23.000Z","temp":23.2,"rh":42.64,"pressure":101275}}]}}}
            
            2024-12-12 11:11:41 {"message":"Token signature invalid","error":"Unauthorized","statusCode":401}
            
            2024-12-12 11:21:37 {"update":{"update":{"stations":[],"observations":[{"si":0,"time":"2024-12-12T11:21:35.000Z","temp":22.84,"rh":44.66,"pressure":101285}]},"errors":{"observations":[],"stations":[]}},"result":{"0":{"stations":[],"observations":[{"success":true,"value":{"si":0,"time":"2024-12-12T11:21:35.000Z","temp":22.84,"rh":44.66,"pressure":101285}}]}}}
            
            2024-12-12 11:31:36 {"message":"Token signature invalid","error":"Unauthorized","statusCode":401}
            
            2024-12-12 11:41:50 {"update":{"update":{"stations":[],"observations":[{"si":0,"time":"2024-12-12T11:41:48.000Z","temp":22.42,"rh":46.88,"pressure":101297}]},"errors":{"observations":[],"stations":[]}},"result":{"0":{"stations":[],"observations":[{"success":true,"value":{"si":0,"time":"2024-12-12T11:41:48.000Z","temp":22.42,"rh":46.88,"pressure":101297}}]}}}
            1 Reply Last reply Reply Quote 0
            • Neil RatanN
              Neil Ratan @Suty
              last edited by

              @Suty Hey here are more examples, I am posting the API link too:

              2024-12-12 17:02:21 {"message":"Token signature invalid","error":"Unauthorized","statusCode":401}
              2024-12-12 17:02:21 http://stations.windy.com/pws/update/API_KEY?time=2024-12-12T17:02:19&temp=19.12&humidity=65.50&mbar=1015.74
              
              2024-12-12 17:12:36 {"update":{"update":{"stations":[],"observations":[{"si":0,"time":"2024-12-12T17:12:34.000Z","temp":19.04,"rh":65.99,"pressure":101562}]},"errors":{"observations":[],"stations":[]}},"result":{"0":{"stations":[],"observations":[{"success":true,"value":{"si":0,"time":"2024-12-12T17:12:34.000Z","temp":19.04,"rh":65.99,"pressure":101562}}]}}}
              2024-12-12 17:12:36 http://stations.windy.com/pws/update/API_KEY?time=2024-12-12T17:12:34&temp=19.04&humidity=65.99&mbar=1015.62
              
              1 Reply Last reply Reply Quote 0
              • Neil RatanN
                Neil Ratan @Suty
                last edited by

                @Suty Will I get any solutions here?

                SutyS 1 Reply Last reply Reply Quote 0
                • SutyS
                  Suty Administrator @Neil Ratan
                  last edited by

                  @Neil-Ratan Hi, can you share the API key, that you send there, to my DMs, so we can check that on our end for you?

                  Neil RatanN 1 Reply Last reply Reply Quote 0
                  • Neil RatanN
                    Neil Ratan @Suty
                    last edited by

                    @Suty Done

                    1 Reply Last reply Reply Quote 0
                    • Neil RatanN
                      Neil Ratan
                      last edited by

                      I have not got any error for this

                      I am posting data to this: http://stations.windy.com/pws/update/apiKey?time=2025-01-20T02:55:51&temp=17.96&humidity=68.80&mbar=1016.54
                      
                      2025-01-20 02:55:51,194: {"update":{"update":{"stations":[],"observations":[{"si":0,"time":"2025-01-20T02:55:51.000Z","temp":17.96,"rh":68.8,"pressure":101654}]},"errors":{"observations":[],"stations":[]}},"result":{"0":{"stations":[],"observations":[{"success":true,"value":{"si":0,"time":"2025-01-20T02:55:51.000Z","temp":17.96,"rh":68.8,"pressure":101654}}]}}}
                      

                      But for this I am getting this error, why?

                      I am posting data to this: http://stations.windy.com/pws/update/apiKey?time=2025-01-20T03:05:50&temp=18.23&humidity=68.57&mbar=1016.64
                      
                      2025-01-20 03:05:49,792: {"observations":[{"index":1,"errors":[{"value":"2025-01-20T03:05:50","property":"time","children":[],"constraints":{"isTimestampInLastNMinutes":"time must be in last 60 minutes"}}]}],"stations":[]}
                      

                      This has suddenly started, and it is happening frequently, I have no idea why, if anyone can tell me then I'll be grateful.

                      Interestingly, the previous error is not there anymore. The one mentioned above in other replies.

                      Neil RatanN 1 Reply Last reply Reply Quote 0
                      • Neil RatanN
                        Neil Ratan @Neil Ratan
                        last edited by

                        @Neil-Ratan @Suty I hope you are doing well and not busy. Please have a look at this. You haven't replied to the previous error either. But thankfully, the last error stopped and this one started.
                        I have provided with two log records, 10 minutes apart. I have no idea why it is giving this error. But I copied the link that I sent to windy which led to this error and pasted it on the browser, and windy accepted it.

                        SutyS 1 Reply Last reply Reply Quote 0
                        • SutyS
                          Suty Administrator @Neil Ratan
                          last edited by

                          @Neil-Ratan Could you please send these requests that fail, for example, 5 times with the pause between them for 500ms? If that helps, there is probably a bug on our end, however, if this won't help, please share the whole URL address that you sent.

                          Neil RatanN 2 Replies Last reply Reply Quote 0
                          • Neil RatanN
                            Neil Ratan @Suty
                            last edited by

                            @Suty I didn't quite understand you. Can you please elaborate on why I have to do this and how this will help? As I know, your server will send a reply that there should be min. of 5-minute interval if I send the same request 5 times with a 500ms gap.
                            Just don't mind, I am confused here.

                            SutyS 1 Reply Last reply Reply Quote 0
                            • Neil RatanN
                              Neil Ratan @Suty
                              last edited by

                              @Suty And about the url, I have sent it to you via chat option in detail.

                              SutyS 1 Reply Last reply Reply Quote 0
                              • SutyS
                                Suty Administrator @Neil Ratan
                                last edited by

                                @Neil-Ratan No worries, this was process that wanted my colleagues from you. I will discuss it once more with him on Monday, when he is back.

                                1 Reply Last reply Reply Quote 0
                                • SutyS
                                  Suty Administrator @Neil Ratan
                                  last edited by

                                  @Neil-Ratan To be sure, you still have this issue, right? If you do, please check the time you send there, it seems that both requests are a bit forward (300ms) that is probably the reason why you get these errors.
                                  dc6ee54c-c6ef-4cb1-a112-26d9d0033ceb-image.png

                                  Neil RatanN 1 Reply Last reply Reply Quote 1
                                  • Neil RatanN
                                    Neil Ratan @Suty
                                    last edited by

                                    @Suty said in PWS - Occasional API Error:

                                    @Neil-Ratan To be sure, you still have this issue, right? If you do, please check the time you send there, it seems that both requests are a bit forward (300ms) that is probably the reason why you get these errors.
                                    dc6ee54c-c6ef-4cb1-a112-26d9d0033ceb-image.png

                                    I was guessing it and you pointing it out made me think about it. Yes, it was this time difference issue. The internal RTC of my weather station was slowly moving ahead and over the month it jumped around certain milliseconds ahead.
                                    I pushed a software update into it to update the RTC time every 10 days and now it seems to be working fine. I haven't got any errors since then.

                                    I was thinking of time lagging but it never crossed my mind that it may also get ahead.

                                    1 Reply Last reply Reply Quote 1
                                    • First post
                                      Last post
                                    Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
                                    NodeBB & contributors, OSM & contributors, HERE maps
                                    Terms of Use     Privacy Policy