Kitz Forum

Broadband Related => Router Monitoring Software => Topic started by: jamesfoley on August 04, 2015, 10:42:54 PM

Title: DSLstats with a Raspberry Pi
Post by: jamesfoley on August 04, 2015, 10:42:54 PM
So I've finally managed to get my HG612 unlocked and working with my router and figured I'd get it setup with a raspberry pi to log to MyDslWebStats. Everything works fine in Windows (DSLstats and pushing data to MyDslWebStats), and the DSLstats app works fine on the Pi, but it doesn't actually push any information to MyDslWebStats.

Could I be missing something at all?

The Pi is running a clean install of Raspbian if thats of any help.
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on August 04, 2015, 11:01:22 PM
DSLstats does work with Raspbian, including uploading to MDWS. If the latter doesn't work, then assuming you've set it up correctly, the most likely explanation is a permissions issue. By default, the MDWS files are saved in /home/pi/.dslstats/mydslwebstats. You need to make sure that this directory exists and that it is writeable by the normal user (pi).
Title: Re: DSLstats with a Raspberry Pi
Post by: NewtronStar on August 04, 2015, 11:12:40 PM
Make sure you have ticked upload data to MyDSLWebStats in the MyDSLWebstats configuration tab on DSLstats on the RPI and the username and validation key is correct (green)
Title: Re: DSLstats with a Raspberry Pi
Post by: jamesfoley on August 04, 2015, 11:20:49 PM
Cheers for your help guys, not really sure what was up, but chmodding the directory roseway mentioned to 777 seems to have fixed it  :)
Title: Re: DSLstats with a Raspberry Pi
Post by: NewtronStar on August 04, 2015, 11:26:08 PM
Cheers for your help guys, not really sure what was up, but chmodding the directory roseway mentioned to 777 seems to have fixed it  :)

That's good JF and can see your stats on MDWS building up  :)
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on August 05, 2015, 07:07:55 AM
Cheers for your help guys, not really sure what was up, but chmodding the directory roseway mentioned to 777 seems to have fixed it  :)

Thanks for confirming that. DSLstats creates that directory, so I need to have another look at the code that does this, as it seems there may be something not working quite right. It's too late for the next release, which I'm just about to make, but I'll check it out afterwards.
Title: Re: DSLstats with a Raspberry Pi
Post by: Dray on August 05, 2015, 09:02:50 AM
Is there an idiots guide to installing DSLStats on a Raspberry Pi from scratch available please?
Title: Re: DSLstats with a Raspberry Pi
Post by: jamesfoley on August 05, 2015, 10:26:25 AM
For me it was just a case of extracting the contents of the download from the DSLStats site and running the executable. I'm running my Pi headless with tightvncserver which seems to work fine, though for some reason it has stopped uploading this morning. I was faffing with my router this morning so the chances are I've just not plugged the Pi back in.

It would be cool if you could run DSLStats as a service without a gui though, so something you could install over ssh.
Title: Re: DSLstats with a Raspberry Pi
Post by: Dray on August 05, 2015, 11:20:02 AM
It would be cool if you could run DSLStats as a service without a gui though, so something you could install over ssh.
That's been asked before but it's not going to happen as far as I know.

What would be nice would be a zip file that I could just unzip onto an SD card and put in the RPi which would come with an operating system, tightvnc and maybe a few instructions, and just work.
Title: Re: DSLstats with a Raspberry Pi
Post by: jamesfoley on August 05, 2015, 11:27:46 AM
That wouldn't actually be too hard to do to be honest. I can always take an image of my SD card and upload it if you'd like?

At the moment its a base Raspbian image with DSLStats on the desktop and tightvnc installed. Would just be a case of writing the image to your SD card, shoving it in the Pi and connecting to the VNC server. Though I could probably write a step by step guide to get everything working using a normal Raspbian image and a few ssh commands, as I know randomly uploading an image is a bit sketchy.
Title: Re: DSLstats with a Raspberry Pi
Post by: Dray on August 05, 2015, 11:58:27 AM
That sounds exactly what I want :)
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on August 05, 2015, 01:01:14 PM
This is a great offer, JF. I'll be happy to host anything you produce on my website (fully credited of course) if that's useful.
Title: Re: DSLstats with a Raspberry Pi
Post by: jamesfoley on August 05, 2015, 02:57:24 PM
Sounds like a plan, I'll put something together tonight when I'm home from work  :)
Title: Re: DSLstats with a Raspberry Pi
Post by: sovking on August 12, 2015, 11:53:15 PM
It could be nice if dslstats could run just with webserver or for uploading data, without the need to keep X window up, like a daemon.
Just provide the right configuration file, the help file to edit it and run!
Title: Re: DSLstats with a Raspberry Pi
Post by: GigabitEthernet on August 13, 2015, 12:24:08 AM
That would also be something I would be interested in, jamesfoley. Thank you for the kind offer :)
Title: Re: DSLstats with a Raspberry Pi
Post by: jamesfoley on August 14, 2015, 01:07:15 PM
I'm currently looking at building something that is usable from the command line which runs as a service providing stats to a web interface. Time has been a little tight the last few weeks as I've just moved house, but I plan on ramping up the dev work in the evenings and will hopefully have something that works soonish.

