Kitz Forum

Broadband Related => Router Monitoring Software => Topic started by: V_R on December 08, 2017, 12:11:45 PM

Title: Best way to get DSL Stats running 24/7?
Post by: V_R on December 08, 2017, 12:11:45 PM
Currently have DSL Stats running on my PC which is on a lot but not 24/7, I'd like to get it setup in a way so its running and monitoring the line all the time.

I'm assuming the best way is via a Raspberry Pi? If so can any one give me a quick run down of what I need and how to do it? Is there a guide out there somewhere?

I've never use one before so I'd appreciate any advice on what I'd need and the process to get it up and running?

Thanks.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: skyeci on December 08, 2017, 12:35:52 PM
I would suggest a pi3. I just use the standard install and leave it headless. vnc is included so I access via that if I need to once I had set it up..

I do run mine with a usb rj45 adapter alongside the internal lan as my modem sits in a different network to my router. static internal  ip's  on both.
straight forward and pretty painless tbh. If you have any specific questions then do ask away.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Dray on December 08, 2017, 12:38:24 PM
I asked for a step by step guide once. Didn't get one :(
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on December 08, 2017, 01:11:03 PM
https://thepihut.com/collections/raspberry-pi-kits-and-bundles/products/raspberry-pi-3-starter-kit

I was looking at that, would that work?

Can it just be plugged into my router or switch to be able to monitor and upload to MDSLWS or is there more to it?

I'm happy to run it headless as long as I can login to it one way or another.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: j0hn on December 08, 2017, 01:32:49 PM
That would work perfect. It takes a bit of configuration, but a raspberry pi is probably the best way to run 24/7 DslStats/MDWS with very low power requirements. It can even be powered from your routers USB port.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Dray on December 08, 2017, 01:33:56 PM
That looks like all the hardware you need to be able to run dslstats. You will need to assemble it and then you will have the base system which will be running the NOOBS operating system. Note you will need an HDMI compatible TV/monitor to do this.

You will then need to download dslstats and configure it to run appropriately as you require.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on December 08, 2017, 01:38:31 PM
That would work perfect. It takes a bit of configuration, but a raspberry pi is probably the best way to run 24/7 DslStats/MDWS with very low power requirements. It can even be powered from your routers USB port.

Ah yes, I was going to ask what the power drain would be, Didn't know you could power it via USB - even better. :)


That looks like all the hardware you need to be able to run dslstats. You will need to assemble it and then you will have the base system which will be running the NOOBS operating system. Note you will need an HDMI compatible TV/monitor to do this.

You will then need to download dslstats and configure it to run appropriately as you require.

My monitor has several HDMI, I already have a secondary cable to my XB1 so no bother there, But if I can connect to it remotely that would be even better.  What would be the best way to achieve this?
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Dray on December 08, 2017, 01:52:05 PM
Ah yes, I was going to ask what the power drain would be, Didn't know you could power it via USB - even better. :)
the official power supply in that starter kit is 2.4 amps from USB

Quote
My monitor has several HDMI, I already have a secondary cable to my XB1 so no bother there, But if I can connect to it remotely that would be even better.  What would be the best way to achieve this?
Yes I was just saying you need the monitor to set it up and can run it headless after that.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 08, 2017, 02:34:46 PM
@ V_R

Perhaps a cheaper RPi option which I have used on my son & daughters lines should you decide to go that way.

http://forum.kitz.co.uk/index.php/topic,20343.msg356892.html#msg356892

Note, see later in the thread, someone suggested powering the RPi Zero W from the routers USB socket, I adopted this suggestion which worked perfectly and made a further saving on the provision of a PSU for the RPi's, only outlay now being the RPi Zero W, a basic plastic case and a micro SD memory card.

Both units working perfectly to date, see MDWS ID's "cruth211" and "smpay-37"

 
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on December 08, 2017, 02:42:23 PM
@ V_R

Perhaps a cheaper RPi option which I have used on my son & daughters lines should you decide to go that way.

http://forum.kitz.co.uk/index.php/topic,20343.msg356892.html#msg356892

Note, see later in the thread, someone suggested powering the RPi Zero W from the routers USB socket, I adopted this suggestion which worked perfectly and made a further saving on the provision of a PSU for the RPi's, only outlay now being the RPi Zero W, a basic plastic case and a micro SD memory card.

Both units working perfectly to date, see MDWS ID's "cruth211" and "smpay-37"

Ah interesting, One of my requirements is that I want it as minimal as possible. That looks even better than the Rpi3 kit. Nice one.  :thumbs:
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Dray on December 08, 2017, 02:50:07 PM
@tiffy can you confirm what hardware you need to set it up please - HDMI cable, other stuff? Can you also give a step-by-step guide to getting dslstats and mdws set up and running on the rpi please?
Title: Re: Best way to get DSL Stats running 24/7?
Post by: licquorice on December 08, 2017, 03:22:25 PM
I just have a headless RPi powered via the USB port of the router and an Ethernet connection to get the stats.

To set the Pi up, you will need an HDMI cable, a USB keyboard and USB mouse. I gave the Pi a static IP address outside of the DHCP range of the router for ease of access via remote desktop from my PC. Just download DSLstats, extract and configure as you would on a PC.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: licquorice on December 08, 2017, 03:46:32 PM
A useful tutorial for setting up remote access. http://www.raspberrypiblog.com/2012/10/how-to-setup-remote-desktop-from.html
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Dray on December 08, 2017, 05:24:03 PM
This seems a good start
Quote
Headless Raspberry Pi Setup

