?
Solved

xmodem transfer

Posted on 1998-08-25
8
Medium Priority
?
245 Views
Last Modified: 2013-12-27
This is more of a programming question.

I am writing an application that attempts to upload a file  to a remote server using xmodem  and am having
difficulty getting the receiving site to return anything but
nak messages.

The question is does anyone have a detailed explanation
of the xmodem protocol detailing everything from the
packet structure to how the checksum is computed. Apparently what I have is completely wrong and I have no clue what to do at this point.

Thanks

Brett
0
Comment
Question by:mcello
  • 5
  • 3
8 Comments
 

Author Comment

by:mcello
ID: 1144673
Edited text of question
0
 
LVL 6

Accepted Solution

by:
joopv earned 500 total points
ID: 1144674
0
 

Author Comment

by:mcello
ID: 1144675
Thanks for the reference. The information you supplied was
what I had previously but I still havent been able to make it work. The test code in question is in VB. Maybe this is an obvious mistake but here it is with a couple extra comments.
The destination server responds repeatedly with naks.

Function buildPacket() As String

Dim PktString As String
Dim TXTMSG As String

'TXTMSG is a constant 127 character string used as a test

TXTMSG = "@H            1998031300000019980316000000COMMON EFT/DISB ROSE001PMOHELA                          82886300      OEMPORIA STATE "

'chr$(26) is the end of file character to make 128 total
TXTMSG = TXTMSG & Chr$(26)

'PktString is the actual packet string

'SOH header
PktString = Chr$(1)

'packet number
PktString = PktString & Chr$(1)
'packet number complement
PktString = PktString & Chr$(254)

'add data block (128 characters)
PktString = PktString & TXTMSG

'getCheckSum returns a 1 byte checksum integer
PktString = PktString & Chr$(getCheckSum(TXTMSG))
buildPacket = PktString

End Function
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
LVL 6

Expert Comment

by:joopv
ID: 1144676
Seems to comply with the spec for the first packet, providing the getCheckSum function only returns 1 byte of information..  Can you check that ?  If is is the sum including carry, AND it with 255.

0
 
LVL 6

Expert Comment

by:joopv
ID: 1144677
hmm upon reading somewhat better i guess the chr$() function should only return the checksum MOD 255 if it would be greater.
Test the checksum function yourself, by hand.  I would'nt trust any VB function i had'nt written myself :-)
 
0
 
LVL 6

Expert Comment

by:joopv
ID: 1144678
Mcello,

No progress yet ?  If you want i could try to make a serial datatrace from a xmodem transfer session.

For debugging serial data communications i use a dedicated laptop with 2 serial ports and the d'scope program.  It is a very old DOS application.  If you have a spare system i could send you the program.


0
 

Author Comment

by:mcello
ID: 1144679
Sorry it took me awhile to get back. Ive been away for the last
5 days or so.

Im still having some problems. I took a close look at what I was
getting back from the host (compuserve) and they repeatedly
are sending the 'C' character. According to what Ive read
this should only happen once but they seem to insist on using
CRC mode.

So I read up and wrote a CRC checksum routine.

It still doesnt work. I guess my question then has changed from
how to implement a packet using standard checksums to one using CRC.

The only thing I can think of is to post the code which I know
you would have to wade through. So heres the deal

I can
award you 100 points for the effort of putting me on track and
be done with it

or
If you can find the problem in what Im doing I will be more than
happy to award you my entire point bank of around 1000 points.

Let me know if you want to go that way and I can post the code.


0
 
LVL 6

Expert Comment

by:joopv
ID: 1144680
i'd love to dig in to your problem further but i don't have much time left before i go on a long trip.  Besides, i'm not a very experienced VB programmer anyway.

I'll take your first offer and can only offer you some more tips like searching the web for other xmodem source code (although it usually will be C code) and the old source code archives, i'm pretty sure there will be more pascal and maybe even basic xmodem sources just waiting to be downloaded.

a quick search at http://ftpsearch.ntnu.no/ on xmodem already gives 15 hits, including a possible interesting document on
ftp://kyuss.artis.uni-oldenburg.de/pub/infopool/documents/specifications/dfue/XMODEM/xmodem.doc.


0

Featured Post

Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Do you have a computer or other electronic gear that is attached to a rat nest of cables, or alternatively have your cables all bundled nice at neat?  If so then read this post to sidstep common pitfalls. When I was a student at DeVry University,…
Hi there, This article summarizes what you need if you are going to set up your home or small business Network Attached Storage (NAS) to be accessible from the internet. Of course there are configuration differences based on your NAS or router ma…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
Watch the software video of Kernel Import PST to Office 365 tools which can easily import PST and OST files to Office 365 for bulk mailboxes. The process of migration is simple and user can map source and destination mailboxes and easily import data…

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question