DDorch / Rthingsboard

R package for interacting with the API of ThingsBoard open-source IoT platform.
GNU Affero General Public License v3.0
3 stars 0 forks source link

Infinite loop on getTelemetry with several keys #5

Closed DDorch closed 2 years ago

DDorch commented 3 years ago

The following code causes an infinite loop:

url = "http://scada.g-eau.fr"
publicId = "857c5b20-f3e5-11e8-9dbf-cbc1e37c11e3"
entityId = "f0c9cc10-f3e4-11e8-9dbf-cbc1e37c11e3"
startDate = as.POSIXct("2020-10-01")
endDate = Sys.time()
tb_api = ThingsboardApi(url = url, publicId = publicId)
keys = tb_api$getKeys(entityId = entityId)
df <- tb_api$getTelemetry(entityId, keys = keys, startTs = startDate, endTs = endDate)

The code works if the keys are retrieved separately with a loop.