Author |
|
insysnet Newbie
Joined: May 09 2006 Location: United Kingdom
Online Status: Offline Posts: 18
|
Posted: May 16 2006 at 05:03 | IP Logged
|
|
|
I would like to post an instant message from my PowerHome server computer to another computer on the network/internet.
The scenario is:
Front door sensor detects motion
Trigger linked to X10 In signal sends instant message "Front door motion detected"
Email is not really "instant" enough, so I was hoping for a solution using an instant messenger solution or something similiar.
I thought Instant Messenger might be the best solution as this would enable messages to be received even when I'm away from home.
Maybe there's a better way of doing this?
__________________ Richard
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: May 16 2006 at 07:13 | IP Logged
|
|
|
I use email to send text messages to my mobile phone; I usually receive the message within a few seconds. YMMV
Maybe you could do it with sendkeys to the IM app?
|
Back to Top |
|
|
insysnet Newbie
Joined: May 09 2006 Location: United Kingdom
Online Status: Offline Posts: 18
|
Posted: May 16 2006 at 10:10 | IP Logged
|
|
|
Thanks - Unfortunately, my email isn't quite as quick.
I had a look at the sendkeys option - the downside is that if I'm not logged into the IM client remotely (i.e. Status=Offline) the sendkeys would get very messy.
I'll take a look at the IM sendkeys option again and see if I can get it to work - I was hoping for something a little cleaner if possible.
One temporary solution I've found which works when I'm at home on the network is to use the "TOWINPOP.EXE" utility to send a Windows Message to my computer from the PowerHome machine.
I needed to enable and set to automatic startup the Windows Messenging service (not the same as Windows Messenger) on remote Windows XP machine as it's disabled by default under Windows XP Service Pack 1/2.
But using the ph_run function I was able to run the towinpop.exe with the necessary parameters and a dialog box instantly appears on my remote computer.
Just want to try and find a way to do a similar thing over the wider internet - seems IM may still be the way to go for that.
__________________ Richard
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: May 16 2006 at 12:47 | IP Logged
|
|
|
Oh! I use yac for remote pop-up's; I'll have to check out towinpop... I Googled it and only came up with one site that had it, and the author's site did not mention it.
Remember that PH can communicate via Windows Messaging directly.
Also, look at PowerHome Socket Server Command Line Controller 1.00.1 (PHSSCmd_Setup.exe) and PowerHome Distributed Control Client version 1.00.0 (DCC1000Full.exe) on the Downloads page.
|
Back to Top |
|
|
insysnet Newbie
Joined: May 09 2006 Location: United Kingdom
Online Status: Offline Posts: 18
|
Posted: May 16 2006 at 13:05 | IP Logged
|
|
|
TOWINPOP is a really old utility I've had in my toolkit for a few years now - I've put a copy at http://www.insysnet.com/homeauto/towinpop.exe
You can run it from the command-line, or if you run it without any parameters you get a helpful windows explaining useage, etc.
I think I probably confused matters by saying "Windows Messaging" in my post. The actual service I'm using with TOWINPOP is the "Messenger" service that transmits net send and Alerter service messages from one computer to another.
I think the Windows Messaging support in PH is for sending Messages to Application Windows within the Windows OS on the same PC. I believe you can use Windows Messaging to post events like WM_CLOSE to a given Windows handle to get an application to close gracefully. I've found it works better than SendKeys, especially in dialog boxes as you can use the WinSpy utility to get the Window handle of a textbox and post text directly to the textbox without having to tab, or otherwise navigate to it using SendKeys - that is until the next release of the application changes the textbox!
Looks like YAC might be a nicer solution (as the Messenger service just throws up a boring old dialog box that you have to click "OK" on).
I'll download it and have an experiment - thanks for the tip!
__________________ Richard
|
Back to Top |
|
|
insysnet Newbie
Joined: May 09 2006 Location: United Kingdom
Online Status: Offline Posts: 18
|
Posted: May 16 2006 at 13:20 | IP Logged
|
|
|
Update on YAC... Unfortunately YAC requires W2K or greater to act as a server and my PowerHome system is running on Win 98.
Shame - I liked the look of the YAC popup messsages. Maybe I'll have to upgrade the system to W2K or XP?
It's a bit off topic, but what would you reccommend as the best OS to run PH on? I generally prefer Win XP or 2K - sticking with the NT codebase, rather than the old Win 9x environment.
In this instance, I chose Win 98 for two reasons (1) it was already installed (2) I was using ActiveHome before and it really didn't like Win XP (3) I was evaluating PH and thought I could drop back to ActiveHome easier if I kept the system on Win98 [Not that I'll be doing that now I've actually use PH - it's awesome by comparison!]
__________________ Richard
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: May 16 2006 at 13:33 | IP Logged
|
|
|
I would lean towards XP.
I also think that Dave was looking at some sort of pop-up app/feature.
|
Back to Top |
|
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: May 16 2006 at 18:40 | IP Logged
|
|
|
Hi Tony,
Will YAC server work without a modem installed?
I can check once I get home, but if you already know...
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: May 16 2006 at 19:04 | IP Logged
|
|
|
YAC is a network utility; the connection has to be in place.
|
Back to Top |
|
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: May 16 2006 at 19:08 | IP Logged
|
|
|
Is it "Yet Another Caller ID"?
I was trying to Google it.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: May 16 2006 at 19:14 | IP Logged
|
|
|
Yup!
YAC
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: May 17 2006 at 20:54 | IP Logged
|
|
|
I had never heard of YAC so I had to look it up as well. Appears to be mainly a way to trigger pop-up messages on a remote machine.
After reading the specs and such, I think you can use the YAC clients with PowerHome and don't even need to have the YAC server. Just use the ph_sendsocketdata function like below:
Code:
ph_sendsocketdata("192.168.0.100",10629,"The message you want to send" + space(300)) |
|
|
This should work for your situation Richard since the YAC clients will run on Windows 98.
Ive also made a note to enhance the ph_sendsocketdata function so that you can use escape sequences to send non-typable characters similar to the ph_comsendstring function.
Tony, you may be able to test this out and let me know if it works or not.
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: May 17 2006 at 21:32 | IP Logged
|
|
|
Well, that hangs up for a bit then crashes the target YAC. The PH formula result web page says, "*ERROR* - TIMEOUT WAITING FOR RETURN". Nothing in the log.
|
Back to Top |
|
|
insysnet Newbie
Joined: May 09 2006 Location: United Kingdom
Online Status: Offline Posts: 18
|
Posted: May 18 2006 at 07:02 | IP Logged
|
|
|
Great solution! That would be really neat if we can get it to work.
I tried ph_sendsocketdata("192.168.0.100",10629,"The message you want to send" + chr(0))
Got the same error message on PH "*ERROR* - TIMEOUT WAITING FOR RETURN", however the YAC listener doesn't crash and is does popup a message after about 30 secs delay - but it says
"A message for you... ([current time])" and in the main window "The message you want to send"
It seems like the Listener is getting the connection, but failing to process the stream the correctly.
Could it be something to do with character sets (i.e. does YAC require unicode or double-byte strings?) or does it need some kind of initialization bytes/header?
__________________ Richard
|
Back to Top |
|
|
insysnet Newbie
Joined: May 09 2006 Location: United Kingdom
Online Status: Offline Posts: 18
|
Posted: May 18 2006 at 07:15 | IP Logged
|
|
|
Interesting the following actually works...
ph_sendsocketdata("192.168.0.100",10629,"@CALLBush George W.~(212) 555-9384" + chr(0))
Although there is still a 10-20 second delay in the popup balloon appearing on the target system.
What also works (which is really weird) is...
ph_sendsocketdata("192.168.0.100",10629,"Bush George W.(212) 555-9384" + chr(0))
Is there something here that the message must contain "Bush George W." to get through - I've heard of being patriotic, but...
Maybe we need a localized version for the UK that allows through "Blair Tony" messages as well... no, hang on, that'd need changing again too soon in order to work
__________________ Richard
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: May 18 2006 at 15:17 | IP Logged
|
|
|
I am using the utility - Net Send <IP> <message> - with
ph_run to send specific data and use winpopup on other machines on my network, even if you have win98 installed you can download commandline utils like Net send....
The message is a message contained in a GV... works very well I might add
TonyNo:
it seems to me that either the data is sent to the wrong portnumber or the datastream is incompatible. perhaps if you add the portnumber to the IP-address... after all it is still TCP/IP based....
Peter
Edited by krommetje - May 18 2006 at 15:23
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: May 18 2006 at 15:46 | IP Logged
|
|
|
insysnet wrote:
Although there is still a 10-20 second delay in the popup balloon appearing on the target system.
|
|
|
I think you are dealing with the fact that the TCP/IP protocol has 3 different layers to go through and there are 20 protocols in the transportlayer. Every layer of the TCP/IP protocol adds/substracts its own bits into/out-of the TCP-datagram and all protocols check to see if there is something to do, also if there is no ARP record on your network this has considerable effect on speed..
Peter
Peter
Edited by krommetje - May 18 2006 at 15:52
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: May 18 2006 at 21:30 | IP Logged
|
|
|
Well I spent some time playing around with and found out a couple of things.
First, the char(0) is not being sent. Since the "data" parameter in the ph_socketsenddata function is a string, it's getting stripped off.
It would appear the the YAC client does not follow it's own rules which states that it will display the message after a char(0) is received or after 300 characters. That is why there is a delay. PowerHome sends the data, the YAC client is waiting for either a char(0) or an undetermined amount of characters. PowerHome eventually times out because YAC doesnt return anything and the socket connection is closed. YAC then displays what it's received.
Ive been able to get YAC to respond immediately by forcing a larger number of characters because we currently cant get the char(0) to be sent. The statement below worked great:
ph_sendsocketdata("192.168.0.100",10629,"The message you want to send" + space(3000))
Im sure the space(3000) can be smaller, but I didnt play with how small.
However, PowerHome still takes 20 seconds to time out because the YAC client doesnt follow HTTP conventions and close the socket connection.
Anyways, I played around a bit and there will be a new advanced ph_sendsocketdata function which will allow you to terminate on either a close socket or when sending data is complete (this is what is needed with YAC). It will also allow you to specify special characters such as char(0) and return data with special characters as well.
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: May 18 2006 at 23:34 | IP Logged
|
|
|
Still crashes the recipient's YAC (on the two systems that I tried).
|
Back to Top |
|
|
insysnet Newbie
Joined: May 09 2006 Location: United Kingdom
Online Status: Offline Posts: 18
|
Posted: May 19 2006 at 06:59 | IP Logged
|
|
|
Yes - I think the problem is definitely with YAC.
As a test, I've created a small VB app that listens on the YAC port (configurable) and processes incoming socket messages (including the YAC messages)
The app is designed for Win XP and uses the Windows Popup Balloon system to display the messages - which is ideal for my requirements.
It works perfectly with ph_sendsocketdata() - which I think tends to point at YAC being at fault.
If you want to give it a try you can download just the executable from www.insysnet.com/homeauto/BubbMess.zip
NOTE: You must have the Visual Basic 6.0 runtime SP6 to run this exe on it's own.
If you don't have to Visual Basic 6.0 runtime you can download a full installation from www.insysnet.com/homeauto/BubbleMess_Full_Install.zip
I'd still like to get something working using an IM client - mainly for the facility to use over the internet (when I'm outside my home firewall). But at least this works when I'm home.
The ph_sendsocketdata is very powerful - very nice feature - thanks for highlighting this!
__________________ Richard
|
Back to Top |
|
|