sats fix. full rate on mqtt

This commit is contained in:
xss 2022-04-13 12:50:51 +10:00
parent 7b99bcb94e
commit 97bbffad5b
4 changed files with 46 additions and 14 deletions

2
es.tf
View File

@ -8,7 +8,7 @@ resource "aws_elasticsearch_domain" "ElasticsearchDomain" {
dedicated_master_enabled = false
dedicated_master_type = "t3.small.elasticsearch"
instance_count = 1
instance_type = "r5.xlarge.elasticsearch"
instance_type = "r6g.large.elasticsearch"
zone_awareness_enabled = false
}
cognito_options {

View File

@ -162,14 +162,47 @@ def get_telem(event, context):
},
"query": {
"bool": {
"minimum_should_match": 1,
"must_not": [{"match_phrase": {"software_name": "SondehubV1"}}, {"match_phrase": {"payload_callsign": "xxxxxxxx"}}],
"should": [
{
"bool": {
"must": [
{
"exists": {
"field": "sats"
}
},
{
"range": {
"sats": {
"gte": 1,
"lt": None
}
}
}
]
}
},
{
"bool": {
"must_not": [
{
"exists": {
"field": "sats"
}
}
]
}
}
],
"filter": [
{"match_all": {}},
{
"range": {
"datetime": {"gte": gte.isoformat(), "lt": lt.isoformat()}
}
},
}
]
}
},

View File

@ -3,21 +3,21 @@ import base64
import zlib
# response = get_telem(
# {
# "queryStringParameters":{
# # "payload_callsign": "HORUS-V2",
# "duration": "3d"
# }
# }, {})
response = get_listener_telemetry(
response = get_telem(
{
"queryStringParameters":{
# "payload_callsign": "HORUS-V2",
"duration": "3h"
"duration": "3d"
}
}, {})
# response = get_listener_telemetry(
# {
# "queryStringParameters":{
# # "payload_callsign": "HORUS-V2",
# "duration": "3h"
# }
# }, {})
compressed = base64.b64decode(response['body'])
decompressed = (zlib.decompress(compressed, 16 + zlib.MAX_WBITS))

View File

@ -60,8 +60,7 @@ def lambda_handler(event, context):
else:
incoming_payloads = decoded
#send only the first, last and every 5th packet
payloads = [incoming_payloads[0]] + incoming_payloads[1:-1:5][1:] + [incoming_payloads[-1]]
payloads = incoming_payloads
for payload in payloads:
body = json.dumps(payload)