Calling all DemoPad Users - Page 22 - AVS Forum | Home Theater Discussions And Reviews
Forum Jump: 
 20Likes
Reply
 
Thread Tools
post #631 of 663 Old 07-06-2019, 11:47 PM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
Quote:
Originally Posted by Peter M View Post
Thanks. I'm definitely going to need your help with this !

I already have EG talking to Demopad with commands from Demopad to EG, and feedback from EG to Demopad using the Broadcaster plugin.

The way I envisage it working is like this -

1. On my Demopad power page I have a macro called Power Status repeating every 2 secs.
2. In this macro I add a command to EG called Amp Status.
3. This triggers a macro in EG which sends the command \x24 to 192.168.0.56 port 17494, receives one byte back from the board, appends \x0D to it, sends it to Demopad using Broadcaster.
4. Demopad received the feedback from EG and deals with it in the normal manner.

(3) is the bit that I have no idea about ! Your script may well do this, but it would help enormously if you could explain each step.

Cheers,
I've also started a thread over at the EG forum, so it'll be interesting to see what they come up with.

Cheers,
Peter M is offline  
Sponsored Links
Advertisement
 
post #632 of 663 Old 07-07-2019, 02:32 PM - Thread Starter
Senior Member
 
Join Date: Jul 2017
Posts: 250
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 105 Post(s)
Liked: 18
Quote:
Originally Posted by Peter M View Post
I've also started a thread over at the EG forum, so it'll be interesting to see what they come up with.

Cheers,

So you have an understanding on EG, so I guess the first question do you know how to add a python script to a macro in EG? Add an action to the macro and expand the first tree titled EventGhost. should be second on the list, click to add. So now back in the macro double click on Python script and a box will open to write a Python script. I figured you know this but said it any ways just in case.


So the sample I gave you, every time that macro is executed, it runs that script. This is where its going to take a bit of trial and error. I used that format so get info from PEXX server, info for DirecTV boxes and KODI. So we hopefully be able to get some ting working for you. There is a print command in that script so if it works you should see the returned data in the left side of EG. Once you get that working you will have to parse it out and put it into a variable to send to DP.


This ends up being more of a Python question then and EG question, I noticed there forums have not been helpful. There are many vers of Python and not all work in EG.




So this line is the unknown, f = urllib.urlopen('http://192.168.1.137:32400/status/sessions?X-Plex-Token=xxxx.xxxx.xxx'). I can not help you with that for I dont have your device to try. I am hoping all you have to do is replace "http://192.168.1.137:32400/status/sessions?X-Plex-Token=xxxx.xxxx.xxx" with yours. Do you have a command that you can use in a web browser and see returned data from the switch in the browser? Till you do take out the line
"eg.plugins.BroadcastListener.Broadcast(u'Demo Pad'+feedback+'', u'', 33339)" or just put a # in front of the line so the script doesn't run that line. keep trying till you see feedback on the left in EG.

Last edited by mpg7321; 07-07-2019 at 02:52 PM.
mpg7321 is offline  
post #633 of 663 Old 07-08-2019, 04:33 AM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
Quote:
Originally Posted by mpg7321 View Post
I am hoping all you have to do is replace "http://192.168.1.137:32400/status/sessions?X-Plex-Token=xxxx.xxxx.xxx" with yours. Do you have a command that you can use in a web browser and see returned data from the switch in the browser? Till you do take out the line "eg.plugins.BroadcastListener.Broadcast(u'Demo Pad'+feedback+'', u'', 33339)" or just put a # in front of the line so the script doesn't run that line. keep trying till you see feedback on the left in EG.
Thanks.

I've got the script copied in but have no idea what to put after "http://192.168.0.56:17494".

The board has a browser interface and I've captured that with Wireshark.

This is from the browser to the board -

GET /status.xml HTTP/1.1
Host: 192.168.0.56
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.0.56/
Connection: keep-alive

This is the feedback -

HTTP/1.1 200 OK
Connection: close
Content-Type: text/xml
Cache-Control: no-cache

<response>
<relay0>1</relay0>
<relay1>1</relay1>
<relay2>1</relay2>
<relay3>0</relay3>
<relay4>0</relay4>
<relay5>0</relay5>
<relay6>1</relay6>
<relay7>0</relay7>
<volts>12</volts>
</response>

So I tried this command -

GET /status.xml HTTP/1.1\x0D\x0AHost: 192.168.0.56\x0D\x0AAccept: */*\x0D\x0AAccept-Language: en-US,en;q=0.5\x0D\x0AAccept-Encoding: gzip, deflate\x0D\x0AReferer: http://192.168.0.56/\x0D\x0AConnection: keep-alive\x0D\x0A

but it turned off all the relays. I had no idea what was wrong or what to try next which is why I turned to EG.

Cheers,
Peter M is offline  
Sponsored Links
Advertisement
 
post #634 of 663 Old 07-08-2019, 08:31 AM - Thread Starter
Senior Member
 
Join Date: Jul 2017
Posts: 250
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 105 Post(s)
Liked: 18
Quote:
Originally Posted by Peter M View Post
Thanks.

I've got the script copied in but have no idea what to put after "http://192.168.0.56:17494".

The board has a browser interface and I've captured that with Wireshark.

This is from the browser to the board -

GET /status.xml HTTP/1.1
Host: 192.168.0.56
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.0.56/
Connection: keep-alive

This is the feedback -

HTTP/1.1 200 OK
Connection: close
Content-Type: text/xml
Cache-Control: no-cache

<response>
<relay0>1</relay0>
<relay1>1</relay1>
<relay2>1</relay2>
<relay3>0</relay3>
<relay4>0</relay4>
<relay5>0</relay5>
<relay6>1</relay6>
<relay7>0</relay7>
<volts>12</volts>
</response>

So I tried this command -

GET /status.xml HTTP/1.1\x0D\x0AHost: 192.168.0.56\x0D\x0AAccept: */*\x0D\x0AAccept-Language: en-US,en;q=0.5\x0D\x0AAccept-Encoding: gzip, deflate\x0D\x0AReferer: http://192.168.0.56/\x0D\x0AConnection: keep-alive\x0D\x0A

but it turned off all the relays. I had no idea what was wrong or what to try next which is why I turned to EG.

Cheers,

When in the browser, do you have to enter info on a page, click on a button in order to retrieve the feedback or any thing like that? Also when it does display the feedback, does the web address change in the browser address bar? Whats the make and model again of the board?


Here's the hard part with script, there is a possibility you may need to use, we just don't know. I would try and play around in the browser and see if you can find an IP command that you can just put into the address bar and get the feedback.
urllib2.urlopen vs urllib.urlopen.

Last edited by mpg7321; 07-08-2019 at 08:35 AM.
mpg7321 is offline  
post #635 of 663 Old 07-08-2019, 03:22 PM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
The browser interface looks like this -



Click on the buttons to turn the relays on/off. The feedback is used to change the colour of the buttons. The address bar doesn't change.

This is the board - DFRobot

Cheers,
Attached Thumbnails
Click image for larger version

Name:	relay 1.jpg
Views:	31
Size:	141.4 KB
ID:	2588830  

Last edited by Peter M; 07-08-2019 at 05:17 PM.
Peter M is offline  
post #636 of 663 Old 07-08-2019, 07:32 PM - Thread Starter
Senior Member
 
Join Date: Jul 2017
Posts: 250
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 105 Post(s)
Liked: 18
Quote:
Originally Posted by Peter M View Post
The browser interface looks like this -



Click on the buttons to turn the relays on/off. The feedback is used to change the colour of the buttons. The address bar doesn't change.

This is the board - DFRobot


Cheers,

So found this, I'm sure you seen this


https://www.robot-electronics.co.uk/htm/eth008tech.htm
Another example would be to set output 1 inactive for 10 seconds:
192.168.0.200/io.cgi?DOI1=10


change the IP to yours and try putting that into the script and run the macro, see if that works and see if you get a response that shows in EG

f = urllib.urlopen('http://192.168.0.200/io.cgi?DOI1=10')

Last edited by mpg7321; 07-08-2019 at 07:59 PM.
mpg7321 is offline  
post #637 of 663 Old 07-09-2019, 05:21 AM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
OK that worked and this is the response -

Success! 1

Cheers,
Peter M is offline  
post #638 of 663 Old 07-09-2019, 05:40 AM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
This is the python code that they have available from the board product page -

from network_socket import NetworkSocket

eth008 = NetworkSocket()

#These will be the relays

def connect(ip, port, password):
return eth008.connect_socket(ip, port, password)

def disconnect():
eth008.close_socket()

def digital_command(command):

parts = command.split(" ") # Seperate the parts of the command
message = None