Don’t have an extra keyboard or HDMI cable? Here’s how to do a headless Raspbian install on your Pi.
https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 08, 2017, 08:49:13 PM
I just have a headless RPi powered via the USB port of the router and an Ethernet connection to get the stats.

To set the Pi up, you will need an HDMI cable, a USB keyboard and USB mouse. I gave the Pi a static IP address outside of the DHCP range of the router for ease of access via remote desktop from my PC. Just download DSLstats, extract and configure as you would on a PC.

Further to the links supplied later in the thread by licquorice:

The RPi Zero W does not have an ethernet port, if that is deemed necessary for the initial set up than a micro USB to ethernet adaptor is required, I did buy one which cost more than the RPi Zero itself, found that it was not really necessary, used the in built WiFi connection.

Again, if a direct monitor & keyboard connection is deemed necessary for the initial setup then a micro USB to standard USB adaptor will be required plus a USB hub (this will actually power the RPi itself for the setup) also a micro USB to HDMA adaptor for the VDU.
I found the most cost effective way to get the micro USB adaptors was to buy the "essentials kit" with the RPi Zero, here:
https://thepihut.com/collections/raspberry-pi-zero/products/raspberry-pi-zero-w?variant=30333236753

An even cheaper option for micro/normal USB conversion which was not available earlier, here:
https://thepihut.com/collections/raspberry-pi-zero/products/usb-to-microusb-otg-converter-shim

Seems like quite a lot of additional kit required for configuration I admit, I was luck enough to have most already available from early days playing with the original Mk 1 B RPi.

The best guide I found to get the RPi's running headless using VNC Client & Server was here:
https://learn.adafruit.com/adafruit-raspberry-pi-lesson-7-remote-control-with-vnc

Original inspiration and guidance for the project came from these threads:
http://forum.kitz.co.uk/index.php/topic,16441.0.html
http://forum.kitz.co.uk/index.php/topic,15882.0.html

The current working permutation for both of the RPi Zero W's is:
Only physical connection is power using a short micro/standard USB cable to respective router/modem.
WiFi connection to the router/modem.
WiFi connection to laptop PC when required for maintenance, program updates etc..
The only issue I have not managed to overcome to date is getting DSLStats to auto-start on RPi boot, there is quite a long thread on this in one of the attached links, not a big issue to me, I have the daughter/son educated in restarting DSLStats post a power outage be it accidental or otherwise.

As much as I would like to compile a complete step by step guide to all this as requested time does not currently permit, hope this brief guide helps in the mean time.



 
Title: Re: Best way to get DSL Stats running 24/7?
Post by: RichardB on December 12, 2017, 08:37:19 AM
The only issue I have not managed to overcome to date is getting DSLStats to auto-start on RPi boot, there is quite a long thread on this in one of the attached links, not a big issue to me, I have the daughter/son educated in restarting DSLStats post a power outage be it accidental or otherwise.


Hi

I auto re-start DSLstats on my PI Zero W using a bash script.

The script is named "DSL_start" and located in the home folder.

Script contents:
     #!/bin/bash
     #usually reboots due to power failure
     #or maintenance
      sleep 2m    #wait 2 minutes for DSL to reconnect
      /home/pi/dslstats32RPi-6.1/dslstats

The DSL_start script is called by the LXDE autostart script.

~/.config/lxsession/LXDE-pi/autostart

I added the following line to end of the file:
       @/home/pi/DSL_start

Finally, DSLstrats has to be configured to autostart recording when started.
 
Configuration Tab, Misc Tab, Program Start, Tick "Autostart recording on program start"
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 12, 2017, 10:17:24 AM
@RichardB

Many thanks for the information on auto-starting DSLStats, seems a nice simple solution, I will certainly give this a try & report outcome, I already have DSLStats configured to auto-start recording on boot.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 12, 2017, 03:12:38 PM
@RichardB

Have tried your auto-start solution on my RPi Mk 1B, running latest version of Raspbian, does not work for me for some reason, no errors displayed as such just won't start DSLStats on boot.
Thought I might have found the reason, the created file, "DSL_start" execute permission was by default set at "nobody", changed this to "anybody" but still no joy.
Executing the file "DSL_start" manually does not produce any results or errors either (assuming this is possible)

There is an old forum post on the RPi/DSLStats auto-start issue here (quite a long thread):

http://forum.kitz.co.uk/index.php/topic,15882.0.html

Although some members achived success, none of the solutions suggested in this thread worked for me, from memory I was getting the "already running" error, finally gave up.

As you can probably tell, I'am by no means a Linux expert !

 
Title: Re: Best way to get DSL Stats running 24/7?
Post by: vic0239 on December 12, 2017, 04:05:44 PM
I've had all these issues previously, but now that VNC is bundled with the OS it seems to work much better.

Both my Pi devices are running Raspbian GNU/Linux 8 (jessie).

I have the following in:

~/.config/autostart/dslstats.desktop

Code: [Select]
[Desktop Entry]
Version=1.0
Type=Application
Name=DSLstats
Exec=/home/pi/start.dslstats

and the script contains:

