PWS - Occasional API Error
-
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
-
@Neil-Ratan Hello there, do you still have the issue with the invalid token? I see your station already started to report since then.
-
@Suty Yes, I still have the issue. It happens occasionally. I couldn't find any pattern or correlation in them. It just happens randomly.
-
@Suty This is from today. It happened again, multiple times and there are more```
code_text2024-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}}]}}}
-
@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
-
@Suty Will I get any solutions here?
-
@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?
-
@Suty Done
-
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.