Re: [twsocket] PCSensor "server"/ Simple client-server-SOLVED!

2011-09-23 Thread TK Boyd
Hurrah! Thank you everyone!

The ICS demo "CliDemo1" did the job for me!! But I never would have 
got all the parts of the puzzle assembled without your help... There 
was a lot more to get right than just deciding which demo had the 
right elements.

Now I can move forward with helping some good engineers working hard 
in a second language to get their product understood by a wider 
audience... thanks to you!

(I still have lots to learn in this area, so, despite immediate wants 
("needs") having been met, if you still have comments on ignorance 
revealed in earlier posts, don't hesitate to put me straight.)

Regards,

Tom

http://facebook.com/SheepdogSoftware  TK Boyd's site with
freeware and shareware for kids, parents, schools... and others.
You don't have to be a Facebook member to access the site.

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-23 Thread Wilfried Mestdagh
Hi,

> Would the demo "Client5: A basic client program using TWSocket
> component." seem to you who know like an alternative good starting
> point for my efforts?

The good starting point is: do not copy! - Study example; then start from
nothing - zero - null !

-- 
mvg, Wilfried
http://www.mestdagh.biz
http://www.comfortsoftware.be
http://www.expertsoftware.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-23 Thread TK Boyd
Angus, Wilfried...

Many thanks!

> You need to develop a simple TCP client program using TWSocket...

Thank you for pointing me at the right demo to work from Oh! And 
in looking around for that, I found the link "Click here for a primer 
text about TCP..." Apologies, everyone, for not seeing that before 
now.

Would the demo "Client5: A basic client program using TWSocket 
component." seem to you who know like an alternative good starting 
point for my efforts?

> Using HTTP components is totally wrong.  

Thank you... It is a relief to learn I don't need to fight that 
particular fight at this stage. What a newbie does NOT need to worry 
about is almost as helpful as what IS needed!

> Your box is almost certainly both a web server and a telnet 
server...

Because that's how most things are made? This is a wonder out of 
China, remember.

Not to argue with the experts, but just some of the tests I did that 
made me think, hmm... maybe not "the usual" here...

Pointed my browser at 192.168.0.241:5200... got "can't connect... and 
yet SmartSniff sees communication to and from there... across two 
sockets, if I use the mfg's software... which "works"... it just 
doesn't do the things I want to!

ping 192.168.0.241 gets replies
ping 192.168.0.241 5200 says "could not find host on..."

Telnet...

I can get into Telnet, but

o 192.168.0.241 5200 fails, as does
o 192.168.0.241

The first hangs the DOS window, the latter comes back promptly with 
"Could not open connection..."

(I set the IP address, and got the config data with the mfg's 
software.)

> Telnet simply means lines of data to and from the server, and is 
the basis of HTTP, FTP, SMTP and the rest.  Those protocols simply 
use a different port to 'telnet' but the same textual interaction.  

Helpful, thank you... I stuggle... but I learn!

> If, using a telnet client, you don't get an open connection on port 
> 5200, there is a deeper problem.  

When I described my Telnet experiences, I was talking about using the 
bog standard DOS "telnet" command, inside a Windows "command", or 
"DOS" window.

"Deeper problem"... happily, the device DOES seem to "work" 
consistently under the mfg's software...


I'll go away and study the latest advice, and dig into some stuff 
someone else has kindly sent off-list and hopefully announce 
SUCCESS... or at least come back with better(?) questions?? I am a 
lot more clear on the issues that I was when I started... thank you 
all for your help! I knew that promoting ICS at my Delphi tutorials 
all these years was Right Thinking.




http://facebook.com/SheepdogSoftware  TK Boyd's site with
freeware and shareware for kids, parents, schools... and others.
You don't have to be a Facebook member to access the site.

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-23 Thread Angus Robertson - Magenta Systems Ltd
> Not a WEB server, not a TELNET server, but still a 
> server, if only a simple one.
> 
> HttpTst, and the program I derived from it, as I understand things, 
> sends a "proper" HTTP "Get" to the system of your choice. 

Your box is almost certainly both a web server (how you got and set
configuration information) and a telnet server.  Telnet simply means
lines of data to and from the server, and is the basis of HTTP, FTP, SMTP
and the rest.  Those protocols simply use a different port to 'telnet'
but the same textual interaction.  

Using HTTP components is totally wrong.  

If, using a telnet client, you don't get an open connection on port 5200,
there is a deeper problem.  

You may be easier using standard applications, like my ComCap tool which
uses ICS, it is designed for capturing data from devices such as yours,
often hundreds at the same time, and will send a command to wake them up,
as you need. 

http://www.magsys.co.uk/comcap/

Angus





--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-23 Thread Wilfried Mestdagh
Hi,

> to the target server, I need to send just two bytes, 0xBB and
> 0x83

You only need the HttpCli if you use HTTP protocol. Your device does not. It
uses his own protocol (receiving 2 bytes - sending results). So you need to
develop a simple TCP client program using TWSocket.

If you need to send the first item after the device gives you some welcome
data then you have to examine that in OnDataAvailable and send from there.
If it does not you send the 2 bytes in the OnSessionConnected event.

Just fire some more questions if you need it :)