Code: [Select]
echo Sleeping for 30
sleep 30
echo "Doing autorun script..."
/home/pi/dslstats32RPi-6.1/dslstats &

RealVNC is now bundled so I use VNC viewer on the Mac to connect.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: RichardB on December 12, 2017, 06:20:26 PM

Thought I might have found the reason, the created file, "DSL_start" execute permission was by default set at "nobody", changed this to "anybody" but still no joy.
Executing the file "DSL_start" manually does not produce any results or errors either (assuming this is possible)
 

Hmm, I guess there could be a number of potential causes.


If you copy vlc0239's echo command     echo "Doing autorun script..."        and add it to the beginning of DSL_start script.
The 2 minute delay in my DSL_start is far too long for debugging, reduce it to a minimum of 20 seconds.
set line 4 to "sleep 20".
Any less and I found that the script would not start DSL_stats.
I assume the script was run before the PI could start DSLstats. Not sure why!
As you are running a PI MK1 you may need to extend this time.

I assume you executed DSL_start manually, from the command line in a Terminal window?
Did you prefix DSL_start with  "./"      I.E. type "./DSL_start"  ?

If not could you try and post the result here?

Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 12, 2017, 09:23:40 PM
Thanks to both for the further suggestions, will hopefully try these tomorrow when I have more time and report back.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 13, 2017, 06:24:00 PM
@RichardB

Following your suggestions, realised that I made some very basic mistakes in the script of "DSL_start" file such as incorrect DSLStats file path, have added the "vic0239" echo lines which certainly made debugged easier, the file now runs in a command window and starts DSLStats with sleep delay as required.

As per your suggestion, I have increased the sleep delay to 3 mins as my old Mk.1 B RPi does take quite a while to boot.

However, when doing a full cold boot nothing appears to happen after the 3 min delay, can detect CPU activity at that point indicating that something appears to be going on.
In fact the "DSL_start" script does appear to execute but DSLStats does not appear on the desktop, can tell this is the case as either attempting to re-run the "DSL_start" script manually or executing the DSLStats desktop icon produce the error "program already running, shutting down".

So, looks like everything associated with your auto-start method is functioning but I am back to my original issue of error "program already running".

Is there any way I could delay the execution of the "DSL_start" file while still preserving the auto start at boot function, could a sleep delay be incorporated in the "autostart" script ?
Title: Re: Best way to get DSL Stats running 24/7?
Post by: burakkucat on December 13, 2017, 06:46:24 PM
I'm sure there is a "cron" option that uses the "@reboot" specification, thus allowing one-off script execution.

Looking at the output of "man 5 crontab", I see the following under the "EXTENSIONS" heading --

Code: [Select]
EXTENSIONS
       When specifying day of week, both day 0 and day 7 will be considered Sunday.  BSD and ATT seem to disagree about this.

       Lists  and ranges are allowed to co-exist in the same field.  "1-3,7-9" would be rejected by ATT or BSD cron -- they want to see "1-3"
       or "7,8,9" ONLY.

       Ranges can include "steps", so "1-9/2" is the same as "1,3,5,7,9".

       Names of months or days of the week can be specified by name.

       Environment variables can be set in the crontab.  In BSD or ATT, the environment handed to child processes is basically the  one  from
       /etc/rc.

       Command  output is mailed to the crontab owner (BSD can’t do this), can be mailed to a person other than the crontab owner (SysV can’t
       do this), or the feature can be turned off and no mail will be sent at all (SysV can’t do this either).

       These special time specification "nicknames" are supported, which replace the 5 initial time and date fields, and are prefixed by  the
       ’@’ character:
       @reboot    :    Run once after reboot.
       @yearly    :    Run once a year, ie.  "0 0 1 1 *".
       @annually  :    Run once a year, ie.  "0 0 1 1 *".
       @monthly   :    Run once a month, ie. "0 0 1 * *".
       @weekly    :    Run once a week, ie.  "0 0 * * 0".
       @daily     :    Run once a day, ie.   "0 0 * * *".
       @hourly    :    Run once an hour, ie. "0 * * * *".
Title: Re: Best way to get DSL Stats running 24/7?
Post by: vic0239 on December 13, 2017, 09:33:38 PM
I am back to my original issue of error "program already running".
I had this issue too which was due to my VNC server using a different display number to the Pi desktop. Originally I was running tightvnc which couldn’t use display 0, so I changed to x11vnc which could. Apparently the initialisation of the VNC server causes a second iteration of the autostart items. What VNC server are you running?
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Dray on December 13, 2017, 09:44:07 PM
I have to say I run dslstats on a windows 7 virtual machine on my server.
It gets started by a scheduled task which runs every minute and restarts dslstats if it ends for any reason.
This would be my requirement for a RPi install but I don't think that's going to happen.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: licquorice on December 13, 2017, 10:32:14 PM
I had this issue too which was due to my VNC server using a different display number to the Pi desktop. Originally I was running tightvnc which couldn’t use display 0, so I changed to x11vnc which could. Apparently the initialisation of the VNC server causes a second iteration of the autostart items. What VNC server are you running?

