SQLite is a lightweight but powerful database management tool. It occupies a little space on the device – a bit more than 500KB, but offers most of the features implemented on other SQL database tools. SQLite is a serverless engine, meaning that the whole database is stored in a single file, and all transactions are reads and write from the file. There are no initial server configurations required – all you need is to create a .db file and start writing queries. This is why SQLite is preferred on small devices like mobile phones, embedded devices, and Raspberry Pi. Previously, we have installed an SQLite into Raspberry Pi, created a database and table with only a few lines of script. We performed all the tasks from the command-line tool. Eventually, you will want to have full control of the database and see the whole picture. Therefore, you should also consider installing SQLite manager, which brings a graphical user interface to work with SQL databases. To run the SQLite manager, you will need to work from the Raspberry Pi desktop. You may want to connect a monitor or use a VNC client to access the Raspberry Pi desktop like me. VNC…
Technology is something that has come forward in leaps and bounds over recent years, and it is something which Progressive Automations, in particular has taken advantage of. Technological advancements have meant that various computer systems which can be used in the teaching of computer sciences have progressed sharply; if they had not, of course, students would leave their classes unable to handle the more up-to-date versions of computer programs which had come out during the time they had been learning. One such system developed to help in teaching is Raspberry Pi, a system that brings raspberry pi and actuators together to allow students to become proficient in handling linear actuators and the motion systems they are often attached to.
There is a Raspberry Pi 3 out there which is much faster than version 1 and 2. While latest two are faster than first model, I thought it would be great to give some purpose to first Raspberry Pi model B. We share several computers around the house and sometimes need simple file storage solution to make backups, share and store. Rasperry Pi model B is sufficient for simple Network Attached Storage (NAS) solution. Such network automation setup doesn’t need much processing power to manage drive. And there is also an option to have torrent client running 24/7. Other benefits of using Raspberry Pi is low power. Lets go through all steps on how to set up Network Attached Storage on this Raspberry Pi. You can go with several different solutions on setting up NAS. You could go with cloud solution like Owncloud which is similar to Dropbox. This might be convenient in many ways, but I would like to have ability to use drive as portable media when needed. In that case I am going to stick with SAMBA server.
Previously we have configured basic NAS storage on Raspberry Pi. Having such power and doing nothing with storage is a waste. To prove its usefulness Next logical step is to implement a torrent client on this machine. The benefit is obvious. You have a NAS server that is always available and a torrent client that downloads/seeds files without the need power-hungry PC. You can find many torrent clients that can be used in Raspberry Pi, but it seems that lots of people prefer Deluge, which has plenty of features and requires small memory to run. Deluge is great in its flexibility – the ability to run on desktop, through the web interface, and through ThinClient. The other popular packet is Transmission, which is also lightweight and has great WebUI. Transmission can handle magnet links from the web interface. And it seems it is easier to configure. So we are going to stick with Transmission.
When the first Raspberry Pi board was introduced it literally changed the understanding of small computers by bringing Linux closer to us. With great support, low board prices and the huge community it stayed on top next to Arduino for four years. Of course, in to keep that success, updates in hardware and software are mandatory. We know how fast things change computer industry, so time to time Raspberry Pi foundation kept upgrading Pi boards From first, to second and now the newest third generation – Raspberry Pi 3. At first glance, you may see that Raspberry Pi 3 board is practically identical to version 2. component layout is the same including all peripherals. So all enclosures that worked with Pi2 should fit fine for Pi3 boards. But not the most obvious things that make it stand out.
I was playing with Raspberry Pi Model B for quite a long time. Tweaked few settings, wrote couple helper scripts. After some time second Raspberry Pi 2 arrived. I realized that most settings and scripts that were working on previous should do fine on a new one. I needed to copy few files from one Raspberry to another. For this purpose I decided to use Secure Copy (SCP). This is a file sending command over SSH. Raspbian OS already come with SCP installed so you can use it right away. (it it is missing you can install it by running command sudo apt-get install scp).
Setting WiFi on Raspberry Pi is easier then described earlier. The raspberry Pi has went through upgrades and generations, so most of the settings has been simplified. If you set up WiFi using GUI, then it same as on any windows – you select SSID and enter a password. I feel that Raspberry pi should be mostly accessed through console, since it is designed to be an embedded computer. This is why it is important to have ability to do all things in command line. No matter which raspberry pi you have, you can set wireless network the same way. Firs of all, if you use Raspberry Pi 1 or 2 you will need a USB wireless adapter. The later boards already come with build in WiFi and Bluetooth connectivity. To set up WiFi, you need to edit wpa-supplicant configuration file, which can be accessed by entering: To the bottom of file add your network settings as follows: Save settings by pressing CTRL+X and Y to confirm. You may need to reboot your board for network to connect. Raspberry Pi Model B comes with Ethernet interface built in where you can plug cable and have internet access. In many cases…
Last time we did a few basic operations with SQLite in Raspberry Pi. We learned how to set up SQLite3, create the first database file and fill with data. Using SQL commands, we were able to select data and print in the terminal screen. But eventually, you will face more complex queries or will need to store data automatically so other routines could read it. For instance, you will build a simple project that would read data from the digital temperature sensor. One of the great ways of storing data into a database is to use a python script. Anyway, you are probably going to use it for GPIO operations. So let us learn how to store simple data to SQLite database using python.
If you are doing some data logging, sensor reading or other routine task with raspberry Pi, then you probably are thinking of using database. The list of database software choices is quite long, but in most cases you will end with single or few tables in database. First thought might be MySQL – well known database server in WWW. Anyway this is pretty heavy tool to have running on Raspberry Pi. In my opinion SQLite is probably most suitable choice. Because it is serverless, lightweight, opensource and support most SQL code. Another handy thing is that SQLite stores data in single file which can be stored anywhere.
Raspberry PI by default has only one memory available – SD card which also holds kernel itself. Unless you are using large SD, eventually you are going to run out of space -especially if you are dealing with media files or playing with camera module. The easiest and cheapest way of expanding memory is to us USB Flash drive. If you are accessing PI from terminal screen, then probably one of built in USB ports are free and you can attach drive directly to it, otherwise use USB HUB – better with external power option.