Could not connect to network server
#1
I am working through the HelloWorld add on example (http://wiki.xbmc.org/index.php?title=HOW...orld_addon)

I have installed my addon as a video plugin.

When I click on the add on, the notification is displayed in the lower right hand corner of the xbmc screen.

However, a dialog always pops up. The dialog has a title "Remote Share" The message "Could not connect to network server" is displayed. There is an "ok" button.

The question is why is this popping up? AFAIK, there is nothing in my script that is trying to make a network connection.

Has anyone else seen this?

Here is the script:

Code:
import sys
import xbmcgui
import xbmcplugin
import xbmcaddon

__addon__       = xbmcaddon.Addon()
__addonname__   = __addon__.getAddonInfo('name')
__icon__        = __addon__.getAddonInfo('icon')

line1 = "Hello there: This is a simple example of notifications"
time = 5000  #in miliseconds

xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)
Reply
#2
Could it be that you use any Gotham (alpha) version?
Afaik there is a bug in XBMC which shows the wrong text, I guess you have a "normal" script error. Have a look to your xbmc.log you should be able to find a Traceback in there.

Please try it with XBMC-Frodo (stable).
My GitHub. My Add-ons:
Image
Reply
#3
sphere,

I am having the error condition when running with a version of xbmc I compiled myself. System info reports the version as xbmc 13.0-alpha11.

When I tried the addon using a pre built version of xbmc (Frodo 12.2), there was no error dialog box.

Do you know the cause of the problem?

The log file doesn't tell me much. In fact the log says the script ran successfully and then reports an error. Here is the relevant snippet.

Code:
13:34:03 T:3004    INFO: CPythonInvoker(0, C:\Users\AppData\Roaming\XBMC\addons\plugin.video.hello\hello.py): script successfully run  
13:34:03 T:3004    INFO: Python script stopped
13:34:03 T:3004   DEBUG: Thread LanguageInvoker 3004 terminating
13:34:03 T:8952   DEBUG:  XFILE::CPluginDirectory::WaitOnScriptResult - plugin exited prematurely - terminating
13:34:03 T:9268   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.hello/
Reply
#4
It did not run fine Smile

Do you use a plugin extension point?
Code:
<extension point="xbmc.python.pluginsource">
?
If yes you see this error because you didn't call:
Code:
xbmcplugin.endOfDirectory(handle)
Which is required if you use this extension point!

You are writing some kind of script so you have switch to a script extension point:
Code:
<extension point="xbmc.python.script" />

Have a look to the difference and usecase for plugin- and script-typed add-ons.
My GitHub. My Add-ons:
Image
Reply
#5
sphere,

Thanks. I started working from the video plugin howto. So I used

Code:
extension point="xbmc.python.pluginsource"

in my addon.xml file.

Then I started getting the error dialog box that I mentioned in this thread. So then I went to the hello world example to see if I could get that working. I just modified the .py file based on the hello world example. So apparently I had a mixture of a script type add on and a video plugin add on.

Do you have any advice regarding developing an addon as far as what version of xbmc to use? Would you recommend developing the addon against a stable XBMC such as Frodo? Or is it reasonable to develop the addon against the version of XBMC I compiled myself (xbmc13-alpha11)? (My preference would be to use the version of XBMC I compiled but I would need to resolve the error dialog box problem)
Reply
#6
(2014-01-15, 17:35)rmcore Wrote: Do you have any advice regarding developing an addon as far as what version of xbmc to use? Would you recommend developing the addon against a stable XBMC such as Frodo? Or is it reasonable to develop the addon against the version of XBMC I compiled myself (xbmc13-alpha11)? (My preference would be to use the version of XBMC I compiled but I would need to resolve the error dialog box problem)

The difference between Frodo and Gotham is (python add-on related) minimal. Just use whatever you like Wink

If you plan to write a plugin, have a look to xbmcswift2 (See www.xbmcswift.com)...
My GitHub. My Add-ons:
Image
Reply
#7
sphere,

I noticed something using the xbmc log file. What I noticed is that there is an apparent bug in section two of this page :

http://wiki.xbmc.org/index.php?title=Aud...o_tutorial

The code as follows doesn't run.

li.setInfo(type='video')

Here is the error from the log.

TypeError: Required argument 'infoLabels' (pos 2) not found

I had to change the line as follows.

li.setInfo('video', {'Genre': 'TV'})

RE:xbmcswift

As I have never developed an addon, I am not sure the benefit of using xbmcswift. How does it make addon development faster?
Reply
#8
(2014-01-16, 17:20)rmcore Wrote: I noticed something using the xbmc log file. What I noticed is that there is an apparent bug in section two of this page :

http://wiki.xbmc.org/index.php?title=Aud...o_tutorial

The code as follows doesn't run.

li.setInfo(type='video')

Here is the error from the log.

TypeError: Required argument 'infoLabels' (pos 2) not found

I had to change the line as follows.

li.setInfo('video', {'Genre': 'TV'})

RE:xbmcswift
Yes, seems wrong to me, you need to pass a dict as second param to setInfo(). I'll fix that...
(2014-01-16, 17:20)rmcore Wrote: As I have never developed an addon, I am not sure the benefit of using xbmcswift. How does it make addon development faster?
The docs are better and you "dont repeat yourself" (also the API is much more "pythonic").
Of course its your choice - do whatever you like more.
My GitHub. My Add-ons:
Image
Reply
#9
sphere,

I am new to python scripting. I am checking out the xbmcswift2 library. It seems interetsing (+1 for the vimcast addon).

I am having a problem with the installation (http://www.xbmcswift.com/en/latest/insta...stallation)

Here is my problem:
Code:
adev@android-dev-precise64:~$ mkvirtualenv
mkvirtualenv: command not found

What provides the mkvirtualenv command? Is it a script that needs to be run from the python environment?
Reply
#10
virtualenv is similar to a sandbox for python libraries.
If you followed the installation you should have already installed it. But using virtualenv is not a requirement!

If you want to skip it, just do "sudo pip install xbmcswift2".
My GitHub. My Add-ons:
Image
Reply
#11
sphere,

OK....so I had a mistake during install. (I noticed the problem becuase find did not find virtualenv-wrapper)

Sorry about the previous post.

This is what happened when I tried to install virtualenv-wrapper

Code:
adev@android-dev-precise64:~$ sudo pip install virtualenv-wrapper
Downloading/unpacking virtualenv-wrapper
  Could not find any downloads that satisfy the requirement virtualenv-wrapper
No distributions at all found for virtualenv-wrapper
Storing complete log in /home/adev/.pip/pip.log

ETA:

Looks like the command I needed was

sudo pip install virtualenvwrapper
Reply
#12
(2014-01-16, 20:57)rmcore Wrote: No distributions at all found for virtualenv-wrapper

There is a typo in the official xbmcswift docs. The pip is named "virtualenvwrapper" (not "virtualenv-wrapper").
I will open a PullRequest to fix that typo...

But in general, I guess 30 sec googling would have told you the same...
I recommend reading a few general python related tutorials (python syntax, pip, virtualenv, virtualenvwrapper, ...)
My GitHub. My Add-ons:
Image
Reply

Logout Mark Read Team Forum Stats Members Help
Could not connect to network server0