xrdp works fine for me.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: RichardB on December 14, 2017, 08:01:52 AM
vlc0259 could be correct. I have seen the issue vlc0259 describes before on Linux systems. However, I have not seen it on my PI.
I had this issue too which was due to my VNC server using a different display number to the Pi desktop. Originally I was running tightvnc which couldn’t use display 0, so I changed to x11vnc which could. Apparently the initialization of the VNC server causes a second iteration of the autostart items. What VNC server are you running?
For info I am using Real VNC 6.1.1 Raspberry PI edition, as it was supplied with Raspbian.
https://www.realvnc.com/en/connect/docs/raspberry-pi.html

Tiffy, when the script has run you can check whether dslstats is running by opening a terminal and typing:

ps -A | grep dslstats

If dslstats is not running nothing will be displayed.

If dslstats is running something like
         1001 ?        05:16:39 dslstats
will be displayed.

Richard
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 14, 2017, 09:00:11 PM
Again, thanks to all for the further support, much appreciated:

Turns out I was actually running "TightVNC" server as per vic0239's experiences, have now installed the latest Real VNC Server revision, 6.1.1 on the RPi and also updated my VNC Viewer to the latest revision on my desktop, Win 8.1 64b PC.

Perhaps I should have stated earlier that I am running my RPi in GUI, desktop mode so I can directly observe the DSLStats GUI in the VNC window on my desktop PC, apologies if that is an obvious statement.
On my previous "TightVNC" setup, DSLStats appeared on the RPi desktop when started so very obvious that it was running, I have then made the incorrect assumption that if DSLStats does not appear on the RPi desktop it's not running.

So, current state:
With the latest VNC Server, DSLStats does now auto-start on RPi boot but runs in the background, ie. does not appear on the RPi GUI desktop, as per previous expectation.
I have applied the "running test" as suggested by RichardB which is positive and I can see that my stat's are being updated to MDWS.

Probably very obvious to the more Linux enlightened forum members, how do I now get DSLStats GUI to appear on the RPi desktop again ?
Title: Re: Best way to get DSL Stats running 24/7?
Post by: vic0239 on December 14, 2017, 09:40:38 PM
Is your VNC Viewer set to connect to display number 0? hostname :0  I’m not a Windows bod, so not sure how that would be specified on that platform. 
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 15, 2017, 12:14:02 AM
Is your VNC Viewer set to connect to display number 0? hostname :0  I’m not a Windows bod, so not sure how that would be specified on that platform.

Can't see any reference to "display number" or "hostname" on my VNC Viewer configuration.
Of course, I am actually connecting perfectly and displaying the RPi GUI desktop screen on my desktop PC where I can perform any task except display DSLStats GUI window even thought I know it's running in the background.

As previously reported, when using the TightVNC server and starting DSLStats manually, DSLStats GUI window just appears after program boot up on the RPi desktop as per normal expectation.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: RichardB on December 15, 2017, 10:00:44 AM
Hi Tiffy,

I have been "googling" this issue of VNC on an R Pi and display :0
Some results indicate that VNC port 5900 is required to view display :0

When connecting to My Pi's VNC server the viewer shows that I connect to port 5900.
I.E when the username & password box is present The VNC server address is displayed as 192.168.0.58::5900
I cannot see an option to change the port in RealVNC viewer config. 

Can you advise which VNC port you are connecting to?

I can find an option to change the port in the RealVNC server config.
If the VNC server ICON is present in the PI's desktop "taskbar", Right click, selection options, then connections.

Richard
Title: Re: Best way to get DSL Stats running 24/7?
Post by: vic0239 on December 15, 2017, 12:17:34 PM
Run this command in a terminal window on the Pi, it will show which ports are open with a listener. Port 5900 corresponds to VNC display 0, maybe there are others in that port range?
Code: [Select]
sudo netstat -lptn
Here's the output from my Pi.
Code: [Select]
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3551          0.0.0.0:*               LISTEN      529/apcupsd     
tcp        0      0 0.0.0.0:55555           0.0.0.0:*               LISTEN      21852/dslstats 
tcp        0      0 0.0.0.0:548             0.0.0.0:*               LISTEN      683/afpd       
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      627/vncserver-x11-c
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      521/sshd       
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      24878/cupsd     
tcp6       0      0 ::1:4700                :::*                    LISTEN      678/cnid_metad 
tcp6       0      0 :::5900                 :::*                    LISTEN      627/vncserver-x11-c
tcp6       0      0 :::80                   :::*                    LISTEN      727/apache2     
tcp6       0      0 :::22                   :::*                    LISTEN      521/sshd       
tcp6       0      0 ::1:631                 :::*                    LISTEN      24878/cupsd
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 15, 2017, 01:11:23 PM
Thanks to both for the further responses:

@RichardB
On my RPi desktop, from VNC Server-Options-Connections, display indicates port 5900.
The VNC Server address in my case as per connect dialogue is 192.168.0.11:1, "11" being the router reserved address for the RPi.

If I now disable your auto-start on boot script and then manually start DSLStats the program starts normally with it's GUI displayed on the RPi desktop, ie., exactly as it did when using TightVNC server as opposed to the latest VNC Server.
I now believe that most of my previous DSLStats auto-start on boot attempts did work but produced the same situation as current, DSLStats GUI not displayed on RPi desktop although the program was actually running, hence the error produced when attempting a further program start.

@vic0239
Running the "sudo netstat -lptn" command does indeed produce the display 0 and port 5900 indications as per your post.

