Adding sensors from console

瀏覽次數:73 次
跳到第一則未讀訊息

rog...@yahoo.es

未讀,
2021年4月29日 清晨7:56:452021/4/29
收件者:Sentilo
Hi,
I remember when using Sentilo for first time, I added sensors from console. I could find documentation releted on that point.

After that, we have changed to a new server, we have upgraded to new Sentilo versions, we have added and deleted sensors...

Today I was trying to add several new sensors to Sentilo. As I remembered, I have sent a POST request to <myurl:8081/catalog/provider> with a JSON file and with catalog token as IDENTITY_KEY in header. As usual.

But, today, received response has been "Invalid Credential".

I suspect I could change default catalog token for security reason, but maybe I did not put the same everywhere. Is it possible? Should Sentilo run with this wrong configuration?

Or, where should I get propertly token to add sensors to catalog (I can access to source, to property files, to mongodb, to sentilo-catalog-web...)?

Thanks in advance,

Roger

Sentilo IO

未讀,
2021年4月30日 清晨5:04:222021/4/30
收件者:Sentilo
Hi Roger,

It should work using the catalog token but, as you say,  maybe it's not the best option for security reasons. Anyway maybe the problem is related with the URL you're using (catalog/provider), this "provider" should be created before the request.
The best approach instead using the catalog token is to create a specific "provider" using the Catalog console and use it's own token to create the sensors.
Hope it helps ;)

Regards,

rog...@yahoo.es

未讀,
2021年5月3日 清晨6:36:442021/5/3
收件者:Sentilo
Hi,

Thanks for your response...
This is exactly the way I used. Provider and component were already created in catalog-web-console.

Never mind, it has been solved, but I think you have a bug there. Let me explain:

I was looking for some differences between what I saw in catalog-web-console and as responses of http request from Postman (http:<url:port>/catalog with catalog token)...
First, I check new provider and components were not listed if no sensor was created yet.
After that, I create the first sensor for this provider (also was first sensor for this component, obviously) using catalog-web-console.
Then I already got provider, component and sensor from Postman request.
Finally I could send http POST request with definition of 27 sensors successfully.

It seams that sensor definition using http requests with Postman (or curl) will work just in case other sensors of this provider have already been created before.

I hope it helps.
Regards,
Roger

El dia divendres, 30 d’abril de 2021 a les 11:04:22 UTC+2, io.se...@gmail.com va escriure:

Sentilo IO

未讀,
2021年5月6日 凌晨3:38:322021/5/6
收件者:Sentilo
Hi Roger,

The current behavior is as you said, if you have only created providers or components without sensors there wont' be a JSON body in the response.
We're not fully agreed that this is a bug, because the response definition sets sensors as mandatory, so it's coherent. Anyway we'll keep in mind for further releases.

Thanks !
Sentilo Team

rog...@yahoo.es

未讀,
2021年5月28日 凌晨4:23:062021/5/28
收件者:Sentilo
Thanks,
But may be something lost in translation...
I think there is a bug because no sensors are created (using http request with curl o Postman) when component was empty, and they were fully created after creating the first one "manually".
I'm not talking about console responses of HTTP request, I'm talking about effects of my request (creation of sensors).
I think I could create first sensor of a provider (or component) also using a curl or Postman HTTP request. Isn't it?
Probably my explanation was confuse


El dia dijous, 6 de maig de 2021 a les 9:38:32 UTC+2, io.se...@gmail.com va escriure:

Sentilo IO

未讀,
2021年5月31日 凌晨4:37:542021/5/31
收件者:Sentilo
Yes, maybe something is missing, but hard to tell where is the problem.
If you want, sent us the steps you follow one by one and we'll try to reproduce it.

Regards,


rog...@yahoo.es

未讀,
2021年5月31日 清晨5:08:232021/5/31
收件者:Sentilo
Thanks again,
You should try to follow these two steps:
1. Create provider and component using web catalog page.
2. Send HTTP request using curl or Postman to catalog in order to add a sensor to this component.
I hope it helps!!

If it doesn't work, then, you can try to create first sensor using web catalog page, and then send the HTTP request (but with different sensor name, of course).
El dia dilluns, 31 de maig de 2021 a les 10:37:54 UTC+2, io.se...@gmail.com va escriure:

Sentilo IO

未讀,
2021年6月3日 清晨5:58:482021/6/3
收件者:Sentilo
Hi Roger,

When you add the sensors through the console, there is a small delay for the synchronization between the catalog db and the real time db.
If you're invoking the API inmediately you're working with the real time db and maybe the elements haven't been syncronized.
Maybe the issues you reported are related with this matter.

Regards,

rog...@yahoo.es

未讀,
2021年6月3日 清晨6:06:182021/6/3
收件者:Sentilo
Hi,
No, it isn't. Provider and components were created several days before. And I was trying to create sensors more than once and different days.
Sorry.
Have you tried to follow the steps as described above?
Thanks,

El dia dijous, 3 de juny de 2021 a les 11:58:48 UTC+2, io.se...@gmail.com va escriure:
訊息已遭刪除

Sentilo IO

未讀,
2021年6月8日 上午10:54:522021/6/8
收件者:Sentilo
Hi Roger,

We've executed the test and it works fine for us.
Maybe there is something different in the context...

1. First, create the provider:
step1.png
2. Then create the component using the catalog console:
step2.png
3. Configure the client, in this case, we're going to test the API with Postman:
step3.png
4. Send the request to the API, it returned a succesful response:
step4.png
5. Verify that the sensor is accessible from the catalog:
step5.png

Regards, 
Sentilo Team.
回覆所有人
回覆作者
轉寄
0 則新訊息