-- 
mvg, Wilfried
http://www.mestdagh.biz
http://www.comfortsoftware.be
http://www.expertsoftware.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-23 Thread TK Boyd
Much progress since I last wrote... thank you Good People at TWSocket 
for breaking down some of the brick walls for me!

>From previous work with ICS, I have a small program, a lightly 
adapted version of the ICS HttpTst.

And I've further refined my grasp of how to properly phrase my 
question. I'm now pretty sure that it is a TCP/IP client I am trying 
to create. The PCSensor device I want to interact with will be the 
server. Not a WEB server, not a TELNET server, but still a server, if 
only a simple one.

HttpTst, and the program I derived from it, as I understand things, 
sends a "proper" HTTP "Get" to the system of your choice. (In another 
application, I've got it doing that, fetching a web page from a WEB 
server.)

When I use that program to try to access the PCSensor device, I do 
get somewhere... but the PCSensor device isn't a WEB server.. it 
does, so the mfg claims, and so my researches seem to indicate, 
"talk" TCP... but doesn't run to responding to HTML (or Telnet). (The 
mfg has, by the way, sent some useful information. Several mysteries 
solved, several guesses confirmed.)

For my PCSensor needs, as far as I can see, I need to simplify 
considerably what my PC sends to the PCSensor device. Instead of 
sending what it does now, e.g.

GET / HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Connection: Keep-Alive
Accept-Language: en, fr
User-Agent: Mozilla/3.0 (compatible)
Host: 192.168.0.241:5200

 to the target server, I need to send just two bytes, 0xBB and 
0x83

I've looked into the HttpTst code, and found the bit...

try
HttpCli1.Get;
except
Display('GET Failed !');.

I think it is the HttpCli1.Get; that sends the "fancy" block of text 
quoted above?

Is there a simple way to get the program to send just the two bytes I 
need sent? I'm hoping that maybe there's a lower level method in 
HttpCli with which I can send individual characters? Or maybe I need 
to first fill a buffer, and then call a "Send contents of buffer" 
method? Or am I going about this all wrong? If I just want to send 
short strings of bytes, is there a better starting point?

If I understand things properly, once the device I am sending things 
to receives, say, BB 83, it then sends back a short string... nothing 
as fancy as a block of HTML... back to the device which sent the 
short string. I will need to access that.

(In the other program I already have working, I have figured out how 
to access the text in the HTML that comes back from the web server I 
am accessing, so there is hope that you won't have to tell me how to 
do EVERY step of this project...)

Thanks!

Tom
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-22 Thread Dod
Hello,

As this subject is OT I propose you to continue this on my personnal mail
instead of this mailing list.

regards.

TB> Thank you, Dod...