I would appear to be back exactly where I started all be it with a little bit more knowledge of Linux thanks to the forum members.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: vic0239 on December 15, 2017, 03:23:49 PM
The VNC Server address in my case as per connect dialogue is 192.168.0.11:1, "11" being the router reserved address for the RPi.
What happens if you change the address to 192.168.0.11:0?
Title: Re: Best way to get DSL Stats running 24/7?
Post by: RichardB on December 15, 2017, 03:36:44 PM
On my RPi desktop, from VNC Server-Options-Connections, display indicates port 5900.
The VNC Server address in my case as per connect dialogue is 192.168.0.11:1, "11" being the router reserved address for the RPi.

Form https://www.raspberrypi.org/documentation/remote-access/vnc/

:1 at the end of the IP address indicates a virtual desktop. You need the "direct" desktop.

Did you enable VNC via the raspi-config tool?

It is strange that the VNC server reports port 5900 & netstat reports display :0 yet you connect to port:1

When you use REAL VNC viewer, do you enter an IP address of "192.168.0.11:1"? If so try "192.168.0.11" dropping the port number.

Richard

Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 15, 2017, 05:28:29 PM
@vic0239

Quote
What happens if you change the address to 192.168.0.11:0?

VNC Viewer window opens but with much different screen resolution, menu bar much bigger, desktop icons much bigger, DSLStats GUI won't fit into window without scrolling.
RPi desktop resolution is still 720X480 so would seem to be a function of the VNC viewer.
However, the very good news is that the DSLStats auto-start on boot script now produces it's desktop GUI on program starting, I have set the sleep delay to 3 mins for my old, slow RPi Mk1B, definate progress.

@RichardB

Quote
Did you enable VNC via the raspi-config tool?

Yes, when I replaced TightVNC with VNC Server.

Quote
When you use REAL VNC viewer, do you enter an IP address of "192.168.0.11:1"? If so try "192.168.0.11" dropping the port number
Using no port number suffix produces the exact same effect as using "*:0"
Up to present I have used the "*:1" suffix, hence the issues it would appear.

If I can now get the VNC window resolution back to the previous format that's the issue solved, I can't currently see any differences in the VNC viewer setup between ":0" and "*:1" settings, is this more likely to be a function of the VNC Server ?
 

Title: Re: Best way to get DSL Stats running 24/7?
Post by: vic0239 on December 15, 2017, 06:02:26 PM
I have changed the resolution on my devices, but can’t recall from memory what is required. I have made notes of the process (helps my aging powers of recall), so will consult those and post back.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: vic0239 on December 15, 2017, 06:13:42 PM
The settings are in /boot/config.txt. I set the following for my monitor. Choose whichever mode suits your display.

Code: [Select]
# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1
hdmi_ignore_edid=0xa5000080

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=58

Explanation of these settings can be found here https://www.raspberrypi.org/documentation/configuration/config-txt/video.md (https://www.raspberrypi.org/documentation/configuration/config-txt/video.md)

Good to be making progress!
Title: Re: Best way to get DSL Stats running 24/7?
Post by: RichardB on December 15, 2017, 06:28:01 PM
The screen resolution can also be altered using the raspi-config tool.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: vic0239 on December 15, 2017, 06:53:03 PM
... but not as much fun!  :P I like to get my vi editor to work as often as I can.  ;)

Advanced Options
A5
Title: Re: Best way to get DSL Stats running 24/7?
Post by: RichardB on December 15, 2017, 06:57:10 PM
... but not as much fun!  :P I like to get my vi editor to work as often as I can.  ;)
;D ;D ;D
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on December 15, 2017, 09:42:47 PM
Well, that's it, very much thanks to the perseverance of you two kind gentlemen and other forum members, all working well and looking good.

Yes, I was aware of the screen resolution change facility within the Raspbian, desktop shell but I thought as it had not changed from the "window 1" setup, still 720X480, then that might not be the best place to adjust.
However, increased in steps up to "DMT mode 16 1024X768 60 Hz 4:3" setting which is now virtually the same as previous when using the "window 1" setup.

Kept the startup, sleep delay at 3 mins, needed for my old slow RPi Mk1B which struggles a bit, CPU usage tops out during sampling and uploading to MDWS, however, it still manages to maintain 100% upload on MDWS so does the job.

Will now update the configuration on the two RPI Zero W's I look after to enable DSLStats auto-booting, as they both run on the exact same program as my Mk1B RPi (apart from IP addresses) should be easily done.

Again, many thanks to RichardB and vic0239 for the support and assistance provided.
 
Title: Re: Best way to get DSL Stats running 24/7?
Post by: vic0239 on December 16, 2017, 07:57:06 AM
Nae bother! Glad it's now working well for you.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: RichardB on December 18, 2017, 08:28:58 AM
Glad to help.

and I learned more about VNC and virtual desktops  :)
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on January 16, 2018, 09:26:28 AM
Ok, I'm back, wanting to continue this where I left off.

So rather than the £55 starter pack, can I get the Pi Zero W Essentials kit and have everything included that I need? If not what else will be needed? I've got a spare micro SD that I could use for the OS.

https://thepihut.com/collections/raspberry-pi-zero/products/raspberry-pi-zero-w?variant=30333236753

I want to power it via USB off the router and I'll have it hidden out of sight once its all set up and running.

Will need a case for it too, this will do: https://thepihut.com/collections/raspberry-pi-zero/products/premium-raspberry-pi-zero-case?variant=25147478984