I did write up a small guide which I sent to Dray, but I'm not really a fan of the whole keeping a window in x up all the time, plus I'm terrible at writing  ;)

If someone wants to take my tutorial and re-factor it so its a little easier to follow, let me know. :)
Title: Re: DSLstats with a Raspberry Pi
Post by: Dray on August 14, 2015, 01:14:17 PM
Given the RPi is solely being used for DSLStats, I don't see the problem with keeping an X window up all the time.
Title: Re: DSLstats with a Raspberry Pi
Post by: beardedwonder on September 03, 2015, 10:03:54 AM
Does anyone know if it's possible to connect the modem to the pi via ethernet and access the pi via wifi usb to get the stats?
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on September 03, 2015, 10:50:01 AM
Yes, it's possible, but not recommended. You're likely to get intermittent errors caused by glitches in the WiFi connection.
Title: Re: DSLstats with a Raspberry Pi
Post by: nivek1612 on October 19, 2015, 09:31:50 AM
I love DSLSTATS on the RPi

Although all attempts to make it auto run on reboot have failed

Any one else managed that
I tried the normal auto run files
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on October 19, 2015, 10:07:42 AM
I'm not exactly sure what you mean by the normal autorun files, but do understand that DSLstats is dependent on a GUI environment, so you can't start it from /etc/init.d or anything like that.
Title: Re: DSLstats with a Raspberry Pi
Post by: LaurieR on October 20, 2015, 04:46:55 PM
I'm a complete RPi noob. I tried several of the autostart methods described on various websites but none seemed to work - I blamed the fact that some only applied to the original Pi, not the 2, and some didn't work on Jessie (I updated from Wheezy).

Then suddenly I was getting "DSLstats is running already - closing down" on reboot so two autostarts were working! Trouble is, I can't remember what changes I made.
Title: Re: DSLstats with a Raspberry Pi
Post by: nivek1612 on October 20, 2015, 11:45:55 PM
Yes I had similar issues

Tried nearly every website guide our there never managed to get it to start clean

Even posted on the Pi forum - no one answered

But eh its a small issue 
Title: Re: DSLstats with a Raspberry Pi
Post by: LaurieR on October 29, 2015, 06:05:00 PM
Grrr. I reinstalled the Pi from Noobs to get rid of the various changes I'd made and forgotten about. So from a clean install I made just the one change - in /home/pi/.config/lxsession/LXDE-pi I added the line "/home/pi/dslstats/dslstats" to file "autostart".

Now on reboot I still get "dslstats already running - shutting down" but I can't see it on the desktop. It is running in the background as I can see it in task manager and mydslwebstats is green, but no GUI window.
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on October 29, 2015, 06:34:17 PM
When I get some time, I'll look into this, but at the moment all I can suggest is that you start DSLstats manually.
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on October 30, 2015, 10:31:45 AM
@LaurieR: I think I have a solution (it works here on my RPi mark 2):

1. Remove the dslstats line from /home/pi/.config/lxsession/LXDE-pi/autostart/

2. Open Leafpad and create a file called dslstats.desktop as below. Save it in /home/pi/.config/autostart/  (not in the directory mentioned above)

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.
Title: Re: DSLstats with a Raspberry Pi
Post by: LaurieR on October 30, 2015, 06:18:07 PM
I tried that but still get "already running" and no DSLstats window.
Not really a problem though.
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on October 30, 2015, 06:42:52 PM
All I can think is that something is trying to launch DSLstats from some other source. Have you been experimenting with other autostart methods perhaps? The RPi on which I tested the .desktop method was a nearly new, clean installation. Even with your previous method, I didn't get any "already running" messages; the method simply failed to launch DSLstats.
Title: Re: DSLstats with a Raspberry Pi
Post by: nivek1612 on November 01, 2015, 10:23:20 AM
Im away, but will give this a go when I get back
Title: Re: DSLstats with a Raspberry Pi
Post by: vic0239 on November 01, 2015, 02:20:26 PM

Contents of dslstats.desktop:

Code: [Select]
[Desktop Entry]
Version=1.0
Type=Application
Name=DSLstats
Exec=/home/pi/dslstats/dslstats
Thank you for the tip. :thumbs: I have implemented this on my Pi 2 Model B and it is working fine. Only snag was that the desktop environment was initialising before the network was up (I’m supposing) and DSLstats complained that it could not check MyDSLWebStats details. I got round this by placing my own script in the ~/.config/autostart/dslstats.desktop file and invoking DSLstats from that after a little sleep time.  :sleep: Crude I know, but I couldn’t be bothered to code anything more precise to check the network was up.  :)
Title: Re: DSLstats with a Raspberry Pi
Post by: LaurieR on November 02, 2015, 11:34:41 AM
All I can think is that something is trying to launch DSLstats from some other source. Have you been experimenting with other autostart methods perhaps?