if parts[1] == "on": # Are we turning the io on or off
message = '\x20'
else:
message = '\x21'

message += chr(int(parts[0])) # Which io is it

message += '\x00' # 0 pulse time

eth008.write(message) # send command and read back responce byte
eth008.read(1)

def get_states():
command = '\x24'
eth008.write(command) # send command and read back responce byte
states = eth008.read(1)

print 'Relay states 8->1 : ' + ''.join('{0:08b}'.format(ord(x), 'b') for x in states)


Does that help with figuring out how to get the status feedback ?

Cheers,
Peter M is offline  
post #639 of 663 Old 07-09-2019, 07:40 AM - Thread Starter
Senior Member
 
Join Date: Jul 2017
Posts: 250
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 105 Post(s)
Liked: 18
Quote:
Originally Posted by Peter M View Post
This is the python code that they have available from the board product page -

from network_socket import NetworkSocket

eth008 = NetworkSocket()

#These will be the relays

def connect(ip, port, password):
return eth008.connect_socket(ip, port, password)

def disconnect():
eth008.close_socket()

def digital_command(command):

parts = command.split(" ") # Seperate the parts of the command
message = None

if parts[1] == "on": # Are we turning the io on or off
message = '\x20'
else:
message = '\x21'

message += chr(int(parts[0])) # Which io is it

message += '\x00' # 0 pulse time

eth008.write(message) # send command and read back responce byte
eth008.read(1)

def get_states():
command = '\x24'
eth008.write(command) # send command and read back responce byte
states = eth008.read(1)

print 'Relay states 8->1 : ' + ''.join('{0:08b}'.format(ord(x), 'b') for x in states)


Does that help with figuring out how to get the status feedback ?

Cheers,

Not yet, what they are doing is opening a socket so data just updates with out being asked for info. EG may or may not be able to do that. I have limited experience with that. So still looking for an IP command to retrieve status. But try this and see if it works.


f = urllib.urlopen('http://192.168.0.200/io.cgi?DOI1') That shout make relay one inactive
f = urllib.urlopen('http://192.168.0.200/io.cgi?DOA1') That should make relay one active


See if that works
mpg7321 is offline  
post #640 of 663 Old 07-09-2019, 03:25 PM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
As expected -

f = urllib.urlopen('http://192.168.0.200/io.cgi?DOI1') returns 'Success! 0'

f = urllib.urlopen('http://192.168.0.200/io.cgi?DOA1') returns 'Success! 1'

Unfortunately I don't think any of the relay control commands will return the full board status.

That's why this bit of their python script has me interested -


def get_states():
command = '\x24'
eth008.write(command) # send command and read back responce byte
states = eth008.read(1)

print 'Relay states 8->1 : ' + ''.join('{0:08b}'.format(ord(x), 'b') for x in states)


\x24 is the TCP/IP command to get status.

Cheers,
Peter M is offline  
post #641 of 663 Old 07-09-2019, 07:57 PM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
A bit of searching on sockets has lead me to this sample code -


import socket

HOST = '127.0.0.1' # The server's hostname or IP address
PORT = 65432 # The port used by the server

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
s.sendall(b'Hello, world')
data = s.recv(1024)

print('Received', repr(data))


Do you think a variation on this is worth trying ?

Cheers,
Peter M is offline  
post #642 of 663 Old 07-09-2019, 08:39 PM - Thread Starter
Senior Member
 
Join Date: Jul 2017
Posts: 250
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 105 Post(s)
Liked: 18
Quote:
Originally Posted by Peter M View Post
A bit of searching on sockets has lead me to this sample code -


import socket

HOST = '127.0.0.1' # The server's hostname or IP address
PORT = 65432 # The port used by the server

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
s.sendall(b'Hello, world')
data = s.recv(1024)

print('Received', repr(data))


Do you think a variation on this is worth trying ?

Cheers,
Did you try it? Did it work?


So with out having a board here its hard for me to try things out. I know enough to be dangerous but not an expert at scripting.



So one way you could do this is to use Global Variables in EG. You would let EG do every thing. When you want to turn on a relay, send a command from DemoPad to EG and have it turn on the relay. Then set a Global Variable in EG and then have EG send the feedback to DemoPad when called. You could even go as far as having EG write to a spreadsheet every time you turn on or off a relay. Then read from the spreadsheet to get the status. That way data would be saved upon EG being restarted. If some thing got out of sync, worst case is you would set all relays to off, update EG.
mpg7321 is offline  
post #643 of 663 Old 07-09-2019, 09:12 PM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
Quote:
Originally Posted by mpg7321 View Post
Did you try it? Did it work?
Not yet. It'll be a couple of days before I have time.