So if I were to order those two I'd be all set?

Ta.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Deathstar on January 16, 2018, 10:26:11 AM
I paid £47 for the starter kit inc PSU, Case and 16GB card.

Raspberry Pi 3 Official Desktop Starter Kit (16Gb, Black) https://www.amazon.co.uk/dp/B01CI5879A/ref=cm_sw_r_cp_apa_WlDxAbAZT7629

Took about 30 mins to set up.

Upgraded to the latest Raspbian with Pixel with no issues with VNC. Also set to autostart DSLSTATS in Pi boot.

Sent from my SM-G930F using Tapatalk
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Westie on January 16, 2018, 10:58:44 AM
Or you could get a Pi Zero W, with adapters and case from Pimoroni https://shop.pimoroni.com/products/raspberry-pi-zero-w (https://shop.pimoroni.com/products/raspberry-pi-zero-w) for £19 + Del. I think their ref  is /PIM257. You will also need a micro USB card with a fresh image of Raspbian. A 16GB card works fine, but don't try Raspbian Lite unless you are au fait with Linux, as DSLstats needs to run on a GUI.

I set mine up with a screen and mouse/keyboard, then run it headless using the router's USB port for power.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on January 16, 2018, 11:03:41 AM
Yeah thats the sort of setup I want, hence the Pi Zero kit I posted above. :)

I want it as small as possible, running off USB from the router and when its setup it will be hidden and headless.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Westie on January 16, 2018, 11:05:38 AM
The adapters are only needed for setting up. After that the Pi has all it needs (apart from a USB/micro USB power cable). A case is useful for protection, but to be honest mine is in the zippy bag it came in, and is tucked out of sight.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on January 16, 2018, 11:08:22 AM
Yep, how do you guys go about connecting to it remotely? I use Chrome remote Desktop and Teamviewer regularly as it is, would TV work ok or is there something better?
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Westie on January 16, 2018, 11:16:06 AM
For a screen I used a small TV with an HDMI input.

You don't need all the GPIO headers, or the metal tin. What I suggested from Pimoroni contains all you need including case, for about the same price as the kit you mentioned (which also has a metal tin which can't be used as it will block the radio signals!) Pimoroni also have 24hr delivery as standard, not 48hr from the people you mention.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Westie on January 16, 2018, 11:18:03 AM
I was considering posting a list of the steps I followed. It might take me a few days to do it, but would that help?
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on January 16, 2018, 11:37:45 AM
Yeah I'll set it up on my monitor - it has several HDMI ports.

Can do if you would like, but I'm sure I'll figure it out. Just want it right in my head what I'll need before I start. I'm fairly techie with PC's so I'm sure I'll work it out. :)

I'm not too fussed where it comes from tbh, I do prefer the case from the PiHut though, even if it will be hidden out of sight! lol.

It'll cost me much the same either way.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Westie on January 16, 2018, 12:18:05 PM
[OT]
I agree, the "official" case does look rather smart! I have one as a Print Server.  :)
[\OT]
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on January 16, 2018, 12:26:23 PM
Ordered the W Zero and the official case from your link. Doubt I'll have time to do anything wit hit until the weekend anyway. I also think I've over complicated things in my head.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Tayta on January 18, 2018, 07:42:39 PM
I'm currently using a Raspberry Pi Zero W running Raspbian and Pi Desktop/Pixel

I've set it up with VNC so that if I ever reboot (which is never really as its also my VPN Server) I can VNC into it to restart the monitoring.

I probably should point out that my active Eth on the HG612 modem, i've configured onto my local lan subnet.  That way my Pi Zero W can access the modem over WiFi to get the stats.

Title: Re: Best way to get DSL Stats running 24/7?
Post by: Deathstar on January 18, 2018, 08:09:08 PM
I'm currently using a Raspberry Pi Zero W running Raspbian and Pi Desktop/Pixel

I've set it up with VNC so that if I ever reboot (which is never really as its also my VPN Server) I can VNC into it to restart the monitoring.

I probably should point out that my active Eth on the HG612 modem, i've configured onto my local lan subnet.  That way my Pi Zero W can access the modem over WiFi to get the stats.
You can set DSLStats to automatically start on reboot.

Sent from my SM-G930F using Tapatalk

Title: Re: Best way to get DSL Stats running 24/7?
Post by: Tayta on January 18, 2018, 10:56:45 PM
You can set DSLStats to automatically start on reboot.

Sent from my SM-G930F using Tapatalk

Good shout. I have done that just now!
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on January 23, 2018, 09:33:26 AM
Its alive!

All up and running last night. Powered by the router using a super short micro USB cable, nice and minimal. I'm going to find a way to mount it to the back of the router so its secured as for now it just resting behind it.

Connecting remotely via VNC.

Only thing I need to do now it work out how to make DSLStats start automatically on boot.

