Hobbyist Toolkit

Showing results for 
Search instead for 
Did you mean: 

SQLite on the pi (JDP toolkit)

Go to solution

Has anyone managed (or tried) to use the JDP SQLite toolkit on the pi? I was hoping to do some data logging on the pi and thought it might be quite a useful way of doing it (and I want to learn SQLite at the same time for some future projects!)


My code runs fine under windows, but I'm guessing sqlite is not on the pi... any suggestions as to how to do this?


I will cross post this on the jdp toolkit forum too...





0 Kudos
Message 1 of 4
Accepted by topic author psmorris

Yes sqllite3 is not installed by default on the chroot LabVIEW host running inside the Raspberry Pi OS. This is an entire NI Linux system running inside the Raspian host OS and has it's own settings and installation requirements.


Basically you need to get a command shell on your Pi and then change into the NI Linux chroot and from there use opgk to install the sqllite3 package. I don't have access to a running Pi at the moment and can't go through all step by step but these are the principal steps:


- get a command prompt on the Raspi, either through ssh from your computer or directly on the Raspi GUI

- change to the LabVIEW chroot environment

  • sudo schroot -r -c lv

- make sure your Raspi has internet access to pull the necessary files from the NI servers and update opkg and install the sqqlite3 package

  • opkg update
  • opkg install sqlite3

This should give you some version of sqlite3 installed on your NI Linux chroot environment.


Check the version that is installed (on the command line there will be some information of the packages it installs and the version number is inside the package name).


JDP uses generally the latest version available and while SQLLite generally is very backwards compatible, he did use new timestamp support which is only available from 3.31 onwards, so an older version might pose problems if you somehow use timestamps.

Rolf Kalbermatter
My Blog
Message 2 of 4

Thanks Rolf


I had posted on my other post (in the JDP forum) that I'd figured out basically what you said below, but I got called away before I could post the same on here! Glad to hear I worked it out correctly though! I can confirm the version that got installed is compared to 3.40.1 on my windows machine.


Is there any way to get a later version onto the pi? Or am I limited in some way by whatever the LabVIEW install was when I'm in side the chroot?


Can you shed some light on file paths on the pi? I tried to open my database at a path relative to the path returned by the "Get main path.vi" in the hobbyist toolkit (basically that path and then \test.db) but it wouldnt open it there (running in debug mode)... in the end I just set the path as \test.db and that worked fine... am I missing something about where things go relative to the running VI? 





0 Kudos
Message 3 of 4

@psmorris wrote:


Is there any way to get a later version onto the pi? Or am I limited in some way by whatever the LabVIEW install was when I'm in side the chroot?

Well, there is always the possibility to compile your own version of the sqlite3 library. 😁 It is Linux after all! It's not trivial and if you want to make it fully you will have to install a shedload on additional tools on your LabVIEW chroot environment.


You need at least the "gcc" and and likely "gcc-symlinks" package. Or you can try "packagegroup-core-buildessential".


This will definitely allow you to compile the sources, that you download, inside the LabVIEW chroot. Unfortunately most Linux source packages use also some make tool. And assume that you can run .\configure to create the correct make file for your specific platform. This configure script will probe all kind of things on your system to eventually create the correct Makefile for your system. After that you can usually just go into the according directory and do a "make" and "make install". The official sqlite3 library sources are not different. There seem to be some packages that come with pre-generated Makefile stuff but that is always the question if it would work on your specific system.


If you use the amalgation package as explained here, you can however do it all with a single call to gcc.


Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4