Yes but "experimenting" would make it sound like I knew what I was doing. "Blundering around" would be more accurate.
Title: Re: DSLstats with a Raspberry Pi
Post by: broadstairs on November 02, 2015, 11:49:52 AM
Thank you for the tip. :thumbs: I have implemented this on my Pi 2 Model B and it is working fine. Only snag was that the desktop environment was initialising before the network was up (I’m supposing) and DSLstats complained that it could not check MyDSLWebStats details. I got round this by placing my own script in the ~/.config/autostart/dslstats.desktop file and invoking DSLstats from that after a little sleep time.  :sleep: Crude I know, but I couldn’t be bothered to code anything more precise to check the network was up.  :)

Dont know if the version of linux on the RPi has it but on my linux there is a service called NetworkManager-wait-online.service which allows the system to wait for the network to come up during boot so that things which need the network active can start OK. I use it to make sure Samba works OK. It might slow booting slightly but has the advantage of not having to mess with stuff which cant find a network connection at the time it needs it.

Stuart
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on November 02, 2015, 02:17:18 PM
It's a good suggestion, Stuart, but the RPi doesn't use Network Manager. It uses the simpler ifup/ifdown system.
Title: Re: DSLstats with a Raspberry Pi
Post by: broadstairs on November 02, 2015, 05:57:29 PM
It's a good suggestion, Stuart, but the RPi doesn't use Network Manager. It uses the simpler ifup/ifdown system.

As is obvious I dont have an RPi  ;)

Stuart
Title: Re: DSLstats with a Raspberry Pi
Post by: AngelRex on November 28, 2015, 12:59:57 AM
I am about to set up a pi with my hg612.

Currently, my hacked 612 isn't bridged, I just connect to lan2 running dslstats on a laptop.

To get the pi to upload to dslwebstats will it need to be bridged? Or will it just output to web?
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on November 28, 2015, 07:47:47 AM
How is your HG612 configured, i.e. as a simple modem or as a modem/router? If it's a modem/router then you should have no problems, and you can go ahead and upload data to MDWS. But if it's a modem only, then you are presumably using a firewall in the laptop, and you'll need to configure that appropriately. If you're not using a firewall, then you're very exposed.
Title: Re: DSLstats with a Raspberry Pi
Post by: AngelRex on November 28, 2015, 11:29:12 AM
How is your HG612 configured, i.e. as a simple modem or as a modem/router? If it's a modem/router then you should have no problems, and you can go ahead and upload data to MDWS. But if it's a modem only, then you are presumably using a firewall in the laptop, and you'll need to configure that appropriately. If you're not using a firewall, then you're very exposed.

I'm on SKY fibre so use the HG612 as a modem only, it connects up to the SR102 router.

I have the laptop RJ45 port connected to lan 2 for DSLwebstats.

The laptop wifi connects to the SR102 router to get internet.

I've just got a PI.  I want to connect the PI to LAN2 to get stats, I'm just wondering how I get this out. 
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on November 28, 2015, 11:50:53 AM
You shouldn't have two instances of DSLstats running at the same time, even if they're on different machines, so it would seem that the simplest solution would be to disconnect the laptop from LAN2 on the HG612, and replace it with the Raspberry Pi.

If you want both machines to have access to the stats, then a cheap switch connected to LAN2 would do the job.
Title: Re: DSLstats with a Raspberry Pi
Post by: AngelRex on November 28, 2015, 01:15:32 PM
You shouldn't have two instances of DSLstats running at the same time, even if they're on different machines, so it would seem that the simplest solution would be to disconnect the laptop from LAN2 on the HG612, and replace it with the Raspberry Pi.

If you want both machines to have access to the stats, then a cheap switch connected to LAN2 would do the job.

Ok, I think i either haven't explained properly or it didnt read well.........

I want to replace the laptop with the PI.

If I disable the laptop wifi and just have the rj45 connected it wont access the internet.

When I replace the Laptop with the PI, how do i get it to connect?
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on November 28, 2015, 03:01:30 PM
It's possible to configure the HG612 so that you can get the internet and stats over the same interface. I've no experience of doing this, but there's some information here: http://www.kitz.co.uk/routers/hg612unlock.htm#bridge with links to more information. I don't know if this works with the HG612 in modem mode.
Title: Re: DSLstats with a Raspberry Pi
Post by: jelv on November 28, 2015, 03:44:29 PM
Can't you just connect LAN2 on the HG612 to a port on SR102 and then connect the Pi to another port on the SR102?
Title: Re: DSLstats with a Raspberry Pi
Post by: AngelRex on November 28, 2015, 05:48:26 PM
Can't you just connect LAN2 on the HG612 to a port on SR102 and then connect the Pi to another port on the SR102?


To connect to the lan port 2, you need to be on a static IP.  I didnt think that, connecting the static LAN2 to the DHCP router would work.....
Title: Re: DSLstats with a Raspberry Pi
Post by: jelv on November 28, 2015, 09:25:15 PM
LAN2 is on the LAN side of the modem - static IP applies to the WAN side of the modem so I can't see how that could be relevant.

As long as the router is set to exclude the LAN IP address of the modem from the DHCP range I can't see what the issue is?
Title: Re: DSLstats with a Raspberry Pi
Post by: AngelRex on November 29, 2015, 09:49:36 AM
LAN2 is on the LAN side of the modem - static IP applies to the WAN side of the modem so I can't see how that could be relevant.

As long as the router is set to exclude the LAN IP address of the modem from the DHCP range I can't see what the issue is?

SR102 is set to DHCP. (range 192.168.0.1)

HG612 LAN1 is plugged into port 4 on SR102.

To access the HG612 the laptop, via LAN2, HAS to have a static IP 192.168.1.100.

So, if what you are saying is correct, I should have set up like this :

HG612 LAN1 -------> SR102 LAN4 ---> DHCP to wireless & other wired devices

HG612 LAN2 -------> SR102 LAN3 ---> To retrieve DSLstats from the LAPTOP can the laptop connected to the wireless DHCP connect to the LAP port when browsed to http://192.168.1.1 OR does the laptop have to be connected via the RJ45 to the SR102 lan ports to connect to 192.168.1.1?

Title: Re: DSLstats with a Raspberry Pi
Post by: AngelRex on November 29, 2015, 10:10:29 AM
OR....

Do I have to change my router to 192.168.1.2 & set the DHCP 192.168.1.3-254

then simply plug the LAN2 on hg612 into the router and the PI into the router too
Title: Re: DSLstats with a Raspberry Pi
Post by: jelv on November 29, 2015, 10:13:28 AM
To keep it simple you need to be using the same subnet on the HG612 LAN2 port as the rest of your LAN. So you can either change the subnet (and DHCP) on the router from 192.168.0.* to 192.168.1.* or (and this is the easier option) change the HG612 LAN2 IP address from 192.168.1.1 to 192.168.0.nnn where nnn is an address not currently in use on your LAN and preferably also outside of the DHCP range (you change it in the basic settings LAN).
Title: Re: DSLstats with a Raspberry Pi
Post by: jelv on November 29, 2015, 10:16:43 AM
You posted again while I was typing.

Yes that would be fine. I'd be tempted to make the router 192.168.1.254 which is used by a lot of other routers.
Title: Re: DSLstats with a Raspberry Pi
Post by: AngelRex on November 29, 2015, 12:07:29 PM
You posted again while I was typing.

Yes that would be fine. I'd be tempted to make the router 192.168.1.254 which is used by a lot of other routers.

Cheers :)

I used the latest HG612 firmware with only telnet, not HTTP access and CBA to re-flash, so it would be easier to change router. ty again.
Title: Re: DSLstats with a Raspberry Pi
Post by: LaurieR on December 17, 2015, 06:15:16 PM
@LaurieR: I think I have a solution (it works here on my RPi mark 2):

1. Remove the dslstats line from /home/pi/.config/lxsession/LXDE-pi/autostart/

2. Open Leafpad and create a file called dslstats.desktop as below. Save it in /home/pi/.config/autostart/  (not in the directory mentioned above)

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.

Finally sorted. I reinstalled Jessie to undo my previous tinkering, added your desktop script and that runs without errors.
However I wasn't getting a dslstats window even though the task was running and updating MyDSLWebStats.
I suspect that's because the desktop was still initialising when it starts. So instead of calling the dslstats executable directly as above, I call a shell script:

Code: [Select]
#!/bin/bash
sleep 10
/home/pi/dslstats/dslstats

- and that works.
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on December 17, 2015, 06:45:02 PM
Well done :)
Title: Re: DSLstats with a Raspberry Pi
Post by: LaurieR on March 12, 2016, 02:35:01 PM

Contents of dslstats.desktop:

Code: [Select]
[Desktop Entry]
Version=1.0
Type=Application
Name=DSLstats
Exec=/home/pi/dslstats/dslstats
... Only snag was that the desktop environment was initialising before the network was up (I’m supposing) and DSLstats complained that it could not check MyDSLWebStats details. I got round this by placing my own script in the ~/.config/autostart/dslstats.desktop file and invoking DSLstats from that after a little sleep time.  :sleep: Crude I know, but I couldn’t be bothered to code anything more precise to check the network was up.  :)

