Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:27 29 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : File transfer problems using MMEdit

Author Message
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 121
Posted: 02:57am 31 Mar 2023
Copy link to clipboard 
Print this post

Hi Guys
This having been going so well recently.
Problem 1
When I transfer a short 4 line file to my micromite 64 the received file has at the end a series of characters. This upsets by data reading program.
It has just occurred recently. Any ideas please.

Problem 2
My laptop no longer sees my micromite 64. I have tried to reload the driver but Windows Device Manager says the "Silicon Chip" driver isn't the correct driver and does nothing.
Should I reload the micromite 64.

Chris K





 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 03:44am 31 Mar 2023
Copy link to clipboard 
Print this post

  Quote  Problem 1
When I transfer a short 4 line file to my micromite 64 the received file has at the end a series of characters. This upsets by data reading program.
It has just occurred recently. Any ideas please.


When transferring files using XMODEM, the file is padded out to a multiple of 128 bytes.
The padding character can be either chr$(0) or chr$(26). The standard allows either.

That has always been the case.

One way of removing the extra characters it to run the program on the 'mite.
You may have to edit it to include files with the correct extension for your data files.

 ' XMODEM trim by TassyJim 23 Feb 23
 OPTION EXPLICIT
 OPTION DEFAULT INTEGER
 DIM f$, tfile$ = "tempfile.txt"
 DIM safefile$= " bas py html htm txt csv log "
 DIM filetype$, packet$
 DIM INTEGER n, k, fsize, blocks
 
 f$ = DIR$("*",FILE)
 DO WHILE f$ <> ""
   'print f$
   filetype$ = FIELD$(f$,2,".")
   'print f$, filetype$
   IF INSTR(safefile$,filetype$) THEN
     fsize = MM.INFO(FILESIZE f$)
     IF fsize MOD 128 = 0 THEN
       blocks = fsize/128
       OPEN tfile$ FOR output AS #2
       OPEN f$ FOR INPUT AS #3
       FOR n = 1 TO blocks-1
         packet$ = INPUT$(128,#3)
         PRINT #2, packet$;
       NEXT n
       packet$ = INPUT$(128,#3)
       CLOSE #3
       FOR k = LEN(packet$) TO 1 STEP -1
         IF MID$(packet$,k,1) <> CHR$(0) AND MID$(packet$,k,1) <> CHR$(26) THEN
           EXIT FOR
         ENDIF
       NEXT k
       packet$ = LEFT$(packet$, k)
       PRINT #2, packet$;
       CLOSE #2
       KILL f$
       RENAME tfile$ AS f$
       PRINT f$, fsize, MM.INFO(filesize f$)
       PAUSE 1000
     ENDIF
   ENDIF
   f$ = DIR$()
 LOOP


In MMCC.inf you can change the pad character but if you change it to anything other than 0 or 26, XMODEM will fail.
Look for this line in the general section
Xmodem pad character = 0


Jim
VK7JH
MMedit   MMBasic Help
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3815
Posted: 07:25am 31 Mar 2023
Copy link to clipboard 
Print this post

  Chrisk said  Problem 2
My laptop no longer sees my micromite 64. I have tried to reload the driver but Windows Device Manager says the "Silicon Chip" driver isn't the correct driver and does nothing.
Should I reload the micromite 64.

Chris K

Maybe try ZADIG.EXE to make Windows do what you want.

John
 
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 121
Posted: 11:38pm 31 Mar 2023
Copy link to clipboard 
Print this post

Thanks guys I will give both of the suggestions a go.


The strange thing is that Problem 2 wasn't a problem until recently.
And somehow I must have avoided the padding because the files were always greater than 128 bytes.

Chris K
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 11:46pm 31 Mar 2023
Copy link to clipboard 
Print this post

  Chrisk said  
And somehow I must have avoided the padding because the files were always greater than 128 bytes.

Chris K

The file gets padded to a multiple of 128 bytes.
VK7JH
MMedit   MMBasic Help
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 12:18am 01 Apr 2023
Copy link to clipboard 
Print this post

Each packet of a xmodem transmission is 128 bytes long, the last one is padded to make it 128 bytes if it is less than 128 bytes. It's part of the spec and has always been that way.

I can't remember the details now but it had something to do with CP/M file block size. It's that old. Look it up in Wikipedia if you want more info.

Bill
Keep safe. Live long and prosper.
 
NPHighview

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 200
Posted: 02:03am 01 Apr 2023
Copy link to clipboard 
Print this post

Historical note: XMODEM protocol was written during the Blizzard of 1978 by Ward Christensen, who along with Randy Seuss and others, operated The Itty Bitty Machine Company, a computer store in Evanston, Illinois, USA, in the 1970s. Ted Nelson, a computer visionary who coined the term "Hypertext", co-founded the company with Christensen and Seuss.

I bought my first computer, a Z-80 - based "Digital Group" system with a whopping 2Kbytes of RAM, from that store in about 1975. I've still got a copy of Nelson's "Computer Lib / Dream Machines" from that era. Alas, the computer itself is long gone, but put to shame by the Colour Maximite.
Live in the Future. It's Just Starting Now!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024