Kitz Forum

Broadband Related => Router Monitoring Software => Topic started by: hacktrix2006 on November 01, 2019, 12:41:11 AM

Title: DSLSTATS with XRDP/SSH/SCP/FTP For Raspberry Pi 32Bit and 64Bit Raspbian OS
Post by: hacktrix2006 on November 01, 2019, 12:41:11 AM
#### Raspberry Pi With DSLStats For all Raspberry Pi's ####

## About the Images ##

Two images with a pre-installed Raspbian OS either 32Bit or 64Bit with DSLSTATS already setup and a working XRDP install that resuses the previous session.
It also has SSH/SCP/FTP services secured and the User Pi is renamed to dslstats.
The images also has UFW and GUFW (Firewall in console and GUI modes)

These images are in two files for 32Bit which will work on any Raspberry Pi or a 64bit Version that will only work on the Raspberry Pi 3 and the Raspberry Pi 4


## Required ##

An SSH Client (Putty  https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html )
An FTP Client (WinSCP or FileZilla or any other FTP Client)
Disk Imager to burn the image to sdcard (Win32DiskImager: http://sourceforge.net/projects/win32diskimager/files/latest/download or Etcher Portable: https://github.com/balena-io/etcher/releases/download/v1.5.63/balenaEtcher-Portable-1.5.63.exe)
A Raspberry Pi.
SDCard that is blank with 16gb or larger.
Access to your router to access the DHCP list to find the Pi's IP or you can use dslstats.local as the IP.

## User Details ##

Default user: dslstats
Default user password: dslstats
Status: Enabled
Works On: GUI SSH SCP and FTP

Root user: root
Root Password: dslstats
Status: Enabled
Works On: GUI Only



#################################
## Zip file password: dslstats ##
#################################

64Bit Version (Raspberry Pi 3/4) [ 3GB in Size ] : https://mega.nz/#!uMUE2CKD!jYgDEdWa2HCK5kZi3JgO49EqZBh7PYOh8MdaAxXm3M8
32Bit Version (Every Raspberry Pi)[ 1.5GB in Size ] : https://mega.nz/#!ectHQIyL!CVBOZ7olLKmaL7caCvGRq42L0x85jwKajOU4bF-IDR8

Instructions for Offline use: https://mega.nz/#!WRES3Y4a!VpbXVRUzcu8AVQPgd_73iSaeHEn9cTCTSYb6yJ5wrAE


## Instructions ##

1) Download the either of image above.

2) Extract the .zip file and enter the password when instructed.

3) Using a USB Imaging tool (Can be balenaEtcher or Win32DiskImager) burn the image to your SDCard, suggest 16GB or larger.

4) Place the SDCard you have just made into the Raspberry Pi and power up the Raspberry Pi, The partition should auto expand and reboot so give it 2 to 5 minutes to settle before doing next step.

5) Now using Microsoft Windows or Linux RDP into the Raspberry Pi with the following ip dslstats.local then use the dslstats details above.

6) Open up the file on the desktop called Important Read Me! and follow the instructions

7) Once you have completed following the Important Read Me! instructions reboot the Raspberry Pi again.

8) Upon booting the Raspberry Pi log in to RDP again with dslstats.local and your new user details details.

9) If you haven't already done so head to /home/dslstats/monitor/webserver, in there is a READ ME file follow that readme to edit the header
of each file and also add your Shared Live HTML link from Thinkbroadband into the Line.htm(l) file.

10) With this done you can now double click DSLSTATS on the Desktop or in the menu and enter your Modem login details, then click the play icon.

11) There you go, you've completed everything and it should be hosting a webpage on <YOUR PI's IP>:55555/index.html

** If you change the port used for DSLStat's web server please use the UFW GUI and remove the old port and then add the new port or you can add the new port simply in terminal issuing
the following command sudo ufw allow <portnumber> .

