Using ODBC to connect to the Xsensior Lite database

How to create an ODBC connection to your Xsensior Lite data so that you can integrate it into your existing monitoring solution.

1. Obtain the SQLite ODBC drivers from here, you will need the 32bit/64bit version depending on the application you are using to access the database, or just download both if you have a 64bit OS machine.

SQLite ODBC Drivers

2. Install one or both of the drivers, just clicking next - you only need the v3 drivers for Xsensior Lite.

3. Depending on your operating system and/or you application you must choose the relevant ODBC Data Source Administrator application - in this text I will be running a 64bit monitoring system on a 64bit operating system.

SQLite Data Source User

4. Next, choose the "System DSN" tab - you can delete the two example SQLite3 DSNs if you wish (not that one is 32bit and the other 64bit so you have use the other Administrator application to delete them both)

SQLite Data Source System

5. Click on "Add", choose the "SQLite3 ODBC Driver" and click "Finish"

SQLite ODBC Create New Data Source

6. Next enter the details for the Xsenior Lite SQLite database.

The Data Source Name can be whatever you like.

The Database Name must be: 

file:///C:/ProgramData/Openxtra/XSensior Lite/XSensiorLite.sqlite?mode=ro

Please note the "?mode=ro" at the end. You must put that there otherwise the polling service may be prevented from writing to the database.

Set the Lock Timeout to 10000ms

Sync. Mode to NORMAL

Tick Don't Create Database

SQLite ODBC DSN Configuration

7. Press OK and your DSN should be ready to go

Now all you have to do is set up your application to connect to the DSN you named earlier and query the data. An example SQLite statement to get the last logged temperature reading is:

select Value from Reading order by Timestamp desc limit 1

Enjoy
Many thanks to Fernando Viñan-Cano for submitting the above article.

Categories: Xsensior Lite