Reading back I see you guys use a bash script. As a complete Linux noob, anyone mind giving me an idiots guide how to do this please?  :-[


Thanks for all the help thus far, it was as I suspected far easier than I thought.  :)
Title: Re: Best way to get DSL Stats running 24/7?
Post by: Westie on January 23, 2018, 11:26:16 AM
roseway gave the solution here: link (http://forum.kitz.co.uk/index.php/topic,15882.msg303767.html#msg303767)


Open Leafpad and create a file called dslstats.desktop as below. Save it in /home/pi/.config/autostart/

Contents of dslstats.desktop:

Code: [Select]
[Desktop Entry]
Version=1.0
Type=Application
Name=DSLstats
Exec=/home/pi/dslstats/dslstats

Save this file, then reboot the RPi.

Sorry, not very good with posting links...

[Moderator edited to fix the link.]
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on January 23, 2018, 03:42:27 PM
Its alive!

All up and running last night. Powered by the router using a super short micro USB cable, nice and minimal. I'm going to find a way to mount it to the back of the router so its secured as for now it just resting behind it.

Connecting remotely via VNC.

Only thing I need to do now it work out how to make DSLStats start automatically on boot.

Reading back I see you guys use a bash script. As a complete Linux noob, anyone mind giving me an idiots guide how to do this please?  :-[


Thanks for all the help thus far, it was as I suspected far easier than I thought.  :)

Ref auto-booting on power-up, follow my posts and associated answers earlier in this thread, I had previously given up on auto-booting but with the help of more knowledgable forum members I got there in the end.
I am also not very Linux familiar but found that this particular task is not that complicated if you follow a step by step approach, the information is all there in this thread.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: jelv on January 23, 2018, 03:56:02 PM
Sorry, not very good with posting links...

You posted a perfectly good link without realising it!

The heading "Quote from: roseway on 30-10-2015, 10:31:45 (http://forum.kitz.co.uk/index.php/topic,15882.msg303767.html#msg303767)" above the quote is a link.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: colin79666 on January 23, 2018, 08:04:59 PM
Just to add my 2 cents worth.

Thanks RichardB for the scripts  (http://forum.kitz.co.uk/index.php/topic,20672.msg360466.html#msg360466) on page 2 of this thread. Got my Raspberry Pi Zero W up and running today with the latest Raspbian release.. Only thing I had to do extra was modify the permissions on the DSL_start bash script so it could be executed. I also added a .sh extension onto the file name and some tweaks but that was just personal preference, not actually required.

Code: [Select]
#!/bin/bash
#usually reboots due to power failure
#or maintenance
sleep 30 #wait 30 seconds for DSL to reconnect
nohup /home/pi/dslstats32RPi-6.1/dslstats &
exit

Pi is powered from the Asus RT-AC68U router. I'd hoped to use a USB Ethernet adaptor rather than Wi-Fi but having issues with packet loss with the adaptor, something I've taken up with Pimoroni (where I got the kit from).
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on January 23, 2018, 08:33:20 PM
Quote
Pi is powered from the Asus RT-AC68U router. I'd hoped to use a USB Ethernet adaptor rather than Wi-Fi but having issues with packet loss with the adaptor, something I've taken up with Pimoroni (where I got the kit from).

I initially bought a micro USB to ethernet adaptor for the first RPi Zero W project on DSLStats, it actually cost more than the RPi itself so certainly did not repeat for the second RPi Zero W.
I use a WiFi connection on both units to their respective routers, have found this to be fine with no data loss apparent, can always maintain 100% upload or very close on MDWS, as the RPi's are attached to the back of the routers with sticky backed Velcro the distances are very short and cuts down on a cable, only one physical connection (power) to the RPi's.

See the results for yourself on MDWS "cruth211" and "smpay-37".
Title: Re: Best way to get DSL Stats running 24/7?
Post by: colin79666 on January 24, 2018, 08:40:13 PM
Thanks, ran on Wi-Fi ok but I usually have the Wi-Fi radios power off overnight which is why I wanted to get the Ethernet adaptor. Got a solution for it after much fiddling. Details below in case anyone else runs into this.

The three port USB Hub with Ethernet Micro B (ADP005) from Pimoroni uses a Realtek 8152 chip. On a Windows 8.1 tablet at work I found this to be reliable (no packet loss) but on Linux, including the Raspberry Pi, this chip has known issues. For example this post their own forums: https://forums.pimoroni.com/t/problem-with-three-port-usb-hub-with-ethernet/2467/4

A bit more research led me to a blog post: https://www.erol.name/force-100mbit-ethernet-speed-on-rtl-8152-usb-ethernet-adapter/
It appears the 8152 can have issues correctly auto negotiating the network speed with the network device it is connected to - in this case an Asus RT-AC68u router that support Gigabit speeds. I added the ethtool package to my Pi Zero (it is in the Rasbian repository) and added the following command to the /etc/rc.local file (so it gets set at every boot):
ethtool -s eth0 speed 100 duplex full autoneg off

This appears to resolve the issue by forcing the speed of the adaptor to run at 100Mbit with auto negotiation turned off. I get no packet loss with this setting.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on January 25, 2018, 12:21:25 PM
Quote
Thanks, ran on Wi-Fi ok but I usually have the Wi-Fi radios power off overnight which is why I wanted to get the Ethernet adaptor. Got a solution for it after much fiddling. Details below in case anyone else runs into this.

Don't really understand what the association with "the Wi-Fi Radios being power'ed off overnight" and the router/RPi Wi-Fi communication is, both of which will obviously be power'ed 24/7 ?

Glad you got your Micro B/Ethernet adaptor issue sorted, thanks for posting the solution, will be invaluable for anyone wishing to use this unit in RPi service.

For information, the Micro USB/Ethernet adaptor I use is this unit:
https://plugable.com/products/usb2-otge100
This is the US web site, from memory I bought from Amazon UK, cost, around £12 about 6 monts ago.
Works with RPi Zero W without any issues, is recommended on RPi sites & forums.

I note your MDWS router stat's history is building up nicely, you would appear to have a stable retalively noise free line, G.Inp with retx low profile DS and a very moderate US ES rate, nice stable SNRM already at 3dB target DS, I'am sure some of the more knowledgable forum members will give you a much more detailed analysis if you ask, enjoy.


Title: Re: Best way to get DSL Stats running 24/7?
Post by: colin79666 on January 25, 2018, 06:17:58 PM
Don't really understand what the association with "the Wi-Fi Radios being power'ed off overnight" and the router/RPi Wi-Fi communication is, both of which will obviously be power'ed 24/7 ?

Sorry perhaps I should have been clearer. I’ve got the router set to turn off its Wi-fi overnight. That would drop the Pis connection if it was connected wirelessly.

I’ve reported the adaptor issue to Pimoroni along with the solution. Got a nice reply and they are going to circulate it around their staff. I’m hoping they stop selling it or at least give a warning and advice as they sell it as being for the Pi yet, at least in some environments, it doesn’t work out the box as other adaptors do.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on January 25, 2018, 07:56:10 PM
Quote
Sorry perhaps I should have been clearer. I’ve got the router set to turn off its Wi-fi overnight. That would drop the Pis connection if it was connected wirelessly.

Ahh, understand, glad everything is working to your requirements now, happy monitoring.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on May 09, 2018, 09:22:43 AM
I know this is technically not the right place for this, but as a continuation of the subject..

My RPi Zero has been running DLSStats faultlessly since January, but for some reason in the last few days it seems that VNC is dying after a few hours/days and I can connect until I reboot  the Pi.

I've had it connected to the TV via HDMI so I can check its not the Pi crashing and its all still running fine, just that I can't log in via VNC like I normally would.

I think it has something to do with the updates I ran sometime last week, I just ran the two commands they mention on here.
https://www.raspberrypi.org/documentation/raspbian/updating.md

As its just DSL Stats on there and that is all its used for I was thinking of just doing a fresh install and seeing if that fixes it.

But I figured I'd ask you guys first as I'm a Pi noob and you lot might have an idea what's going on! :)

Cheers!
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on May 09, 2018, 11:10:33 AM
I'am running 2 RPI Zero W's remotely with VNC server/client on my son & daughters VDSL lines without any issues, they are both still running Raspbian Jessie, have not bothered to update to "Stretch" as yet, no real need as DSLStats runs without any issues.
I do update the RPi's regularily, using the commands recommended by "burakkucat":
sudo aptitude update
sudo aptitude safe-upgrade
sudo aptitude autoclean
Works for Jessie and Stretch (wait for each to complete between commands)

Wonder if your VNC connection to RPi is by ethernet or Wi-Fi ?

Could try a refresh of VNC server on your RPi or VNC client on your PC/laptop.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on May 09, 2018, 11:21:43 AM
It's a Zero mate, so its WiFi. :)

I just run these commands...

sudo apt-get update
sudo apt-get upgrade
sudo reboot

How does one 'reinstall' VNC on a Pi?
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on May 09, 2018, 01:21:06 PM
It's a Zero mate, so its WiFi. :)

I just run these commands...

sudo apt-get update
sudo apt-get upgrade
sudo reboot

How does one 'reinstall' VNC on a Pi?

It is possible to use a micro USB to ethernet adapter and connect a RPi Zero W to LAN via ethernet so not such an obvious question, I bought one for initial setup of the Zero's but now use Wi-Fi.

Yes, those update commands do work but I was advised by someone who knows Linux well to use the "aptitude" option.

VNC server is installed by default on Raspbian Jessie and Stretch, it's obviously enabled on your system, Raspberry Pi Configuration / Interfaces menu.
You could refresh the VNC server program on the RPi, ie. re-install / over write, not sure of the command format for that, google it.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on May 09, 2018, 01:38:43 PM
Fair point, you can do that indeed.

Ah I'd not heard of that before, in fact when I read you post originally earlier I just assumed that you were on your phone and it had predicted aptitude from apt and it was supposed to be apt!  :D

Yeah I've tried installing/updating it but it just says I already have the latest version.

Cheers for your help btw. :)
Title: Re: Best way to get DSL Stats running 24/7?
Post by: tiffy on May 09, 2018, 04:05:17 PM
From RPi command prompt, run "man aptitude", this will lshow the full option list for the command and can be compared with "man apt".

I don't pretend to fully understand the advantage of "aptitude" over "apt" commands, I am just accepting the advice and guidance of a very experienced, knowledgable forum member.

Sorry, no further ideas regarding your intermittant issue other than as already suggested re-installing / refreshing VNC server on RPi and VNC client on your monitoring device.
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on May 09, 2018, 04:17:27 PM
I'll have a play when I get back home.

Yeah understood, hopefully he'll see this and offer up some wisdom.  :)
Title: Re: Best way to get DSL Stats running 24/7?
Post by: V_R on May 11, 2018, 08:07:31 PM
If anyone is interested, its not doing it anymore.

I rebooted the router after changing some settings. Am assuming it was that which fixed it.