Commit 085e3e42 by jpalanca

Added script to send test data.

parent b601559f
import time
import requests
import json
import random
max_cycles = 200000
orion = 'http://localhost:1026/v2/entities/'
headers = {'Content-Type' : 'application/json', 'fiware-service' : 'sensores', 'fiware-servicepath' : '/'}
name_rpi = "urn:ngsi-ld:Product:001"
for cycles in range(max_cycles):
print('Cycle', cycles)
body = {'quantity' : {'value' : cycles}, 'size' : {'value': (cycles + random.randint(1,101))}}
contents = requests.patch(orion+name_rpi+'/attrs', headers = headers, json = body)
print(contents.status_code, contents.reason)
print(contents.text)
time.sleep(0.1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment