Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Need help with Network sender

If you have a question or need help, this is the place to be.
Post Reply
Sonopanic
Posts: 22
Joined: Mon Dec 08, 2008 8:30 am

Need help with Network sender

Post by Sonopanic »

Hello,

i start the plugin Network Event Sender.
The only command i have is "map".

No documentation, nothing. How can i use it ?
I need send a string over IP to a global cache box.

192.168.11.36 Port 4999

Data : 3,1,3,1 (no cr)

Thanks
kingtd
Plugin Developer
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Re: Need help with Network sender

Post by kingtd »

Check out my response to this same question, but on the thread for my network broadcaster. Basically the network sender uses the old "Girder" handshake, so you can't just send arbitrary data on the network directly with it. But you can write a quick python script to do it:

http://www.eventghost.org/forum/viewtop ... 272#p12272

~K
Sonopanic
Posts: 22
Joined: Mon Dec 08, 2008 8:30 am

Re: Need help with Network sender

Post by Sonopanic »

Thank you, but my testscipt do not work.

python script :

import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.11.36", 4999)) # Specify the target device and port number
print s.recv(1024) # Writes anything it tells you when it first connects to the log for troubleshooting. If there's no initial connect string, you can probably remove this line

s.send("1,1,0,0\n")
s.send("3,1,1,3\n") # You could also do eg.event.payload[0] and pass commands to this script from other events.
print s.recv(1024) # Writes anything it tells you after your command is sent to the log for troubleshooting
s.close()

In the log appear a python script, but after that, eg hung up.
No command are send to the globalcache.

The data, i want to send are four bytes. Is the string with the commas correct ?
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Need help with Network sender

Post by jinxdone »

You should write it as "\x03\x01\x03\x01" if you want to send literal bytes. Check python docs about string literals for reference http://docs.python.org/reference/lexica ... g-literals
Sonopanic
Posts: 22
Joined: Mon Dec 08, 2008 8:30 am

Re: Need help with Network sender

Post by Sonopanic »

it works !

import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
HOST = '192.168.11.36'
PORT = 4999
s.connect((HOST, PORT)) # the Host in " " works too.
s.send('\x08\x01\x01\x08') # in my case, no LF or CR needed
s.close()
Post Reply