I mentioned in another thread having exactly that problem with my new Pi 3, which I thought I'd sorted but then it came back. Then I happened to spot the "wait for network" setting in the boot configuration. This wasn't ticked by default, but with it on I've not had a problem since.
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on March 12, 2016, 03:08:52 PM
That's useful to know, thank you.
Title: Re: DSLstats with a Raspberry Pi
Post by: LaurieR on March 12, 2016, 06:02:17 PM
Looks like it's only been there since a December 2015 update.

https://www.raspberrypi.org/blog/latest-raspbian-update/ (https://www.raspberrypi.org/blog/latest-raspbian-update/) and down a bit.
Title: Re: DSLstats with a Raspberry Pi
Post by: MikeZ on April 08, 2016, 01:53:44 PM
I'm expecting my Raspberry Pi 3 to be delivered today. I've been running DSLstats on Windows 10 - can I use the config file from the Windows installation on the Pi, or would it be better just to set DSLstats up from scratch?

Thanks in advance...
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on April 08, 2016, 02:29:19 PM
I haven't actually thought about that, but I think setting it up from scratch would be safer. The config file (dslstats.ini) includes some directory paths, and of course the path separator is different between the two OSs, so it might have strange effects.
Title: Re: DSLstats with a Raspberry Pi
Post by: MikeZ on April 08, 2016, 02:35:20 PM
I haven't actually thought about that, but I think setting it up from scratch would be safer. The config file (dslstats.ini) includes some directory paths, and of course the path separator is different between the two OSs, so it might have strange effects.

Thanks - I would edit it first to change things like that (and remove carriage returns). I might try it anyway and see what happens :)

I should add that Linux is my day job, so I'm comfortable playing around with it like this...
Title: Re: DSLstats with a Raspberry Pi
Post by: burakkucat on April 08, 2016, 06:23:12 PM
The simplest way might be to save the configuration file from the M$ Doze system, start DSLstats on the R-Pi and save the default configuration.

Then compare the two files, editing the latter with the relevant data from the former.

Finally put the new configuration file where the R-Pi version will expect to see it.  ;)
Title: Re: DSLstats with a Raspberry Pi
Post by: MikeZ on April 08, 2016, 07:11:14 PM
The simplest way might be to save the configuration file from the M$ Doze system, start DSLstats on the R-Pi and save the default configuration.

Then compare the two files, editing the latter with the relevant data from the former.

Finally put the new configuration file where the R-Pi version will expect to see it.  ;)

Yes, that's exactly my plan :) Pi has just been delivered so will be getting to work soon :)
Title: Re: DSLstats with a Raspberry Pi
Post by: burakkucat on April 08, 2016, 09:09:50 PM
Yes, that's exactly my plan :) Pi has just been delivered so will be getting to work soon :)

Just purrfect!
Title: Re: DSLstats with a Raspberry Pi
Post by: MikeZ on April 08, 2016, 09:32:38 PM
OK, so everything is set up and working fine. Just need to set it up to auto start on boot. In the end I decided to configure from scratch, just in case it got confused about what was in the local data files that it creates.

One oddity is that when setting up email alerts, nothing happens if I press the Test button - i.e. no test email is sent, no error message or anything. I don't know whether this means that email alerts won't work, or just that the Test button doesn't work. Any ideas?
Title: Re: DSLstats with a Raspberry Pi
Post by: vic0239 on April 08, 2016, 09:41:28 PM
Initially I had issues sending email and had to install libssl-dev to resolve. However, this was evident in the event log as a connection error.
Title: Re: DSLstats with a Raspberry Pi
Post by: MikeZ on April 08, 2016, 10:05:27 PM
Finally sorted. I reinstalled Jessie to undo my previous tinkering, added your desktop script and that runs without errors.
However I wasn't getting a dslstats window even though the task was running and updating MyDSLWebStats.
I suspect that's because the desktop was still initialising when it starts. So instead of calling the dslstats executable directly as above, I call a shell script:

Code: [Select]
#!/bin/bash
sleep 10
/home/pi/dslstats/dslstats

- and that works.

I've followed these instructions and dslstats starts (and starts uploading to MDWS). However, when I connect to the Pi (it's running headless) with RDP it tries to start dslstats again (using dslstats.desktop) and I get the "already running - closing down" error and never see a DSLstats window.

I think what's happening is that DSLstats gets started upon boot when the desktop starts, then it runs again when I log in to the 'pi' account via RDP.

What I don't understand is why it's running in the background to start with and not displaying on the desktop. I've tried setting a longer sleep value in the script (60 seconds) but it makes no difference.
Title: Re: DSLstats with a Raspberry Pi
Post by: MikeZ on April 08, 2016, 10:16:26 PM
Initially I had issues sending email and had to install libssl-dev to resolve. However, this was evident in the event log as a connection error.

Thank you - that was the problem :)
Title: Re: DSLstats with a Raspberry Pi
Post by: vic0239 on April 09, 2016, 09:29:12 AM

