Author Topic: TCP Plugin  (Read 33737 times)

0 Members and 1 Guest are viewing this topic.

OklahomaGreyBeard

  • Contributor
  • ***
  • Posts: 54
  • Karma: 3
    • View Profile
Re: TCP Plugin
« Reply #90 on: June 18, 2015, 11:39:17 AM »
I currently have openhab sending a message via http to eventghost whenever my front door opens then use the broadcaster plugin to send an event to VC.......

I'd like to eliminate that middle man. Unless there is a better way to communicate between openhab and VC I'm assuming using the http api would be easiest. What is the correct format to trigger an incoming event via the API?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TCP Plugin
« Reply #91 on: June 18, 2015, 11:54:36 AM »
Did you look in the wiki for information on the API?

Actually UDP is easier if that is an option for you.

UDP, TCP, HTTP, Commandline...

All are pretty easy.  They all use the same format for messages.

werethless12

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: TCP Plugin
« Reply #92 on: September 26, 2015, 05:46:48 AM »
I am running 2.2.0.7 of VC as soon I enabled the TCP Plugin with no problem when I installed, I then restarted VC and now whenever I enable the plugin I get this error. http://pastebin.com/hww0Mmq5 Anyone know of a fix or if its fixable?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TCP Plugin
« Reply #93 on: September 26, 2015, 08:29:46 AM »
Try rebooting.

If that doesn't help please post a VoxCommando log.

werethless12

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: TCP Plugin
« Reply #94 on: September 26, 2015, 06:06:14 PM »
I've rebooted multiple times since this first happened, here is the full VC log. http://pastebin.com/8CBi8FEn Seems like there is an error with the webserver.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TCP Plugin
« Reply #95 on: September 27, 2015, 09:17:34 AM »
The relevant error seems to be the following:
Quote
An attempt was made to access a socket in a way forbidden by its access permissions

Based on this, my guess is that you are having problems starting up the web server and that there is something wrong either with your system or with your setup.  Ideally the TCP plugin should handle this error more gracefully.  While it may not be able to start the simple web server, it should still be able to handle the exception and load the plugin, so I will have a look at that.

There are a few reasons I can think of why you would get this error.  I will start with the most likely causes / fixes and work my way down.

#1 - Firewall or antivirus is blocking you.  More likely the firewall.  Normally you are asked to create a firewall exception when you start VoxCommando, but to be sure you can temporarily disable your firewall to see if it is a factor.  Antivirus... I'm not sure if this is as likely, but you might as well disable it too to test.

#2 - The port specified for the web server is already being used by a program or service on your system.  Try changing to a different port.  The plugin won't load due to the error which means you can't access the plugin settings at the moment.  To resolve this you can either delete file "Options.xml" in the plugin\TCP folder and then restart voxCommando.  This will reset the settings and then you can use the UI to adjust the plugin settings.  Or you can edit this file by hand and change the line that reads: <Option name="webServerPort" value="8095" />

The reason #2 is not at the top of the list is because I would expect a slightly different error message in the case of a port that is already being used, but you never know.

#3 - Less likely, but easy enough to check.  Normally you should not need any special permissions to open a socket, but you can try to disable UAC and/or run VC as administrator to see if it makes a difference.

#4 - You've got some other corruption in your system dlls.  I think this is quite unlikely but again, with computers you never know.

#5 - You only have .Net 4.6 installed and it is not 100% backwards compatible.  You could try to install .Net 4.1 and/or .Net 3.5 but again this is quite unlikely.

I would start with #2 and just set the port to something you are sure is not being used, then try #1.

Good luck.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TCP Plugin
« Reply #96 on: September 27, 2015, 09:27:35 AM »
Update: I just tried a test where I set the TCP simple web server port to 80 and I immediately got the exact same error so I suggest you try another port and that will most likely solve your problem.

werethless12

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: TCP Plugin
« Reply #97 on: September 27, 2015, 03:37:08 PM »
Deleting the Options.xml worked! Thanks a lot! Although I figured out how to control VC with Tasker using UDP.

fishware

  • Jr. Member
  • **
  • Posts: 44
  • Karma: 1
    • View Profile
Re: TCP Plugin
« Reply #98 on: November 02, 2015, 08:38:45 AM »
To give you a start point with the TCPwebserver, test following:

Start the webserver in the TCP plugin then type in a webbrowser: localhostIP/api/OSD.showText&hello

if everthing works VC show you a OSD window with "hello"
Hello Kalle

Is it possible that the "adress" must be
Quote
localhostIP/api/OSD.showText&&hello
Than the event is happend
I'm using VC 2.2.0.7

greetings fishware

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TCP Plugin
« Reply #99 on: November 02, 2015, 11:16:13 AM »
Yes, that was probably just a typo, and the post is also from several years ago.

Hopefully most users will consult the official documentation on the wiki when forum post suggestions don't work as expected.

The wiki specifies that two ampersands (&&) are required between parameters:

http://voxcommando.com/mediawiki/index.php?title=API_Application_Programming_Interface#TCP
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: TCP Plugin
« Reply #100 on: November 02, 2015, 02:28:14 PM »
Sorry for the confusion - I have now corrected the old posting  :bonk
***********  get excited and make things  **********