Back to Smartcitizen.me

One kit, two accounts?

I am collaborating with a colleague and we both would like to download the data of one SCK from our own computer. Is it possible to add the same kit to two different accounts?

Thanks for you help,
Dara

Hey,

Sorry, this is not possible.
If you don’t want to share the account, in simple terms you can’t download data using the .csv data download option in the kit profile.

However, you can use the API to get the data if you want from any place.

Thanks

Hi, please I am having similar challenge of routing the data from my smartcitizen device to my own website. I want to direct all the sensor readings in my smartcitizen kit to my website so that people can access the data from.my own website. How do I go about it?

Hi,

Data can be accessed through the API (you can make a request from your site to our platform - docs here or you can have your own platform which serves data to your site. Here you have instructions to change it:

https://docs.smartcitizen.me/Guides/getting%20started/Using%20the%20Shell/#changing-mqtt-or-ntp-servers

I have gone through the whole API document but I am stll very confused.
Please what codes will I use from my website to access and display all my sensor readings from my smart citizen device? I want to from my website query my smart citizen kit and display all the sensor readings in a web page in my website.

The shell commands of the API, is that the codes that I wll use on from my website or just to run it at Arduino IDE? I am very confused. the documentation is not specific and clear to me.
I am a web developer, I code very well with PHP, CSS, JavaScript. My website is being hosted and run on a webserver, Apache, and PHP, MYSQL server.

I have tried this code snippet in my website
https://api.smartcitizen.me/v0/devices/:14675/readings
to display the readings in my web page but received an error message that I am not authorised to do that. Why?

My smart citizen device is 14675

Hi @fidelisobodoeze

There is a mistake in the URL, notice the two points before your device id are not needed.

https://api.smartcitizen.me/v0/devices/14675/readings

Also you have to provide other parameters, such as the sensor id. Check the documentation for more info:

https://developer.smartcitizen.me/#get-historical-readings

Here an example to retrieve temperature data from the last month at 4h resolution from your device

https://api.smartcitizen.me/v0/devices/14675/readings?sensor_id=55&rollup=4h&from=2021-10-10&to=2021-11-10

1 Like

Thank you for your suggestion. I tried it on the temperature sensor and got the readings displayed but it could not be displayed in a basic html so that it can be read clearly.

It displayed the temperature sensor readings like this in the uploaded figure.

Please how can I display this reading in a basic web page in .html so that the temperature readings will be easy to read and interpret?
Thanks.

Hi,

It depends. If you want something for you to play at home, it could be something like node-red.
If you want something more advanced, which can be deployed in a website and be seen by others, you would have to get the readings and pass them along something that plots them, and for this you will need to dig into a javascript application (or any other web-app language). We are currently working on this project, which uses a very lightweight javascript library called uplot and that can be easily deployed onto a frontend dashboard, and that you might want to check for reference.

Hope it helps!