LowPowerLab Forum

Software support => Pi Gateway => Topic started by: syrinxtech on December 29, 2015, 10:29:13 PM

Title: Missing parameter in Pi gateway manual installation? [fixed]
Post by: syrinxtech on December 29, 2015, 10:29:13 PM
I am going through a new installation of v7 using the manual approach.  I was at the step where you create a self-signed SSL certificate.  The instruction is given as:

sudo mkdir /home/pi/gateway/data/secure

This fails because there is no "/home/pi/gateway/data" directory.  At this point in the installation the only directory in "/home/pi/gateway" is "www".  I got it to work by adding the "-p" option to mkdir which creates any necessary parent directories, ie:

sudo mkdir -p /home/pi/gateway/data/secure
Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: syrinxtech on December 29, 2015, 10:47:53 PM
Quote from: syrinxtech on December 29, 2015, 10:29:13 PM
I am going through a new installation of v7 using the manual approach.  I was at the step where you create a self-signed SSL certificate.  The instruction is given as:

sudo mkdir /home/pi/gateway/data/secure

This fails because there is no "/home/pi/gateway/data" directory.  At this point in the installation the only directory in "/home/pi/gateway" is "www".  I got it to work by adding the "-p" option to mkdir which creates any necessary parent directories, ie:

sudo mkdir -p /home/pi/gateway/data/secure

I found one more slight issue when getting ready to install socket.io:

The line of code in the instructions reads:

sudo mkdir /home/pi/gateway

But this also fails because the "/home/pi/gateway" directory was created earlier during the creation of the directories for the nginx installation.  You can just skip this one step.
Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: Felix on December 29, 2015, 11:04:14 PM
Thanks for the heads up, it's fixed now, please proof read for me :)
Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: syrinxtech on December 29, 2015, 11:08:21 PM
Looks good Felix....now that's what I call quick service!
Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: Felix on December 29, 2015, 11:10:03 PM
Thanks!   ;)
Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: syrinxtech on December 30, 2015, 12:00:19 AM
Just found another issue when configuring the "Gateway App":

When creating the "gateway.conf" file, there are references to the following files:

/home/pi/moteino/gateway.js
/home/pi/moteino/gateway.sys.log

If I'm not mistaken the "/home/pi/moteino" directory was moved to "/home/pi/gateway"?

So, these files should look like:

/home/pi/gateway/gateway.js
/home/pi/gateway/gateway.sys.log

Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: syrinxtech on December 30, 2015, 12:14:56 AM
Now that the gateway.conf file is correct and the script will start, as soon as it does I get the following error messages in the "gateway.sys.log" file:


/home/pi/gateway/node_modules/nedb/lib/datastore.js:69
    if (err) { throw err; }
                     ^
Error: ENOENT, open '/home/pi/gateway/data/db/gateway.db'
[2015-12-30T05:11:46.076Z] (sys) Starting

/home/pi/gateway/node_modules/nedb/lib/datastore.js:69
    if (err) { throw err; }
                     ^
Error: ENOENT, open '/home/pi/gateway/data/db/gateway.db'

I looked in the "home/pi/gateway/data" directory and there is no "db" directory and obviously no gateway.db file.  Should this directory and file have been created during the install process or does it happen at some other time?  Is this something that changed since the v7 upgrade?


Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: syrinxtech on December 30, 2015, 06:13:31 AM
Well, at long last I have a working v7!!

I fixed the ENOSPC issue by doing the following, not  necessarily in this order:

1.  chgrp and chown to pi on /home/pi/gateway/data directory
2.  created db directory in /home/pi/gateway/data and then chgrp and chown to pi
3.  ran touch to create gateway.db file in /home/pi/gateway/data/db directory, followed by chgrp and chown to pi
4.  stopped and restarted gateway and web browser.....and it worked.


Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: Felix on December 30, 2015, 09:09:14 AM
I added the missing mkdir /home/pi/gateway/data/db -p
You shouldn't have to do all that chowning.
Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: Felix on December 30, 2015, 09:11:35 AM
Good catch, fixed.
Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: syrinxtech on December 30, 2015, 09:20:26 AM
Thanks.

I wasn't sure but at the early hour I was working on it I figured what the heck.

If it will cause problems I'll change it back to root.
Title: Re: Missing parameter in Pi gateway manual installation? [fixed]
Post by: syrinxtech on December 30, 2015, 09:22:12 AM
Thanks, glad to help.