Page 2 of 3

Re: Python Plugin: Speedtest

Posted: Thursday 08 March 2018 15:50
by capman
Thanks , i will try this :) . Strange it worked for http://www.domoticz.com/forum/viewtopic ... 42#p173904

Re: Python Plugin: Speedtest

Posted: Thursday 08 March 2018 23:35
by Xorfor
I did some rework and removed the check for existence of speedtest-cli. If speedtest-cli is not installed or executable, only an error is available in the log. Latest version available @ https://github.com/Xorfor/Domoticz-Speedtest-Plugin

Re: Python Plugin: Speedtest

Posted: Friday 09 March 2018 19:23
by capman
It's working now !!! :D Thanks 4 your effort Xorfor !

Re: Python Plugin: Speedtest

Posted: Saturday 17 March 2018 17:09
by sanderjohan
Xorfor wrote: Wednesday 17 January 2018 23:36 I found an unofficial alternative: https://github.com/zpeters/speedtest
If more people like to have this plugin also working in Windows, I will try to implement this :)
Any progress on making this plugin working voor windows? I would really like that!

Re: Python Plugin: Speedtest

Posted: Saturday 17 March 2018 20:16
by Xorfor
@sanderjohan:

Yes, I did some research and testing with the windows based speedtest. But I was not happy with the results. The output was different from speedtest-cli and the results seems too low.

After that I did some more investigation and got speedtest-cli working on my Windows 10 pc. So it should also work on your Domoticz system. However I was not able to test in, because my Domoticz is running on a RPi.
Please try the following steps:

1. If correct, Python is already installed, else you are not able to use the Domoticz Python plugins
2. Op the Command window and type: python -V
This should give you the current Python version
3. Since Python 3.4, also 'pip' is shipped as standard. This tool can be found in <your Python directory>\Scripts
4. Goto C:\...\Programs\Python\Python36-32\Scripts and type: pip install speedtest-cli
5. Probably you get a warning that a new pip is available, but you can ignore this
6. If correct, a speedtest-cli.exe can be found. Type: speedtest-cli --simple
After approx. 20 sec you should get a report

This is as far as it worked for me. I am not able to do further testing. Perhaps you can place the speedtest-cli.exe in the plugin directory? Perhaps other Windows Plugin developers have a suggestion?

Please try above steps, perhaps I can help you.

Re: Python Plugin: Speedtest

Posted: Friday 23 March 2018 0:04
by alexsh1
Hi,

Any idea why I have a log of these in the log?

Code: Select all

2018-03-22 23:01:30.296 Error: Speedtest hardware (16) thread seems to have ended unexpectedly
Basically, the plugin is only working for a few hours and then I have to reboot RPi in order to make it work again.

Thanks
Alex

Re: Python Plugin: Speedtest

Posted: Friday 23 March 2018 19:55
by Xorfor
In the past, I had this same error.

Please update your Domoticz to the latest beta version.

When you are using python plugins, try to use the latest beta version. There is still development done, and the developer are still adding new functionality.

Re: Python Plugin: Speedtest

Posted: Saturday 24 March 2018 11:26
by alexsh1
Xorfor wrote: Friday 23 March 2018 19:55
Please update your Domoticz to the latest beta version.
I have the latest version V3.9052, but the error still comes up. I have to restart Domoticz another plug-in would not work :(

Re: Python Plugin: Speedtest

Posted: Saturday 24 March 2018 19:54
by Xorfor
You can also try to disable/enable the hardware. This will in fact restart the plugin.

Re: Python Plugin: Speedtest

Posted: Saturday 24 March 2018 23:01
by alexsh1
Xorfor wrote: Saturday 24 March 2018 19:54 You can also try to disable/enable the hardware. This will in fact restart the plugin.
I tried it, but this does not help - plugin is still logging the same error message. Only reboot helps

Re: Python Plugin: Speedtest

Posted: Sunday 25 March 2018 11:25
by Derik
dear developer.

Thanks for this great work..
I use the lua script to..
Only 1 question..
Is the plugin stable?
Or do i need some specific python version or something else.

Or just install and run:-)

Re: Python Plugin: Speedtest

Posted: Sunday 25 March 2018 21:45
by Xorfor
@Derik:

I am running the Speedtest plugin on 2 RPi's, a production and a development system on the latest Domoticz beta version for weeks and don't have any problem. I am using default Domoticz installations, so no specific Python version.

It only seems that using the Python plugins, it is recommended to use the latest beta version of Domoticz.

Re: Python Plugin: Speedtest

Posted: Sunday 25 March 2018 22:01
by Derik
Xorfor wrote: Sunday 25 March 2018 21:45 @Derik:

I am running the Speedtest plugin on 2 RPi's, a production and a development system on the latest Domoticz beta version for weeks and don't have any problem. I am using default Domoticz installations, so no specific Python version.

It only seems that using the Python plugins, it is recommended to use the latest beta version of Domoticz.
mmm did install it on my rpi..
Set the time around 2 hours.
Only the plugin is not working. I see the new device on my domoticz..
Do i need to set the right to 777 or 666 or what is the best chmod?

Re: Python Plugin: Speedtest

Posted: Sunday 25 March 2018 22:19
by Xorfor
Derik wrote: Sunday 25 March 2018 22:01 mmm did install it on my rpi..
Set the time around 2 hours.
Only the plugin is not working. I see the new device on my domoticz..
Do i need to set the right to 777 or 666 or what is the best chmod?
Did you install speedtest-cli as described on https://github.com/Xorfor/Domoticz-Speedtest-Plugin? Any information in the log?

Re: Python Plugin: Speedtest

Posted: Tuesday 27 March 2018 14:33
by Ventron

Code: Select all

2018-03-27 14:26:44.255 Error: (CDevice_update) PING: Failed to parse parameters: 'nValue', 'sValue', 'SignalLevel', 'BatteryLevel' or 'Options' expected.
2018-03-27 14:26:44.255 Error: (Speedtest) 'CDevice_update' failed 'TypeError':''TimedOut' is an invalid keyword argument for this function'.
2018-03-27 14:26:44.255 Error: (CDevice_update) DOWNLOAD: Failed to parse parameters: 'nValue', 'sValue', 'SignalLevel', 'BatteryLevel' or 'Options' expected.
2018-03-27 14:26:44.255 Error: (Speedtest) 'CDevice_update' failed 'TypeError':''TimedOut' is an invalid keyword argument for this function'.
2018-03-27 14:26:44.255 Error: (CDevice_update) UPLOAD: Failed to parse parameters: 'nValue', 'sValue', 'SignalLevel', 'BatteryLevel' or 'Options' expected.
2018-03-27 14:26:44.255 Error: (Speedtest) 'CDevice_update' failed 'TypeError':''TimedOut' is an invalid keyword argument for this function'.
Any ideas?

Re: Python Plugin: Speedtest

Posted: Tuesday 27 March 2018 19:18
by Xorfor
@Ventron,

This Python plugin is using a option, which is not available in your Domoticz.
You have 2 options:

1. Update to the latest beta version of Domoticz. If you are planning to use more plugins, this is the recommended option.

or

2. Change the Speedtest plugin:
a. Open the plugin.py in an editor
b. Goto to line 177, the UpdateDevice procedure:

Code: Select all

def UpdateDevice(Unit, nValue, sValue, TimedOut=0, AlwaysUpdate=False):
    # Make sure that the Domoticz device still exists (they can be deleted) before updating it
    if Unit in Devices:
        if Devices[Unit].nValue != nValue or Devices[Unit].sValue != sValue or Devices[Unit].TimedOut != TimedOut or AlwaysUpdate:
            Devices[Unit].Update(nValue=nValue, sValue=str(sValue), TimedOut=TimedOut)
            Domoticz.Debug("Update " + Devices[Unit].Name + ": " + str(nValue) + " - '" + str(sValue) + "' - " + str(TimedOut))
change to:

Code: Select all

def UpdateDevice(Unit, nValue, sValue, TimedOut=0, AlwaysUpdate=False):
    # Make sure that the Domoticz device still exists (they can be deleted) before updating it
    if Unit in Devices:
        if Devices[Unit].nValue != nValue or Devices[Unit].sValue != sValue or AlwaysUpdate:
            Devices[Unit].Update(nValue=nValue, sValue=str(sValue))
            Domoticz.Debug("Update " + Devices[Unit].Name + ": " + str(nValue) + " - '" + str(sValue) + "' - " + str(TimedOut))