Quote:
So without having a board here its hard for me to try things out. I know enough to be dangerous but not an expert at scripting.
I've been reading up on python and learned a lot. At least I can now understand what the scripts are doing.

Quote:
So one way you could do this is to use Global Variables in EG. You would let EG do every thing. When you want to turn on a relay, send a command from DemoPad to EG and have it turn on the relay. Then set a Global Variable in EG and then have EG send the feedback to DemoPad when called. You could even go as far as having EG write to a spreadsheet every time you turn on or off a relay. Then read from the spreadsheet to get the status. That way data would be saved upon EG being restarted. If some thing got out of sync, worst case is you would set all relays to off, update EG.
If I can't get the feedback to work, I'll probably stick with what I've got now ... just tracking on/off commands in Demopad.

Cheers,
Peter M is offline  
post #644 of 663 Old 07-09-2019, 09:20 PM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
I also found this -


>>> from bitstring import BitArray
>>> input_str = '0xff'
>>> c = BitArray(hex=input_str)
>>> c.bin
'0b11111111'


So if I can get the byte back from the board, this will allow me to convert to binary before passing to Demopad. The feedback in Demopad will then be really simple.

Cheers,
Peter M is offline  
post #645 of 663 Old 07-10-2019, 07:56 AM - Thread Starter
Senior Member
 
Join Date: Jul 2017
Posts: 250
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 105 Post(s)
Liked: 18
Quote:
Originally Posted by Peter M View Post
I also found this -


>>> from bitstring import BitArray
>>> input_str = '0xff'
>>> c = BitArray(hex=input_str)
>>> c.bin
'0b11111111'


So if I can get the byte back from the board, this will allow me to convert to binary before passing to Demopad. The feedback in Demopad will then be really simple.

Cheers,
So each "1" represent each relay and as of then they where all on? I amuse it would be 1 or 0. That's great just have to parse it out and use a few "IF Statements" and send it out to DemoPad
mpg7321 is offline  
post #646 of 663 Old 07-10-2019, 11:00 PM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
That's just sample code I found ... not feedback from my board.

But yes, once the returned byte is converted to binary, each digit represents that state of one relay ... 1 for ON, 0 for OFF.

I'm going to try this code later tonight -


import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.0.56', 17494)) # connect to board
f = ‘empty’ # initialise feedback
try:
....s.sendall(b'\x20\x01\x00') # turn on relay 1
....f = s.recv(1024) # get feedback
except:
....pass #ignore all exceptions
finally:
....s.close() #disconnect from board
....print 'feedback = ', repr(f)


If I can turn the relays on/off with TCP/IP commands through a socket connection, then getting the feedback should be easy.

Reading about sockets it has become obvious that they are used for most TCP/IP communications, and it wouldn't surprise me if Demopad's app uses this to send signals to IP controlled devices.

Cheers,
Peter M is offline  
post #647 of 663 Old 07-11-2019, 03:16 AM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
I'm very pleased to report that all these work -


import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.0.56', 17494)) # connect to board
f = 'empty' # initialise feedback
try:
....s.sendall(b'\x20\x01\x00') # turn on relay 1
....f = s.recv(1024) # get feedback
except:
....pass #ignore all exceptions
finally:
....s.close() #disconnect from board
....print 'feedback = ', repr(f)


import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.0.56', 17494)) # connect to board
f = 'empty' # initialise feedback
try:
....s.sendall(b'\x21\x01\x00') # turn off relay 1
....f = s.recv(1024) # get feedback
except:
....pass #ignore all exceptions
finally:
....s.close() #disconnect from board
....print 'feedback = ', repr(f)


import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.0.56', 17494)) # connect to board
f = 'empty' # initialise feedback
try:
....s.sendall(b'\x24') # request status
....f = s.recv(1024) # get feedback
except:
....pass #ignore all exceptions
finally:
....s.close() #disconnect from board
....print 'feedback = ', repr(f)




The status request is returning one byte, exactly as it should, and the binary of the byte is a match for the relays that are on.

I tested with relays 1, 2, 3, and 7 ON and the feedback was 'G' which is 01000111 in binary.