I've followed these instructions and dslstats starts (and starts uploading to MDWS). However, when I connect to the Pi (it's running headless) with RDP it tries to start dslstats again (using dslstats.desktop) and I get the "already running - closing down" error and never see a DSLstats window.

I think what's happening is that DSLstats gets started upon boot when the desktop starts, then it runs again when I log in to the 'pi' account via RDP.

What I don't understand is why it's running in the background to start with and not displaying on the desktop. I've tried setting a longer sleep value in the script (60 seconds) but it makes no difference.

I had this issue too which if I recall correctly 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.
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on April 09, 2016, 09:42:44 AM
Sorry, I didn't pick this up before, but I think the above analysis is correct.
Title: Re: DSLstats with a Raspberry Pi
Post by: MikeZ on April 09, 2016, 09:46:39 AM
I had this issue too which if I recall correctly 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.

Thanks - this looks promising. I've installed x11vnc but I obviously need to do some more configuration for it to work with xrdp as it's refusing to connect. Could I borrow your config, please?
Title: Re: DSLstats with a Raspberry Pi
Post by: vic0239 on April 09, 2016, 10:20:23 AM
Here is my autostart file, there was no other configuration other than creating the session password. I’m connecting from a Mac using screen sharing so can't say if this will work with XRDP.

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=
Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer
StartupNotify=false
Terminal=false
Hidden=false

Title: Re: DSLstats with a Raspberry Pi
Post by: MikeZ on April 09, 2016, 10:54:47 AM
Here is my autostart file, there was no other configuration other than creating the session password. I’m connecting from a Mac using screen sharing so can't say if this will work with XRDP.

Thanks - you've been very helpful :) It works fine with xrdp but, as I'm moving to a Mac myself (new 27" iMac on order), I've decided to use just the vnc protocol.

Everything is working fine, now - very happy with my new Pi :)
Title: Re: DSLstats with a Raspberry Pi
Post by: vic0239 on April 09, 2016, 11:24:08 AM
I'm moving to a Mac myself (new 27" iMac on order)
:cool:  ;)
Title: Re: DSLstats with a Raspberry Pi
Post by: GigabitEthernet on September 03, 2016, 06:34:44 PM
Finally sorted. I reinstalled Jessie to undo my previous tinkering, added your desktop script and that runs without errors.
However I wasn't getting a dslstats window even though the task was running and updating MyDSLWebStats.
I suspect that's because the desktop was still initialising when it starts. So instead of calling the dslstats executable directly as above, I call a shell script:

Code: [Select]
#!/bin/bash
sleep 10
/home/pi/dslstats/dslstats

- and that works.

Sorry for the bump but I've been trying this. I've put the code into dslstats.desktop and saved it where requested and when the system is rebooted, dslstats is not shown. I am using tightvnc and accessing the pi remotely. Is this why?
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on September 03, 2016, 07:19:05 PM
The problem here (I think) is that VNC accesses the RPi at command line level, and launches a separate desktop process from there. So the dslstats.desktop file which you created isn't seen by the new desktop. I'm sure there's a way round this, but for the moment perhaps you can launch DSLstats manually over the VNC interface.
Title: Re: DSLstats with a Raspberry Pi
Post by: GigabitEthernet on September 03, 2016, 07:25:40 PM
I'm using VNC that shows the main desktop though. I'm now connected directly and dslstats still doesn't open on boot :(
Title: Re: DSLstats with a Raspberry Pi
Post by: GigabitEthernet on September 03, 2016, 08:02:48 PM
Got it working :)

Edited the startup file by running:

Code: [Select]
sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
I then added dslstats to this file by adding

Quote
@/home/pi/dslstats/dslstats

to the bottom of the file. Saved it, rebooted and voila it's working  :dance:
Title: Re: DSLstats with a Raspberry Pi
Post by: ejs on September 03, 2016, 08:06:29 PM
Sorry for the bump but I've been trying this. I've put the code into dslstats.desktop and saved it where requested and when the system is rebooted, dslstats is not shown. I am using tightvnc and accessing the pi remotely. Is this why?

You can't put that shell script code into the dslstats.desktop autostart file, you'd need to put it into a separate file, set exec permissions on that file, and change the Exec line of dslstats.desktop to run that script.

Or, try changing the dslstats.desktop file to contain:

Code: [Select]
[Desktop Entry]
Version=1.0
Type=Application
Name=DSLstats
Exec=/bin/bash -c "sleep 10 ; exec /home/pi/dslstats/dslstats"

@GigabitEthernet
No need to use sudo to edit files in your own home directory.
Title: Re: DSLstats with a Raspberry Pi
Post by: GigabitEthernet on September 03, 2016, 11:55:16 PM
Thanks for the reply @ejs and for your method. I'll stick with mine until something breaks :P
Title: Re: DSLstats with a Raspberry Pi
Post by: gt94sss2 on October 01, 2016, 04:52:36 PM
This should perhaps be in a post of its own but think it will be of interest to those who have followed this thread..