** UFW is set to disabled by default, whilst in the desktop open the menu select Preferences then Shield Icon (Firewall) it will ask for a password, once the application is opened
simply flip the toggle so it is enabled.


## Thanks ##

I would like to thank everyone from the Kitz forum for helping me with all my issues you know who you are and Kitz as well.
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: burakkucat on November 01, 2019, 12:56:16 AM
Thank you for creating this package. I am sure that it will be useful.  :)

I have now split off the last three posts from roseway's "DSLstats v6.5 released (https://forum.kitz.co.uk/index.php/topic,21323.0.html)" thread to create a new topic titled "The Prelude to hacktrix2006's Magic (https://forum.kitz.co.uk/index.php/topic,24013.msg404566.html)".
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: hacktrix2006 on November 01, 2019, 12:58:12 AM
No thank you for allowing this.
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: roseway on November 01, 2019, 06:24:34 AM
That's an excellent piece of work. Thank you.
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: hacktrix2006 on November 01, 2019, 10:24:44 AM
Just to let everyone know i made a BooBoo a big one i forgot to change one line of code in the CMDLINE.txt file which makes the current image not boot i have placed in the OP the line of code it should of had, i knew using PARTUUID would bite me in the backside.

I will edit the image and reupload the whole package again ASAP with the corrected image, till then please apply the fix in the OP under # Known Issues and Fixes #

Sorry folks.
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: biohead on November 01, 2019, 10:54:10 AM
Thank you for sharing this! I'm just downloading it now, and will try to remember to do the fix before booting!

Is there any specific reason you opted for a 64-bit OS?
I originally was going to use a Pi2, but I was also contemplating a Pi Zero via wifi, I just wondered if there was a specific reason behind it.
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: hacktrix2006 on November 01, 2019, 11:04:50 AM
Yes there was a reason why i decided to use a 64bit Kernel, the 64bit userspace container was a bonus.

I found that whilst using a 32Bit Kernel the performance of the Raspi 3B+ was very very slow on the graphical end as well as executing applications this was due to CPU Latency where it was in the 1000's ms after going to a 64bit kernel the performance of the Raspi 3B+ was shocking smoother to where its in the 200ms or lower for latency which meant the running of applications was faster.

I can make make a version for the Raspi 1/2 series however it will mean i will need access to that hardware i would be fine on the Raspi 1B as i own that but i don't own anything else other then the 1B and 3B+ .

Once i am happy with the OS image and everything is fixed i am planning on making a scripts that will do everything for you, however i am struggling on getting the securing of users part working correctly i have the packages and xrdp install and setup in one script already and will be happy to release that file, but i was holding out to get the securing of users script sorted first.

So if you want to use a Raspi 2 or Zero then i can PM you the script for XRDP i made.

The Ultimate goal in the end is to make an Image for 32Bit and 64Bit with everything the same way setup it would be even better if i was able to scrap the whole GUI part all together, but i am making the best of what we have.

Edit: I have quickly made a script that should in practice work will dig out my raspi 1B and test it

[Moderator edited to correct a typo.]
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: ktz392837 on November 01, 2019, 02:23:50 PM
Does XRDP allow you to connect to an existing session with DslStats already loaded? 

In previous attempts whenever I have tried it, it created a new "desktop" so my previously loaded DslStats was not running even though it was running under a different session. 

It even did this with the default VNC until I installed and run x11vnc so having a correct way of doing this would be great so making a script available to the community would be great?

Thanks
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: hacktrix2006 on November 01, 2019, 02:29:19 PM
XRDP script in the image is set to continue the current session yes.

As for the script i am working on that currently found a few issues to which i am trying to iron out.

However right now i am trying to correct a big mistake of running Win32Imager on the wrong drive which had very very very important data. (Yes backup bible was ignored but that was due to type of information and security of it).

[Moderator edited to fix a typo.]
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: hacktrix2006 on November 02, 2019, 01:25:47 AM
Ok so an update to the scripts status, I have just done a clean install on my old Raspi 1B to which worked very well, it's in two parts a file called secure which changes the root password, followed by changing the user pi's password it then continues to create the dslstats user followed once again to ask for the creation of the password for dslstats.

It then runs as the dslstats user a command to download and set the new script as executable.

It's then continues to log in as the dslstats user, ready for the end user to run the next script which will setup the whole XRDP / Proftpd / Firewall and ultimately dslstats whilst also placing a nice Desktop icon when you rdp in.

It will also during setup lock the pi user before deleting it completely.

I still need to make it fancy and also see if I can cut down the password requests, however the script in its current concept works.

So if there is anyone out there that is a bash pro that might be able to help with jazzing the scripts up about, I'd be happy to help.

**In before [Moderator edited to fix typo.]**

Also thanks mods for doing that.

Sent from my SNE-LX1 using Tapatalk

Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: hacktrix2006 on November 02, 2019, 06:10:44 PM
I have completed the scripts now and require some testers, this is for users that already have a installed Raspbian OS or require a 32bit install.
Please PM me so i can pass you the link to the test script.
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: hacktrix2006 on November 05, 2019, 01:52:10 AM
I have decided over this weekend that i will be remaking the image(s).

This will mean there will not only be a Raspberry Pi 3B+/4 in a 64bit os but also a Raspberry Pi 1/2/Zero version in a 32bit OS format, reason for this is althought the script has been tested by a few users and as a POC (Proof Of Concept) works it takes to much time for it to compile XRDP etc, it is also not very new user friendly.

So i have decided to basically take the time to set each image up then PiShrink them (So the downloads are as small as possible) for each OS image.
This will make it more user friendly to the new users to boot without having to go through a long instruction set on how to basically setup a Raspberry Pi as a headless system where you have to mess about with creating blank files for SSH to be enabled on boot etc.

Yes this means it does make more work my end but it more work to make it easier for the community. I will be building the images on a Raspberry Pi 3B+ however the 32bit OS version will be tested on my Raspberry Pi 1B and will be tuned to better the performance which might include changing the OS's Desktop GUI to something lighter.


Update: I am now in the process of imaging the new OS images which was made via the script (POC), after this i will be doing some log emptying and PiShrinking.

I should be uploading the files after sometime on friday evening/saturday early morning and will make adjustments to the OP with the new instructions.
Title: Re: Raspberry Pi 3B+ Raspian 64bit OS with XRDP and DSLStats
Post by: hacktrix2006 on November 07, 2019, 05:52:41 PM
Having some issues with the images, so going to remake them again with the differnce of this time the 64bit OS will just have a 64bit kernel and a 32bit userland, also i will be simply renaming the user pi to dslstats as some of the issue i am facing now is related to the removal of the pi username.

It might take me a bit longer to get right but once its right both 32bit and 64bit OS's will be the same other then the kernel.

So as i have gone this far like might as well do a proper job of it.


Major Update: Ok so there is an update that is a very good update to the images, Both the 32bit and 64bit OS images has been made, they have also been tested as well.
The test results are a good Pass i am now zipping the files up and will then upload them. Following them being uploaded i will then update the OP.
Title: Re: DSLSTATS with XRDP/SSH/SCP/FTP For Raspberry Pi 32Bit and 64Bit Raspbian OS
Post by: hacktrix2006 on November 08, 2019, 06:14:42 PM
New images are now in the OP. Enjoy.
Title: Re: DSLSTATS with XRDP/SSH/SCP/FTP For Raspberry Pi 32Bit and 64Bit Raspbian OS
Post by: roseway on November 08, 2019, 06:22:13 PM
You're doing a fine job, thank you.
Title: Re: DSLSTATS with XRDP/SSH/SCP/FTP For Raspberry Pi 32Bit and 64Bit Raspbian OS
Post by: hacktrix2006 on November 08, 2019, 10:29:51 PM
You're doing a fine job, thank you.
No problem, I am simply giving back to the community after getting help by the community. Also made the images more New user friendly. So hopefully everyone enjoys the work. Now time to start work on my Linksys WRT32X firmware.

Sent from my SNE-LX1 using Tapatalk

Title: Re: DSLSTATS with XRDP/SSH/SCP/FTP For Raspberry Pi 32Bit and 64Bit Raspbian OS
Post by: hacktrix2006 on November 13, 2019, 12:15:26 PM
@kitz I take it history.php just needs the PHP7.3 installed and it will work? as that was the only thing not added to them images as i never had used that before. If i can find out how to get that running nicely then i will add them to the newer images when i have time to make them and upload them.
Title: Re: DSLSTATS with XRDP/SSH/SCP/FTP For Raspberry Pi 32Bit and 64Bit Raspbian OS
Post by: daveesh1 on November 13, 2019, 06:47:24 PM
You have done a sterling job so far with the images 10 mins and everything is running. Thankyou
Title: Re: DSLSTATS with XRDP/SSH/SCP/FTP For Raspberry Pi 32Bit and 64Bit Raspbian OS
Post by: RTouris on November 15, 2019, 12:25:02 PM
So in testing this aarch64 image and comparing it to the latest armv7l buster available on a RPi4/4GB I bumped into something that got me thinking and has to do with the display manager...Could someone shed some light as to why when DSLstats fetches the modem's data process /usr/lib/xorg/Xorg :0 -seat -seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch also spikes up to the full duration of the fetch command? In actual fact it does so disproportionally to the actual DSLstats app in that it consumes far more CPU cycles than the app...Having both UIs actually hidden / minimised It appears as if Xorg hogging the CPU is somewhat irrelevant or is it something I'm missing?
Title: Re: DSLSTATS with XRDP/SSH/SCP/FTP For Raspberry Pi 32Bit and 64Bit Raspbian OS
Post by: hacktrix2006 on November 15, 2019, 02:04:21 PM
It might be because the aarch64 image was basically the same as the 32bit image just with a 64bit kernel added after. Which means xorg is more then likely still a 32bit package.

Both images was updated to the latest versions and the original Is was the latest from the raspi downloads page.

The 64bit kernel version uses the same amount of CPU usage as the 32bit version when dslstats is running and mine on both images hit 26% usage on Raspi 3B+. It also could be how XRDP was compiled as well to insure it works with Microsoft's RDP
Title: Re: DSLSTATS with XRDP/SSH/SCP/FTP For Raspberry Pi 32Bit and 64Bit Raspbian OS
Post by: RTouris on November 20, 2019, 06:29:46 PM
It might be because the aarch64 image was basically the same as the 32bit image just with a 64bit kernel added after. Which means xorg is more then likely still a 32bit package.

Both images was updated to the latest versions and the original Is was the latest from the raspi downloads page.

The 64bit kernel version uses the same amount of CPU usage as the 32bit version when dslstats is running and mine on both images hit 26% usage on Raspi 3B+. It also could be how XRDP was compiled as well to insure it works with Microsoft's RDP

Seeing the same behaviour on both the 32-bit and 64-bit Raspbian platforms is somewhat expected...what's not expected -and in effect what I can't explain- is why the Xorg display manager consumes so much more cycles than the actual app...

Surely having DSLstats fetch data every 60'' or so "only" appears to push one core to at about 35-40% for a few seconds, however according to htop that's also accompanied by Xorg pushing another core to apprx. 65-80%, which surely doesn't appear normal at all (?)...In a DSLstats test installation I'm currently running on a new RPi4 for testing purposes over the course of the last 2 days I'm seeing 5h CPU time for DSLstats in htop and 11h for Xorg...(?)

I'd be inclined to install a 64-bit Ubuntu distro that came out recently for the Rapsi and testing it out if only I had the time to do so...