So I now have to figure out the easiest way to convert the byte to binary in python and then broadcast it out to Demopad.

Cheers,

Last edited by Peter M; 07-11-2019 at 03:24 AM.
Peter M is offline  
post #648 of 663 Old 07-11-2019, 05:19 AM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
Done !!

Final code -

Code:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.0.56', 17494)) # connect to board
try:
    s.sendall(b'\x24') # request status
    f = s.recv(1024) # get feedback
except:
    pass # ignore all exceptions
finally:
    s.close() # disconnect from board
    fbin = ' '.join('{0:08b}'.format(ord(x), 'b') for x in f) # convert to binary
    eg.plugins.BroadcastListener.Broadcast('Status '+fbin, u'', 33339) # broadcast to demopad
Demopad bit was easy and feedback is showing correctly.

Cheers,
Peter M is offline  
post #649 of 663 Old 07-11-2019, 05:25 AM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
Quote:
Originally Posted by mpg7321 View Post

import urllib
try:
....f = urllib.urlopen('http://192.168.1.137:32400/status/sessions?X-Plex-Token=xxxx.xxxx.xxx')
....feedback = f.read()
....print feedback
....eg.plugins.BroadcastListener.Broadcast(u'DemoP ad'+feedback+'', u'', 33339)
except Exception:
....pass
Thanks very, very much for getting me started on this. I would never have attempted python in EG without your help !!

Cheers,
Peter M is offline  
post #650 of 663 Old 07-11-2019, 05:27 AM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
Now we need to see what else we can do with TCP/IP through sockets from EG ???

Cheers,
Peter M is offline  
post #651 of 663 Old 07-11-2019, 07:49 AM - Thread Starter
Senior Member
 
Join Date: Jul 2017
Posts: 250
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 105 Post(s)
Liked: 18
Quote:
Originally Posted by Peter M View Post
Now we need to see what else we can do with TCP/IP through sockets from EG ???

Cheers,



The song "Its a whole new world" comes to mind. LOL you can do a lot of home authentication EG. Like I could use Python to solve the feedback issue with my receiver if I really wanted too. If you are sending a lot of commands from DemoPad to EG look into using "Payloads".
mpg7321 is offline  
post #652 of 663 Old 07-11-2019, 06:13 PM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
Quote:
Originally Posted by mpg7321 View Post
Like I could use Python to solve the feedback issue with my receiver if I really wanted too.
Do it !!
Peter M is offline  
post #653 of 663 Old 07-13-2019, 05:12 PM
Member
 
rockydj's Avatar
 
Join Date: Dec 2005
Location: Down Under
Posts: 64
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 11 Post(s)
Liked: 14
Is there way to repeat a set of command every one minute. In Irule we could do this in the entrance and repeat it
rockydj is offline  
post #654 of 663 Old 07-13-2019, 08:00 PM - Thread Starter
Senior Member
 
Join Date: Jul 2017
Posts: 250
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 105 Post(s)
Liked: 18
Quote:
Originally Posted by rockydj View Post
Is there way to repeat a set of command every one minute. In Irule we could do this in the entrance and repeat it

There are more then one way to do this. The easiest way would be to click on the page you want the command to repeat every 60 seconds. Then in the Actions Tab across the top of the page there is orangish red box that labeled "Edit". Then click on "Edit Page Load Action". Then add your command with a set repeat time to 60. You would have to do this on every page you want it to run. You could also do it with a "Edit Statup Action", so when you launch the app it would start, but what you would have to do this by setting a number that would start a loop.
mpg7321 is offline  
post #655 of 663 Old 07-13-2019, 08:41 PM
Member
 
rockydj's Avatar
 
Join Date: Dec 2005
Location: Down Under
Posts: 64
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 11 Post(s)
Liked: 14
Thanks @mpg7321 .
rockydj is offline  
post #656 of 663 Old 07-13-2019, 09:57 PM
Member
 
rockydj's Avatar
 
Join Date: Dec 2005
Location: Down Under
Posts: 64
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 11 Post(s)
Liked: 14
I am trying to setup 2 way feedback for Kodi/XBMC



I have tested play/pause which works and I can see XBMC return the status in Hercules. Demopad is not sending the JSON query {"jsonrpc": "2.0", "method": "Player.GetProperties", "params": { "playerid": 1, "properties": ["totaltime"] }, "id": 1}