The Raspberry Pi Foundation have released a new desktop environment for the Pi called PIXEL (runs on Raspbian) containing various improvements/UI refinements and updated software etc.

Notably, it integrates both VNC Viewer and VNC Server applications into the operating system which should make it easier to remotely run/administer software like DSLStats.

PIXEL is now downloadable from the Raspberry Pi website (https://www.raspberrypi.org/downloads/raspbian/) and you can find more details  - including how to upgrade existing installations - on their official blog (https://www.raspberrypi.org/blog/introducing-pixel/)
Title: Re: DSLstats with a Raspberry Pi
Post by: NewtronStar on October 01, 2016, 06:16:37 PM
Not sure which is installed on the my RPi the last one was Jessie and did a update a few week ago which took a while to update.

use cat /etc/os-release to show OS my RPi says Version 8 (jessie)
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on October 01, 2016, 06:28:31 PM
That's really nice looking. I'll certainly be upgrading my Pies.
Title: Re: DSLstats with a Raspberry Pi
Post by: Dino on October 05, 2016, 01:45:29 AM
Hi Guys....new guy here just starting out with DSLStats on the Pi. For some reason I can't seem to get the dropdown list to show in the normal login configuration tab...so I can't select my router. When I click on the down arrow nothing happens. Does anybody have some idea why? I have version 5.8 on newly updated RPi 3 with Jessie 8 on it. Thanks for the great forum and appreciate any ideas.  :)
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on October 05, 2016, 07:37:07 AM
Welcome to the forum. :)

