Installing Firebird and node-firebird on the Raspberry Pi

We based this page on authoritative pages on Firebird on the Raspberry Pi and Node.js with Firebird.

The following steps describe how to install and test Firebird then node-firebird on the Raspberry Pi. You need to install Node.js before node-firebird. You should find this installation easier if you have worked through our Smart Pascal section on networking. The section covers the use of socket.io (that we also employ here for real-time updating of clients).

Type or copy the commands below at the prompt and accept any invitations to continue. When invited, set the sysdba password, to which we will refer as NEWPASS.

We have tried to include all the many necessary steps for the Debian OS on a Pi. Please inform us about anything that would make it easier for a student to succeed in this challenging but rewarding project.

  1. sudo apt-get install firebird2.5-super
  2. sudo dpkg-reconfigure firebird2.5-super
    This command starts the Firebird server. We test using the database CONTRIBUTIONS.FDB which is in db_contributions.zip and can be created following our instructions for Windows on a PC.
  3. Copy CONTRIBUTIONS.FDB to the home folder and change directory if necessary to this folder.
    If you would prefer to create a database on the Raspberry Pi, follow the instructions in the main Pascal database tutorial.
  4. sudo chown firebird.firebird CONTRIBUTIONS.FDB
    This gives the database the required ownership.
  5. sudo mv CONTRIBUTIONS.FDB /var/lib/firebird/2.5/data
    This moves the database to its expected location.
  6. gsec -user sysdba -pass NEWPASS -add student -pw pp4s
    This creates the user with name student and password pp4s.
  7. isql-fb
    This is the equivalent of isql in windows to obtain the Firebird prompt.
  8. connect /var/lib/firebird/2.5/data/CONTRIBUTIONS.FDB user 'student' password 'pp4s';
  9. SELECT * from Programmer
  10. EXIT;
  11. Change directory to where you will be putting your JavaScript server. It should contain the folder node-modules and contents.
  12. npm install node-firebird
  13. To test, copy the JavaScript server code on the following page into a text file named FirebirdServer.js and save it to your chosen location (which must contain the node-modules folder and contents). Run it with the instruction node FirebirdServer.
    You should see confirmation that the server is running.
  14. To test thoroughly the server and set-up, work through the demo on the following page.
Programming - a skill for life!

How to use datasets and databases in Smart Pascal applications