I have tested the query in Hercules which returns the result of the query {"id":1,"jsonrpc":"2.0","result":{"totaltime":{"ho urs":1,"milliseconds":147,"minutes":38,"seconds":3 9}}}


can't seem to figure out why Demopad is not sending the JSON query for feedback
rockydj is offline  
post #657 of 663 Old 07-14-2019, 12:12 AM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
How did you conclude that Demopad is not sending the query ?

Cheers,
Peter M is offline  
post #658 of 663 Old 07-14-2019, 12:42 AM
AVS Forum Special Member
 
Peter M's Avatar
 
Join Date: Sep 2000
Location: Sydney
Posts: 2,059
Mentioned: 13 Post(s)
Tagged: 1 Thread(s)
Quoted: 379 Post(s)
Liked: 303
I've been asked via PM how I integrate and use EventGhost so thought I'd detail it here, as Demopad and EG go really well together.

First up, many thanks to @mpg7321 who got me started with EG.

I'm running EG on an Intel NUC which is part of my theatre system and is used for ripping discs, running JRiver, programming Demopad and various other network admin tasks.

Here's the EG device in Demopad -



The IP address starts with the first three numbers of my network 192.168.0 and ends with 255 which is used for the UDP broadcast - and you'll see that UDP is ticked.

I don't recall why port number 33339 is used, but you can see it here in the EG Broadcaster plugin properties screen -



The IP address 192.168.0.184 is the NUC that runs EG.

Here are the commands for EG in Demopad -



I think they are fairly self explanatory.

Here are the feedbacks -



This is my Configuration in EG -



Each of the gear wheels represents a macro. The lightning bolts show the commands coming in from Demopad that trigger the macros.

That's about it ... pretty straight forward once you get started. Of course my use of EG is VERY basic, but hopefully this will help people to dive in.

Cheers,
Attached Thumbnails
Click image for larger version

Name:	eg 01.jpg
Views:	21
Size:	120.9 KB
ID:	2590548   Click image for larger version

Name:	eg 02.jpg
Views:	20
Size:	114.0 KB
ID:	2590550   Click image for larger version

Name:	eg 03.jpg
Views:	19
Size:	155.7 KB
ID:	2590552   Click image for larger version

Name:	eg 04.jpg
Views:	22
Size:	71.4 KB
ID:	2590554   Click image for larger version

Name:	eg 05.jpg
Views:	21
Size:	253.7 KB
ID:	2590556  

Peter M is offline  
post #659 of 663 Old 07-14-2019, 12:30 PM - Thread Starter
Senior Member
 
Join Date: Jul 2017
Posts: 250
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 105 Post(s)
Liked: 18
Quote:
Originally Posted by Peter M View Post
I've been asked via PM how I integrate and use EventGhost so thought I'd detail it here, as Demopad and EG go really well together.

First up, many thanks to @mpg7321 who got me started with EG.

I'm running EG on an Intel NUC which is part of my theatre system and is used for ripping discs, running JRiver, programming Demopad and various other network admin tasks.

Here's the EG device in Demopad -



The IP address starts with the first three numbers of my network 192.168.0 and ends with 255 which is used for the UDP broadcast - and you'll see that UDP is ticked.

I don't recall why port number 33339 is used, but you can see it here in the EG Broadcaster plugin properties screen -



The IP address 192.168.0.184 is the NUC that runs EG.

Here are the commands for EG in Demopad -



I think they are fairly self explanatory.

Here are the feedbacks -



This is my Configuration in EG -



Each of the gear wheels represents a macro. The lightning bolts show the commands coming in from Demopad that trigger the macros.

That's about it ... pretty straight forward once you get started. Of course my use of EG is VERY basic, but hopefully this will help people to dive in.

Cheers,
What are you doing with the two Explorer.exe in EG startup?
mpg7321 is offline  
post #660 of 663 Old 07-14-2019, 01:04 PM - Thread Starter
Senior Member
 
Join Date: Jul 2017
Posts: 250
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 105 Post(s)
Liked: 18
Here are some sample script to control Global Cache IR and RS232
Attached Thumbnails
Click image for larger version

Name:	GC IR.png
Views:	10
Size:	37.3 KB
ID:	2590700   Click image for larger version

Name:	GC RS232.png
Views:	9
Size:	30.3 KB
ID:	2590702  
mpg7321 is offline  
Sponsored Links
Advertisement
 
Reply Remote Control Area

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off