The changes are done by removing ' or Devices[Unit].TimedOut != TimedOut' is one line and ', TimedOut=TimedOut' in the next line.

Re: Python Plugin: Speedtest

Posted: Wednesday 28 March 2018 17:07
by Ventron
Updated to beta. Now its working like a harm! Thanks

Re: Python Plugin: Speedtest

Posted: Wednesday 28 March 2018 17:33
by emeyedeejay
Hi Xorfor, any ideas on this?

https://github.com/Xorfor/Domoticz-PiMo ... n/issues/1

At a particular point last night all plugins stopped functioning. I had installed only the Pi Monitor and Speedtest plugins on the latest Beta (also just upgraded last night).

Looking at the hardware settings, the "type" is now blank and the Pi Monitor and Speedtest hardware types are not listed in the "type" drop down where you add new hardware.

Any ideas?

Thanks for the great tools!

Thanks!

Re: Python Plugin: Speedtest

Posted: Wednesday 28 March 2018 19:29
by Xorfor
@emeyedeejay:

I have no idea what happened with your Domoticz installation! I just updated my development RPi to 3.9117, to see if it also happens to me.

Did you found something in the log?

Try to reboot and see if the hardware is available again.

Re: Python Plugin: Speedtest

Posted: Wednesday 28 March 2018 19:51
by emeyedeejay
Ok thanks.

I've rebooted multiple times, recopied the pluguins over, added them, removed them etc. It's so weird - at 11:02pm they all "just stopped" working.

I'm a total noob with raspbaian/debian/linux/unix and Pis though so I'm sure it's something I did.

I removed the hardware and now can;t add them back as they don't appear in the "type" list of hardware. So odd.

Error Log is totally empty.

Status Log:
2018-03-28 17:30:46.050 Domoticz V3.9117 (c)2012-2018 GizMoCuz
2018-03-28 17:30:46.050 Build Hash: fea48d46, Date: 2018-03-28 09:17:41
2018-03-28 17:30:46.051 Startup Path: /home/pi/domoticz/
2018-03-28 17:30:46.082 EventSystem: reset all events...
2018-03-28 17:30:46.084 Using 1-Wire support (kernel W1 module)...
2018-03-28 17:30:46.094 WebServer(HTTP) started on address: :: with port 8080
2018-03-28 17:30:46.099 WebServer(SSL) started on address: :: with port 443
2018-03-28 17:30:46.101 Proxymanager started.
2018-03-28 17:30:46.102 Camera: settings (re)loaded
2018-03-28 17:30:46.103 TCPServer: shared server started...
2018-03-28 17:30:46.103 RxQueue: queue worker started...
2018-03-28 17:30:48.104 DarkSky: Started...
2018-03-28 17:30:48.104 Pinger: Started
2018-03-28 17:30:48.104 1Wire: Added Device: 28-0004332324ff
2018-03-28 17:30:48.254 PROXY: Authenticate result: success.
2018-03-28 17:30:49.104 MQTT: Connecting to 192.168.0.250:1883
2018-03-28 17:30:49.240 MQTT: connected to: 192.168.0.250:1883
2018-03-28 17:30:49.341 MQTT: Subscribed
2018-03-28 17:33:18.629 Login successful from 196.211.120.110 for user "--------"
2018-03-28 17:33:18.630 Incoming connection from: 196.211.120.110
2018-03-28 18:00:00.713 Starting automatic database backup procedure...
2018-03-28 18:00:01.632 Ending automatic database backup procedure...
2018-03-28 18:40:17.083 Login successful from 196.210.85.90 for user 'mike'
2018-03-28 18:40:17.083 Incoming connection from: 196.210.85.90
2018-03-28 18:47:01.086 Schedule item started! Name: Irrigation, Type: Before Sunset, DevID: 1, Time: 2018-03-28 18:47:01
2018-03-28 18:47:01.089 Notification: Irrigation >> OFF
2018-03-28 19:00:00.388 Starting automatic database backup procedure...
2018-03-28 19:00:01.103 Ending automatic database backup procedure...