Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: 1 ... 3 4 [5] 6 7

Author Topic: DSLstats with a Raspberry Pi  (Read 34422 times)

vic0239

  • Reg Member
  • ***
  • Posts: 519
Re: DSLstats with a Raspberry Pi
« Reply #60 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.
Logged
Lothian Broadband 900/900 + AAISP VDSL, Vigor2865Vac, MikroTik rb260gsp, ZyXel NWA50AX WiFi AP.

MikeZ

  • Member
  • **
  • Posts: 96
Re: DSLstats with a Raspberry Pi
« Reply #61 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.
Logged

MikeZ

  • Member
  • **
  • Posts: 96
Re: DSLstats with a Raspberry Pi
« Reply #62 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 :)
Logged

vic0239

  • Reg Member
  • ***
  • Posts: 519
Re: DSLstats with a Raspberry Pi
« Reply #63 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.
Logged
Lothian Broadband 900/900 + AAISP VDSL, Vigor2865Vac, MikroTik rb260gsp, ZyXel NWA50AX WiFi AP.

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43603
  • Penguins CAN fly
    • DSLstats
Re: DSLstats with a Raspberry Pi
« Reply #64 on: April 09, 2016, 09:42:44 AM »

Sorry, I didn't pick this up before, but I think the above analysis is correct.
Logged
  Eric

MikeZ

  • Member
  • **
  • Posts: 96
Re: DSLstats with a Raspberry Pi
« Reply #65 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?
Logged

vic0239

  • Reg Member
  • ***
  • Posts: 519
Re: DSLstats with a Raspberry Pi
« Reply #66 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

Logged
Lothian Broadband 900/900 + AAISP VDSL, Vigor2865Vac, MikroTik rb260gsp, ZyXel NWA50AX WiFi AP.

MikeZ

  • Member
  • **
  • Posts: 96
Re: DSLstats with a Raspberry Pi
« Reply #67 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 :)
Logged

vic0239

  • Reg Member
  • ***
  • Posts: 519
Re: DSLstats with a Raspberry Pi
« Reply #68 on: April 09, 2016, 11:24:08 AM »

I'm moving to a Mac myself (new 27" iMac on order)
:cool:  ;)
Logged
Lothian Broadband 900/900 + AAISP VDSL, Vigor2865Vac, MikroTik rb260gsp, ZyXel NWA50AX WiFi AP.

GigabitEthernet

  • Kitizen
  • ****
  • Posts: 2243
Re: DSLstats with a Raspberry Pi
« Reply #69 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?
Logged

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43603
  • Penguins CAN fly
    • DSLstats
Re: DSLstats with a Raspberry Pi
« Reply #70 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.
Logged
  Eric

GigabitEthernet

  • Kitizen
  • ****
  • Posts: 2243
Re: DSLstats with a Raspberry Pi
« Reply #71 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 :(
Logged

GigabitEthernet

  • Kitizen
  • ****
  • Posts: 2243
Re: DSLstats with a Raspberry Pi
« Reply #72 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:
Logged

ejs

  • Kitizen
  • ****
  • Posts: 2078
Re: DSLstats with a Raspberry Pi
« Reply #73 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.
Logged

GigabitEthernet

  • Kitizen
  • ****
  • Posts: 2243
Re: DSLstats with a Raspberry Pi
« Reply #74 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
Logged
Pages: 1 ... 3 4 [5] 6 7
 

anything