Page 1 of 1

SQLite & setpoints

Posted: 22 Nov 2022, 23:36
by prodromos
hello everyone I have 4 questions for my project that i will use 1 DIO
1)I would like to save the data to SQLite database ,is there any tutorial or quide how to install the sqlite to revolution device?
2)can i take files (what type of files?like CSV?JASON?) in order to introduced to sqlite?how?
3)can I set up setpoints ? or only for analog revolution device?
4)how can i import a timer to DIO in order to stop or start a specific input or output?

thank you

Re: SQLite & setpoints

Posted: 23 Nov 2022, 11:53
by dirk
Hi prodromos,
1,2,3) just google RaspberryPi SQLite ;)
4) Have a look at the Tutorial RevPiTimer

Re: SQLite & setpoints

Posted: 23 Nov 2022, 12:26
by prodromos
thank you !

i have a last question the revolution PI which type of files record the data ? in order to take the file and import it to database .

Re: SQLite & setpoints

Posted: 23 Nov 2022, 12:45
by nicolaiB
The IOs are stored in the process image, which can be read via ioctls. I personally would use Python with the libraries revpimodio2 and sqlite3 for this particular project. Both project have great examples, which should help you with the start.

Nicolai

Re: SQLite & setpoints

Posted: 23 Nov 2022, 13:41
by prodromos
thanks for your reply but what do you mean with IOs? that i have understood is that i should make a image and then to put to SQLite ...

Re: SQLite & setpoints

Posted: 23 Nov 2022, 14:16
by nicolaiB
IO = Input / Output

Re: SQLite & setpoints

Posted: 24 Nov 2022, 19:24
by prodromos
Thank you very much.the only way to take the data is throught the process image?

Re: SQLite & setpoints

Posted: 24 Nov 2022, 23:13
by nicolaiB
Yes, besides the RevPi compact, which integrated IOs can also queried via gpio subsystem, this is the only way.

Re: SQLite & setpoints

Posted: 25 Nov 2022, 09:56
by prodromos
how can active and inactive a specific output or input with the timer?

Re: SQLite & setpoints

Posted: 25 Nov 2022, 12:15
by nicolaiB
If you want to use a timer after a certain value change I would recommend to use the reg_event IO function in revpimodio2 (https://revpimodio.org/en/doc2/io/). In the case that you want to trigger a IO at a certain time you can call a script via a cronjob or use the python library schedule https://schedule.readthedocs.io/en/stable/

Nicolai