Skip to content

Provide setup and configuration details #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RondeSC
Copy link

@RondeSC RondeSC commented Aug 11, 2018

Please review 'netpi_setup.txt' and provide feedback.
There was insufficient setup and configuration information for me to readily get this code set working;
at lease so on the Raspbian Stretch OS image on a RPi-2.
I suspect, that the original project creator (as well as sgsax and chrisli-m) naturally made modifications to their systems without directly associating them to any one project; yet the project is dependant on them.
This is understandable. What was in sgsax's Wiki was of help. Thank you for that.
I don't expect you to directly except this pull-request.
Not having a better understanding of the under lying operational design;
some of the steps in 'netpi_setup.txt' may overly complicate things or be less than optimum.
I have further changes on my implementation, in the areas of DISPLAY access, logging (as reflected in my setup) and diagnostics.
I'll wait on those till setup and configuration are more certain.
I think the likes of what's in 'netpi_setup.txt' should be integrated into the project Wiki.
I would like 'BlameTheNetwork' and 'sgsax' to review this as well, but don't know how to arrange that.

File contains the cli setup commands apparently needed for successful operation with current Raspbian image.
@chrisli-m
Copy link
Owner

Hi Ron,

thanks. Your installation documentation log looks as professsional my server installation documentation looks like. Let me have a more brief look untill the end of the week. Does anything work with that setup?

In the original code are some more bugs i haven't uploaded to Git anymore. The next problem could be, that the PHP Code was made for PHP 5 and the Shell Commands for Squeeze and Wheezy Kernel. eg. ifconfig won't work anymore with new OS. That has to be checked and if necessary ported if you want to use it with current OS.

Christian

@RondeSC
Copy link
Author

RondeSC commented Aug 14, 2018

Hi Christian,
I am running php7.0 on the latest Raspbian-stretch with a monitor & keyboard (not LCD touch screen).
I have all of it apparently 'working'. I am not familiar with all the apps launched so I can not, at this point, competently fully test their functionality. I did see that the php code expected the ifconfig output to be other than it is so I changed the php, and all of my net_details outputs look fine.
One area that definitely still has issues is piping and flushing of ongoing outputs from php to the client.
I have modified more than a dozen files (html, php & sh) to get where I am now.
I am working on recognized issues and trying to come up to speed on scope of expected functional results (as I am not a networking expert).
I am thinking to post to GitHub only when I am more sure all my changes are just what's needed and wanted (and I have removed debugging and experiential code). Or sooner so we can collaborate to do so. What say you ?
Ron

@chrisli-m
Copy link
Owner

chrisli-m commented Aug 23, 2018

Hi Ron,
I had a look at your config. I also installed dia and xpdf for showing network graphs but i think with the standard NetPi not necessary.
In lighthttp I enabled vhost:
sudo lighty-enable-mod simple-vhost
My netpi folder is on / and vhost entry points to /NetPi/www

sudo nano /etc/lighttpd/conf-enabled/10-simple-vhost.conf

#simple-vhost.default-host = "www.example.com"

#NetPi
$SERVER["socket"] == "127.0.0.2:80" {
server.document-root = "/NetPi/www/"
server.errorlog = "/NetPi/www/log/error.log"
}

sudo nano /etc/lighttpd/lighttpd.conf
server.bind = "127.0.0.1"

Changed all paths in NetPi files to NetPi/... All logs I moved to NetPi/www/log. Making no sense in /var/log/netpi and /opt/netpi because some shell scripts creates special logs like cdp and they are read by php file for browser output.

Some wrong code are in PHP files like fclose, because the original author just copied examples without changing them with correct typo for attributes he used. So turn on warning and notification output in php for debugging.

Many shell scripts in netpi needs root access. For not changing too much in scripts and creating users with correct privileges I added pi to sudo and made it easy to handle the NetPi Testing device with autologin. I added pi to autologin group and changed lightdm config.
sudo groupadd -r autologin
sudo gpasswd -a pi autologin
sudo nano /etc/lightdm/lightdm.conf #autologin for root
autologin-user=pi

You should also have in mind that with Debian9 naming of ethernet interfaces changed. Cause of that it would be a good idea making scripts and NetPi interface independant. I would suggest a dropdownlist with ethernet interfaces, created from ip -a output before entering the main window.

For the project, testing 1200 network outlets with linkstate, vlan, ip, ... I wanted to use NetPi one and a half year ago but I ended up with my own shell script on a Pi3 with touchscreen. For that special purpose NetPi wasn't so useable, but I think it's still a cool project and if you want to port it to Debian9 PHP7 I think that would be great.

If you have further questions don't hesitate.

Christian

@RondeSC
Copy link
Author

RondeSC commented Aug 24, 2018

Thank you very much Christian; for your valuable feedback.
With all its details and expected related changes in the NetPi app behavior,
and the fact that I have, for now, what appears to be a functioning set of NetPi files
in my dev_branch: https://github.com/RondeSC/NetPi/tree/dev_branch
it is likely to take me quit some time to get to checking out, understanding ramifications and react to all of these details.
Thank you again for helpful contributions.
Ron

Improve the NetPi system setup and configuration
@RondeSC
Copy link
Author

RondeSC commented Aug 31, 2018

Thanks to your feedback, I have reworked the setup and configuration, reflected in 'netup_stup.txt'

  • I found the use of vhost nice and advantageous.
  • I decided on the NetPi web file to be in /opt/NetPi and the logs in /var/log/netpi
    This, to me, seemed appropriate considering my understanding of intended use of /opt and /var/log
    further this follows the example/leads of others like lighttpd and pigpio.
  • I did not manage to resolve needs of root access via your autologin setup steps. (?maybe I missed something?)
    so I instead managed with some chmod 4775 of some executables along with some code changes.
    I have fixed all the errant code and issues I could find with using PHP7 and The latest Raspbian (based on Debian9)
    This 'netup_stup.txt' is independent with the code in my dev_branch.
    I would love it if you would download https://github.com/RondeSC/NetPi/archive/dev_branch.zip and verify its operation.
    Ron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants