SQLite & setpoints

Show the world your Revolution Pi project!
Post Reply
prodromos
Posts: 5
Joined: 22 Nov 2022, 23:28

SQLite & setpoints

Post 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
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: SQLite & setpoints

Post by dirk »

Hi prodromos,
1,2,3) just google RaspberryPi SQLite ;)
4) Have a look at the Tutorial RevPiTimer
prodromos
Posts: 5
Joined: 22 Nov 2022, 23:28

Re: SQLite & setpoints

Post 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 .
User avatar
nicolaiB
KUNBUS
Posts: 931
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: SQLite & setpoints

Post 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
prodromos
Posts: 5
Joined: 22 Nov 2022, 23:28

Re: SQLite & setpoints

Post 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 ...
User avatar
nicolaiB
KUNBUS
Posts: 931
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: SQLite & setpoints

Post by nicolaiB »

IO = Input / Output
prodromos
Posts: 5
Joined: 22 Nov 2022, 23:28

Re: SQLite & setpoints

Post by prodromos »

Thank you very much.the only way to take the data is throught the process image?
User avatar
nicolaiB
KUNBUS
Posts: 931
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: SQLite & setpoints

Post by nicolaiB »

Yes, besides the RevPi compact, which integrated IOs can also queried via gpio subsystem, this is the only way.
prodromos
Posts: 5
Joined: 22 Nov 2022, 23:28

Re: SQLite & setpoints

Post by prodromos »

how can active and inactive a specific output or input with the timer?
User avatar
nicolaiB
KUNBUS
Posts: 931
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: SQLite & setpoints

Post 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
Post Reply