TB> I think someone else had told me to use WinPCap under my 
TB> SmartSniff... but I had forgotten.

TB> Sure enough, added WinPCap (I'm on an XP, SP3 machine), and now I see 
TB> something that either wasn't there before, or I was overlooking it.

TB> When I use the software supplied with my TEMPerLAN, I now see what I 
TB> take to be the outbound transaction, the "Command BB 83" from my PC 
TB> to the TEMPerLAN. More in a moment. I've always been able to see the 
TB> part where the TEMPerLAN sends back the data.

TB> I'm not sure how I am supposed to tell which way stuff is flowing 
TB> when I look at the SmartSniff screen... other than knowing by common 
TB> sense, when, as now, I know what's in the messages.

TB> Is my guess at what is going on reasonable?

TB> It seems that the software in my PC generates a "thing" that it sends 
TB> to the TEMPerLAN, well, to whatever is at the IP address I've given 
TB> it, which, as it happens, is where the TEMPerLAN it.

TB> That "thing" then triggers the TEMPerLAN to do the same, but in 
TB> reverse, and sending back to the IP address which came with the 
TB> message from the PC.

TB> (I'm pretty sure that the TEMPerLAN, for this, is not using UDP. I 
TB> even have an idea that I know what UDP is, you'll be glad to know!)

TB> A better statement, with proper terms, of what (may) be going on 
TB> would be welcomed.

TB> SmartSniff has two lines now, as I said.

TB> The one that arises from the sending of Command BB 83 from PC to 
TB> TEMPerLAN says...

TB> Protocol TCP
TB> Local addr: That of my PC (192.168.0.2)
TB> Local port: 3058
TB> Remote addr: That of the TEMPerLAN (192.168.0.241
TB> Remote port: 5200

TB> The line from the messages back... differs just in the local port 
TB> reported...

TB> Protocol TCP
TB> Local addr: That of my PC (192.168.0.2)
TB> Local port: 3057
TB> Remote addr: That of the TEMPerLAN (192.168.0.241
TB> Remote port: 5200

TB> I can see the stuff I would expect when I look in the bottom pane of 
TB> the SmartSniff... what a fantastic program!... window.

TB> Is there any other info which could help you help me?

TB> Thanks again!

TB> Tom

TB> --
TB> To unsubscribe or change your settings for TWSocket mailing list
TB> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
TB> Visit our website at http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-22 Thread TK Boyd
Thank you, Dod...

I think someone else had told me to use WinPCap under my 
SmartSniff... but I had forgotten.

Sure enough, added WinPCap (I'm on an XP, SP3 machine), and now I see 
something that either wasn't there before, or I was overlooking it.

When I use the software supplied with my TEMPerLAN, I now see what I 
take to be the outbound transaction, the "Command BB 83" from my PC 
to the TEMPerLAN. More in a moment. I've always been able to see the 
part where the TEMPerLAN sends back the data.

I'm not sure how I am supposed to tell which way stuff is flowing 
when I look at the SmartSniff screen... other than knowing by common 
sense, when, as now, I know what's in the messages.

Is my guess at what is going on reasonable?

It seems that the software in my PC generates a "thing" that it sends 
to the TEMPerLAN, well, to whatever is at the IP address I've given 
it, which, as it happens, is where the TEMPerLAN it.

That "thing" then triggers the TEMPerLAN to do the same, but in 
reverse, and sending back to the IP address which came with the 
message from the PC.

(I'm pretty sure that the TEMPerLAN, for this, is not using UDP. I 
even have an idea that I know what UDP is, you'll be glad to know!)

A better statement, with proper terms, of what (may) be going on 
would be welcomed.

SmartSniff has two lines now, as I said.

The one that arises from the sending of Command BB 83 from PC to 
TEMPerLAN says...

Protocol TCP
Local addr: That of my PC (192.168.0.2)
Local port: 3058
Remote addr: That of the TEMPerLAN (192.168.0.241
Remote port: 5200

The line from the messages back... differs just in the local port 
reported...

Protocol TCP
Local addr: That of my PC (192.168.0.2)
Local port: 3057
Remote addr: That of the TEMPerLAN (192.168.0.241
Remote port: 5200

I can see the stuff I would expect when I look in the bottom pane of 
the SmartSniff... what a fantastic program!... window.

Is there any other info which could help you help me?

Thanks again!

Tom

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-22 Thread Dod
Hello,

One  thing  about SmartSniff (I use it for years), take care to use it
with  WinPCap  as it may miss ingoing or outgoing datas depending your
WinOS version.

Also if you can't connect to IP addr of the device then it may not use
TCP but UDP, this is quite usual with embedded devices.

regards.

TB> Ah ha! Thank you Angus and Piotr...

TB> Many "happy" tens of minutes spent "playing" with the excellent 
TB> suggestions.

TB> SmartSniffer Wonderful! Fascinating!

TB> Telnet... Ah yes, the "good old days"... I've burned hours with 
TB> Telnet before, given my limited grasp of what I'm doing. (Last time 
TB> it was with Dallas TINIs... faulty ones, at that!)

TB> I haven't tried Overbyte's Telnet... yet. Preferred to start with the 
TB> bog standard one, see how I got on with that.

TB> 
TB> The rest of this rambles a bit... don't feel bad, Gentle Reader, if 
TB> you decide to peruse no further!


TB> Smartsniffer, if I've understood things aright, shows that the vendor-
TB> supplied software talks to the device over 192.168.0.241, port 5200

TB> Tried, under telnet,

TB> o 192.168.0.241 5200

TB>  also

TB> o 192.168.0.241 16000

TB>  and various variations using the other IP addresses in the config 
TB> report. Telnet says "Connecting to 192.160.0.241..." ... but just 
TB> sits there with that on the screen when I enter the first, and comes 
TB> back quickly with "Could not open connection..." with the second.

TB> SmartSniffer doesn't "see" any interaction between 192.168.0.2 and 
TB> 192.168.0.241 in either case.

TB> Suspending my anti-malware for a few minutes led to "interesting" 
TB> results in SmartSniffer!

TB> By the way... yes... I have approached the manufacturer, too! They're 
TB> "getting back to me".

TB> A clue?

TB> In the SmartSniffer report on the "conversation" being held between 
TB> the device and my XP PC, the local address and port are 192.168.0.2 / 
TB> 1506

TB> 192.168.0.2  *IS* the address I'd expect for the PC running 
TB> SmartSniffer, and my Telnet attempts. Not sure if I need to do 
TB> anything about the 1506? Do I somehow have to tell Telnet to watch 
TB> for answers from ..241 to be directed to 1506? Is there a way? 

TB> By the way... I do try to remember to shut down the vendor-supplied 
TB> software when attempting a connection via Telnet.

TB> And thank you, all, for helping with a not-strictly-ICS matter... but 
TB> I will use ICS (with Delphi 7, or maybe Lazarus) to write MY software 
TB> for monitoring the TEMPerLAN... one day... I hope...  (^_^)

TB> Tom

TB> http://facebook.com/SheepdogSoftware  TK Boyd's site with
TB> freeware and shareware for kids, parents, schools... and others.
TB> You don't have to be a Facebook member to access the site.

TB> --
TB> To unsubscribe or change your settings for TWSocket mailing list
TB> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
TB> Visit our website at http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-22 Thread TK Boyd
Ah ha! Thank you Angus and Piotr...

Many "happy" tens of minutes spent "playing" with the excellent 
suggestions.

SmartSniffer Wonderful! Fascinating!

Telnet... Ah yes, the "good old days"... I've burned hours with 
Telnet before, given my limited grasp of what I'm doing. (Last time 
it was with Dallas TINIs... faulty ones, at that!)

I haven't tried Overbyte's Telnet... yet. Preferred to start with the 
bog standard one, see how I got on with that.


The rest of this rambles a bit... don't feel bad, Gentle Reader, if 
you decide to peruse no further!


Smartsniffer, if I've understood things aright, shows that the vendor-
supplied software talks to the device over 192.168.0.241, port 5200

Tried, under telnet,

o 192.168.0.241 5200

 also

o 192.168.0.241 16000

 and various variations using the other IP addresses in the config 
report. Telnet says "Connecting to 192.160.0.241..." ... but just 
sits there with that on the screen when I enter the first, and comes 
back quickly with "Could not open connection..." with the second.

SmartSniffer doesn't "see" any interaction between 192.168.0.2 and 
192.168.0.241 in either case.

Suspending my anti-malware for a few minutes led to "interesting" 
results in SmartSniffer!

By the way... yes... I have approached the manufacturer, too! They're 
"getting back to me".

A clue?

In the SmartSniffer report on the "conversation" being held between 
the device and my XP PC, the local address and port are 192.168.0.2 / 
1506

192.168.0.2  *IS* the address I'd expect for the PC running 
SmartSniffer, and my Telnet attempts. Not sure if I need to do 
anything about the 1506? Do I somehow have to tell Telnet to watch 
for answers from ..241 to be directed to 1506? Is there a way? 

By the way... I do try to remember to shut down the vendor-supplied 
software when attempting a connection via Telnet.

And thank you, all, for helping with a not-strictly-ICS matter... but 
I will use ICS (with Delphi 7, or maybe Lazarus) to write MY software 
for monitoring the TEMPerLAN... one day... I hope...  (^_^)

Tom

http://facebook.com/SheepdogSoftware  TK Boyd's site with
freeware and shareware for kids, parents, schools... and others.
You don't have to be a Facebook member to access the site.

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-22 Thread Angus Robertson - Magenta Systems Ltd
> With software supplied with the device, from a Windows PC connected 
> to the same LAN as the TEMPerLAN, I can "send a command" to it. If 
> the command is BB 82, I get back a short string of ASCII with some 
> data from the device.

> device ipaddress:192.168.0.241
> device netmask:255.255.255.0
> device gateway:192.168.1.1
> host ipaddress:192.168.1.16
> connection type:tcp
> host port:16000 

The device is almost certainly configured as a TCP Server, listening
on port 16000.  So you need a TCP client to send commands to it and
interpret the response. 

The fastest way to test this is with a telnet terminal program,  such as
the OverbyteIcsTnDemo project.  Just connect to the device IP and port,
it should report connected, them send the command BB 82 (which might be
ASCII or hex and it should respond.  You can do the same youself using
the TWSocket component. 

Angus



--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] PCSensor "server"/ Simple client-server

2011-09-22 Thread Piotr Dałek
Hello!

> With software supplied with the device, from a Windows PC connected 
> to the same LAN as the TEMPerLAN, I can "send a command" to it. If 
> the command is BB 82, I get back a short string of ASCII with some 
> data from the device. (Temperatures seen by some attached sensors, 
> but that isn't really central to my question!)

> So, somehow, their software (it would seem!) is able to send 
> something to the device. The software is first "connected" (maybe not 
> in the TCP/IP sense) to the device by the device's IP address. 
> (192.168)

> And then the device sends something out, which is received by the 
> monitoring software.

> On those slender indications, I certainly don't expect anyone to be 
> able to tell me "You just do (this) to duplicate what the software is 
> doing" but if anyone has guesses as to the sort of thing that is 
> going on, guesses which could narrow my Google searching, I would be 
> very grateful.

Use Wireshark or SmartSniffer (http://www.nirsoft.net/utils/smsniff.html)
while running their software to monitor what's transferred between your pc
and mentioned device. Also, these programs should tell you on what ports and
which protocols (not necessary TCP) data is transferred.

-- 
Piotr Dałek
enigmati...@interia.pl

---
Nie licz na ZUS, zadbaj o swoja przyszlosc! 
http://linkint.pl/f2a40
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be