correcao dos scripts para coletar os tokens e enviar as leituras

This commit is contained in:
2026-06-02 12:58:00 -03:00
parent ccb635167d
commit 97829d4e3a
3 changed files with 1693 additions and 1870 deletions
+5 -23
View File
@@ -7,29 +7,11 @@ with open("dispositivosdata.json", "r") as f:
data=json.load(f);
for item in data:
loops1 = randint(1,9)
loops1 = randint(1,300);
for i in range(loops1):
temperatura = randint(10,40)
umidade = randint(9,85)
myURL = "http://nexuswebdigital.com:9999/feed/{}?temperatura={}&umidade={}".format(item[0]["chave"], temperatura, umidade)
temperatura = randint(10,40);
umidade = randint(9,85);
myURL = "http://nexuswebdigital.com:9999/feed/{}?temperatura={}&umidade={}".format(item["chave"], temperatura, umidade);
response = requests.post(url=myURL);
print(response.text);
time.sleep(0.1);
loops2 = randint(1,9)
for i in range(loops2):
temperatura = randint(10,40)
umidade = randint(9,85)
myURL = "http://nexuswebdigital.com:9999/feed/{}?temperatura={}&umidade={}".format(item[1]["chave"], temperatura, umidade)
response = requests.post(url=myURL);
print(response.text);
time.sleep(0.1);
loops3 = randint(1,9)
for i in range(loops3):
temperatura = randint(10,40)
umidade = randint(9,85)
myURL = "http://nexuswebdigital.com:9999/feed/{}?temperatura={}&umidade={}".format(item[2]["chave"], temperatura, umidade)
response = requests.post(url=myURL);
print(response.text);
time.sleep(0.1);
time.sleep(0.05);