When you unzipped the DSLstats archive which you downloaded, there should be a total of 19 files, one of which is called routers.dat. It sounds as though this file is missing for some reason. I suggest that you delete all the files and start again with a new download, making sure that all 19 files are kept together when you unzip the archive.
Title: Re: DSLstats with a Raspberry Pi
Post by: Dino on October 07, 2016, 05:52:14 AM
Thanks for the info. I mistakenly moved the executable file to the desktop..thinking I created a shortcut. I just started over again and unzipped the archive to a new folder and deleted the old one. Working awesome now on my Zyxel SBG3300.
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on October 07, 2016, 07:46:13 AM
Thank you for confirming that.
Title: Re: DSLstats with a Raspberry Pi
Post by: cliver on October 07, 2016, 04:52:53 PM
Just got myself RPi 3b running raspian jessie with pixel.
It's been a struggle but I finally have it running DSLStats and pushing data to MDSLWS.
I had real problems getting VNC to display a desktop but finally got it going. Can't pin down why but I finaly did a clean install and a sudo apt-get update and sudo apt-get upgrade. The desktop then appeared.
Anyway, that's an aside really.
My problems are
1. I can't get VNC to run automatically on boot up. The only way I can get it to work is to SSH in and run vncserver. I can then run the VNC Viewer on my windows machine and get the desktop up from where I can run DSLStats from the GUI.
I have followed several guides from various forums, blogs etc. but they all refer to earlier versions and I can't get them to work.
I'm no linux guru but am comfortable with it.
Has anyone got it working using jessie with pixel and VNC without having to manually start VNC at least would be a start?
It's a pain having to go SSH then terminal to get it running  :'(
Regards
Clive
Title: Re: DSLstats with a Raspberry Pi
Post by: licquorice on October 07, 2016, 05:23:00 PM
I just use Windows Remote desktop connection rather than VNC.
Title: Re: DSLstats with a Raspberry Pi
Post by: cliver on October 07, 2016, 05:26:07 PM
I just use Windows Remote desktop connection rather than VNC.
What are you running as the server on the Pi?
My thoughts were to get VNC running as it's included in the distro.

Sent from my Nexus 6P using Tapatalk

Title: Re: DSLstats with a Raspberry Pi
Post by: JamesK on October 07, 2016, 05:37:38 PM
I'm using xrdp with my Pi and it works nicely. Just issue the commands:
sudo apt-get install tightvncserver
sudo apt-get install xrdp and you should be able to connect using the Windows Remote Desktop client.

Link: https://www.maketecheasier.com/enabling-remote-desktop-access-on-raspberry-pi/ (https://www.maketecheasier.com/enabling-remote-desktop-access-on-raspberry-pi/)

I had no problems at all with it running v7 (wheezy), but v8 (jessie) initially gave me trouble with the issues described here:
https://thornelabs.net/2013/06/28/rhel-6-fix-xrdp-error-another-xserver-is-already-active-on-display-10.html (https://thornelabs.net/2013/06/28/rhel-6-fix-xrdp-error-another-xserver-is-already-active-on-display-10.html).

The solution, logged in as the pi user was to execute the command vncserver -geometry 1024x768 :10, allow it to generate and initialise stuff as a one-off activity. I then rebooted the pi, and after that xrdp worked fine.

I find xrdp a nicer solution for me than VNC which I had ongoing niggles with.
Title: Re: DSLstats with a Raspberry Pi
Post by: licquorice on October 07, 2016, 05:38:43 PM
What are you running as the server on the Pi?


Also using xrdp
Title: Re: DSLstats with a Raspberry Pi
Post by: cliver on October 07, 2016, 05:44:09 PM
Thanks guys. I'll give xrdp a go then.

Sent from my Nexus 6P using Tapatalk

Title: Re: DSLstats with a Raspberry Pi
Post by: cliver on October 07, 2016, 06:49:27 PM
I'm using xrdp with my Pi and it works nicely. Just issue the commands:
sudo apt-get install tightvncserver
sudo apt-get install xrdp and you should be able to connect using the Windows Remote Desktop client.

Link: https://www.maketecheasier.com/enabling-remote-desktop-access-on-raspberry-pi/ (https://www.maketecheasier.com/enabling-remote-desktop-access-on-raspberry-pi/)

I had no problems at all with it running v7 (wheezy), but v8 (jessie) initially gave me trouble with the issues described here:
https://thornelabs.net/2013/06/28/rhel-6-fix-xrdp-error-another-xserver-is-already-active-on-display-10.html (https://thornelabs.net/2013/06/28/rhel-6-fix-xrdp-error-another-xserver-is-already-active-on-display-10.html).

The solution, logged in as the pi user was to execute the command vncserver -geometry 1024x768 :10, allow it to generate and initialise stuff as a one-off activity. I then rebooted the pi, and after that xrdp worked fine.

I find xrdp a nicer solution for me than VNC which I had ongoing niggles with.

Do you still have VNC enabled in raspi-config?
Title: Re: DSLstats with a Raspberry Pi
Post by: cliver on October 08, 2016, 08:58:18 AM
OH I have it working on one machine with xrdp and windows rdp.
But when I login from another windows machine I get another instance of the desktop which is blank (No DSLStats window running).
How do I get all instances/clients to log into the same desktop?
Title: Re: DSLstats with a Raspberry Pi
Post by: Dray on October 08, 2016, 09:44:33 AM
Does this help?

http://askubuntu.com/questions/235905/use-xrdp-to-connect-to-desktop-session
Title: Re: DSLstats with a Raspberry Pi
Post by: cliver on October 08, 2016, 10:06:33 AM
Looks like it might well do the trick. I'll give it a go when I get back. Thanks Dray.
Title: Re: DSLstats with a Raspberry Pi
Post by: JamesK on October 08, 2016, 03:36:52 PM
Do you still have VNC enabled in raspi-config?

I just disabled it and rebooted and it still works fine.
Title: Re: DSLstats with a Raspberry Pi
Post by: cliver on October 10, 2016, 12:22:15 PM
OK, I couldn't get xrdp to display the same desktop on multiple devices so I decided to go back to VNC and try that again.
I re-initialised my RPi and started from scratch.
I found this with a google search
https://learn.adafruit.com/adafruit-raspberry-pi-lesson-7-remote-control-with-vnc/running-vncserver-at-startup (https://learn.adafruit.com/adafruit-raspberry-pi-lesson-7-remote-control-with-vnc/running-vncserver-at-startup)
and it seems to work.
Steps to set up:
Code: [Select]
[Desktop Entry]
Type=Application
Name=TightVNC
Exec=vncserver :1
StartupNotify=false
That's it, it will start on boot and I can connect to the same desktop from any machine using vncviewer to connect to IPAddressOfRPi :1

Still can't get dslstats to auto run successfully but I'm one step closer :-)
Title: Re: DSLstats with a Raspberry Pi
Post by: NewtronStar on October 12, 2016, 10:36:44 PM
Have just noticed a small rainbow icon at the top right of the screen on DSLstats using RPi it comes and go's so had to find why this happens.

The answer looks like under-voltage from the original power supply unit I suppose it must be 2 years old now it needs 5Volts so must be below 4.65Volts and right enough replaced original PSU with a PSU with same specs 5Volts 2.0amps output and the rainbow icon does not appear.
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on October 12, 2016, 10:48:45 PM
That's useful information, thanks.
Title: Re: DSLstats with a Raspberry Pi
Post by: lockdown on October 24, 2016, 10:45:34 PM
I'm a new user but just thought I'd provide a quick update on running DSLStats, I was running Wheezy but after reading through this thread it was apparent that upgrading to Jessie with Pixel would require less setup since VNC is baked in. I performed a clean install and once initially installed ran 'systemctl enable vncserver-x11-serviced.service' to run VNC server in service mode on boot, installed DSL stats and configured and it's up and running. For those wanting an easy ride - definitely the way to go.
Title: Re: DSLstats with a Raspberry Pi
Post by: roseway on October 24, 2016, 11:18:52 PM
Thanks for that information.