PDA

View Full Version : line terminationI have a 6811 board running MaxForth. I am attempting to connect it


wstein
09-06-07, 11:28 AM
I have a 6811 board running MaxForth. I am attempting to connect it to the internet. I have a Lantronix serial port server which enables nearly any serial device to be connected to the internet. One establishes a telnet session to the Lantronix server, and then all the characters can be sent between your telnet client and the serial device.

So far, I have been able to set up the 'HC11 to acquire the data I need and print it to the serial port on a regular basis. Then I telnet to the lantronix device, and the data comes into my telnet client. The problem arises when I try to interact with the 'HC11. I am nearly sure that the telnet standard is to send line feeds (LF) as the line terminator, and not carriage returns. This confuses the HC11 and I get back a ? from the HC11. Anything I can do about this? If I switch to a HC12, where MaxForth is flashed, could you instruct me on how to change the code so that it responds properly to a line feed instead of a carriage return?

I don't think that telnet has the capability to use a carriage return instead of a line feed as line termination or I would have done that.

Thanks


William Stein
Renewable Energy Research Laboratory
University of Massachusetts - Amherst
(413) 577-2139
wstein@ecs.umass.edu
www.ceere.org/rerl/

RMDumse
09-06-07, 06:04 PM
Hi Bill. Long time no talk. Interesting project you have there. Try this. The End of Line character (EOL) character is programmable. It is located in the user table. So if you store a line feed ascii value in it, you will change what the system thinks a EOL is. The location is 0028 hex. Give that a try and let me know.

wstein
09-08-07, 08:37 PM
Hi Randy

Yes it has been a long time. Hope you are doing well. I thought this was going to be simple. I never learn. I looked at location 28. It was 0 but 29 was D (CR). So I changed 29 to A, thinking I have it now.

The board still has a strange behavior, and I ... think ... I know what the problem is. Telnet seems to buffer an entire line up to the EOL and then sends it out as a packet. The HC11 seems to miss the first character of each transmitted line. For instance, at my telnet client I type:

WORDS

the HC11 responds with
ORDS

?

or something similar. I suspect it is a text pacing problem. Terminal emulators long ago gave up the capability of showing non-printables, so this is a bit difficult to troubleshoot.

I am about to give up on the idea of having interactive ie re-programming at a distance. I will just have to make the board and application totally bulletproof including a watchdog. It will just be connected to wind sensors 250 ft up a tower so lightning will get anyway (sigh) Take Care

Cheers


Bill Stein

wstein
09-09-07, 03:20 PM
Hi Randy,

Yes, long time. Hope you are well. I thought I sent you a reply yesterday, but I don't see it here. I am giving up on Telnet. I don't know the details of the protocol. I think the EOL mem location is actually 29 hex. I tried changing it to 0A, but I am still having trouble. With this mod, the text I type in the Telnet client seems to get buffered and then sent out as a packet when I hit the return key. May be a timing problem, but Maxforth/HC11 always seems to miss the very first character.

Last night I tried a new tack. I tossed together a LabVIEW interface that allows me to send and receive text over TCP/IP. I have a bit more control this way, and I got the whole thing working pretty well. If anyone is interested I could post the LabVIEW part here. Its pretty simple. There are two text boxes: One you type in and when you press return it is sent out to the specified IP address and port. (This is the IP address and port which one has assigned to the Lantronix serial port server). The next text box receives any response. This is the serial activity at the HC11, which is connected to the Lantronix serial port.

Buy the way, when I am not at Umass, I am now getting a small business going. Have a look: www.etesian-tech.com.

Thanks again for your help.

Cheers

Bill

RMDumse
09-10-07, 10:54 AM
I thought I sent you a reply yesterday, but I don't see it here.

Yes, unfortunately, we are getting 10x to 20x spam posts to real posts, so we are moderating every post. Sometimes this means there are delays seeing your post go up. Sad state of affairs, where property right are abused by scammers and spammers.

I am giving up on Telnet. I don't know the details of the protocol.

Too bad. You've almost got it.

I think the EOL mem location is actually 29 hex. I tried changing it to 0A,

Well, actually all User Variables are 16-bits, so, yes, the byte containing the return character as an 8-bit value resides at 29 hex.

[/QUOTE]but I am still having trouble. With this mod, the text I type in the Telnet client seems to get buffered and then sent out as a packet when I hit the return key. May be a timing problem, but Maxforth/HC11 always seems to miss the very first character.[/QUOTE]

Probably so. We expect the transmitting system to give us a break at the end of a line, so we can translate what has been sent.

You could test that idea by including a long line of numbers. Numbers are the slowest things to be translated, because the entire dictionary has to be searched through CURRENT and CONTEXT to be sure nothing matches before trying to translate the string into a number.

Perhaps a long line of numbers would cause you to miss more than the first character, then you'd know it was a time related issue.

Instead it might be related to the first character issue alone. Perhaps the answer with a CR-LF might get turned into two LFs, and cause system problems.

I'm sure it is solvable, but it would take some fiddling.

Last night I tried a new tack. I tossed together a LabVIEW interface that allows me to send and receive text over TCP/IP. I have a bit more control this way, and I got the whole thing working pretty well. If anyone is interested I could post the LabVIEW part here.

Please do. Our users are always looking for neat ideas like that.

Buy the way, when I am not at Umass


Ah. You might be amused to know these days when "I am not at NMI", I am logged in at University of Northern Iowa, taking and teaching classes. I'm teaching an electronics course this semmester.

sreeja
11-07-07, 02:08 AM
Is connecting is easy?Lantronix serial port is essential.

RMDumse
11-07-07, 06:10 PM
Bill, can you post your results?