Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:07 02 Aug 2025 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 : Tera Term instruction required

     Page 1 of 2    
Author Message
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 122
Posted: 11:00pm 14 Mar 2019
Copy link to clipboard 
Print this post

Hi guys
Every month I need to transfer and delete 30 or so files from my maximite all with the same extension. I am currently using MM Edit but this requires me to transfer and then delete these files individually.
Could I use Tera Term and what would be the command line for a copy and then erase of all 30.
Regards
Chris K
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 01:57am 15 Mar 2019
Copy link to clipboard 
Print this post

MMBasic doesn't have a bulk transfer option so you will have to write a macro for TeraTerm.
I assume (silly thing to do) that the file names are based on the date so you should be able to construct the file names in TeraTerm macro language.

Jim
VK7JH
MMedit
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 05:07am 15 Mar 2019
Copy link to clipboard 
Print this post

For my CMM SD files, I have a hard switch which along with software stops all SD card activity & closes files. I then remove the SD card, bung it into a laptop & do the file transfer & delete stuff.

The card then gets put back into the CMM & switch pressed again to resume SD card activity.

My main write period is every 5 mins & I'm also careful that there is no other incidental stuff being recorded.

No need to stop the CMM.

Brian

Edit, I should add that a Flag is set so that if the card is not there, no write attempts are made. Flag cleared when card re-inserted & switch pressed.Edited by Chopperp 2019-03-16
ChopperP
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 09:52pm 17 Mar 2019
Copy link to clipboard 
Print this post

Another approach would be to write a program for the Maximite (or extend the existing one) to transfer the files via a serial link to a PC running a program in written in MMBasic for DOS. You should of course verify that the files have been saved and are correct before deleting (KILLing) the files on the Maximite - either manually or by program.

Bill
Keep safe. Live long and prosper.
 
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 122
Posted: 01:43am 18 Mar 2019
Copy link to clipboard 
Print this post

Thanks for your replies guys.
The CMM is in a greenhouse within a weather poof case so it isn't so easy to access the SD card every month.
I had thought of transferring data via a serial link but I thought that a bulk transfer every month using MM Edit would suffice although it is a little slow and painful when you have the 30 files.
Tassy Jim - yes the file names are based on the date so it sounds like the macro would be the best way to go.
Now my question is has anyone got an example of such a macro that I could adapt?

Cheers Chris K
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 02:42am 18 Mar 2019
Copy link to clipboard 
Print this post

I've never looked at them but this might help.

Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 05:26am 18 Mar 2019
Copy link to clipboard 
Print this post

You will have to play around a bit to get your file names correct but this "should" work.
send #3
n = 0
do
n = n + 1
int2str xday n
thisfile = "test"
strconcat thisfile xday
strconcat thisfile ".txt"
sendln "XMODEM SEND " #34 thisfile #34

pause 3
recfile = "C:\Users\documents\"
strconcat recfile thisfile
xmodemrecv recfile 1 1
pause 10
loop while result = 1


Timeouts take a very long time but once you have the system working, it will only time out when you run out of days in the month.

Jim

VK7JH
MMedit
 
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 122
Posted: 10:33pm 18 Mar 2019
Copy link to clipboard 
Print this post

Thanks Jim and Bill.
Now a silly question, where would I run this program from?
The only thing I have used Tera Term for is ^C, close #1, load files and run.

Chris K
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 11:19pm 18 Mar 2019
Copy link to clipboard 
Print this post

Save the script with an extension of .ttl
I put mine in the TeraTerm folder
To run it:
In TeraTerm,
Control/Macro

The TeraTerm help file has a full set of commands for TTL in it.

Jim
VK7JH
MMedit
 
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 122
Posted: 01:15am 03 May 2019
Copy link to clipboard 
Print this post

Hi Guys
Jim, finally got around to trying out the short program however not even the first file is transferred.
I created files test1 - test6 and placed them on the micromite.
What appears on the screen after timing out is:

> XMODEM SEND "test1.txt"
Error: Remote did not respond
>
Any ideas?

Chris K
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 01:53am 03 May 2019
Copy link to clipboard 
Print this post

  Chrisk said  Any ideas?

In Teraterm, did you do File, Transfer, XMODEM, Receive?

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 03:08am 03 May 2019
Copy link to clipboard 
Print this post

  lizby said  
  Chrisk said  Any ideas?

In Teraterm, did you do File, Transfer, XMODEM, Receive?

Assuming he is running it with the .ttl script file, that should have happened automatically.

Can you show us the complete ttl file?

Jim

VK7JH
MMedit
 
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 122
Posted: 05:12am 03 May 2019
Copy link to clipboard 
Print this post

Hi Guys/Jim
Thanks for your quick response.
It is virtually the same as Jim had written above except for the location where I left it as c:\Users
Here it is below.

send #3
n = 0
do
n = n + 1
int2str xday n
thisfile = "test"
strconcat thisfile xday
strconcat thisfile ".txt"
sendln "XMODEM SEND " #34 thisfile #34

pause 3
recfile = "C:\Users\"
strconcat recfile thisfile
xmodemrecv recfile 1 1
pause 10
loop while result = 1


 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:20am 03 May 2019
Copy link to clipboard 
Print this post

try a longer pause
instead of pause 3, try pause 50 or more to start with.

VK7JH
MMedit
 
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 122
Posted: 06:47am 03 May 2019
Copy link to clipboard 
Print this post

Hi Jim

I have tried 60 and then 80, still the same response.
I have carried out everything as you requested.
Run from Control/Macro
It runs immediately to give the first line
XMODEM SEND "test1.txt"
then after quite a few seconds up comes the error message
Error: Remote did not respond.

I am using Tera Term version 4.86 would that be a problem?

Regards Chris K
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:55am 03 May 2019
Copy link to clipboard 
Print this post

pause is in seconds not ms as I thought.
try pause 1

If I find time, I will try and set up a test but it might be a while.

Jim
VK7JH
MMedit
 
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 122
Posted: 07:27am 03 May 2019
Copy link to clipboard 
Print this post

Thanks Jim
No rush, I can always do it using MMedit and that is only once a month.

Chris K

 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 01:00am 04 May 2019
Copy link to clipboard 
Print this post

Try updating your TeraTerm.
I just tested on V4.94 and it transferred 6 consecutive files without problems.
I used an Armite H7 as the mite but all versions that allow file transfers should work the same.

>
> XMODEM SEND "test1.txt"
> XMODEM SEND "test2.txt"
> XMODEM SEND "test3.txt"
> XMODEM SEND "test4.txt"
> XMODEM SEND "test5.txt"
> XMODEM SEND "test6.txt"
> XMODEM SEND "test7.txt"
Error: Could not find the file

After each file, a dialog box flashed briefly and on the final file (which doesn't exist), the save file dialog stayed up. I cancelled this dialog and the macro completed as it should.

send #3
n = 0
do
n = n + 1
int2str xday n
thisfile = "test"
strconcat thisfile xday
strconcat thisfile ".txt"
sendln "XMODEM SEND " #34 thisfile #34

pause 3
recfile = "C:\Users\Jim\Documents\"
strconcat recfile thisfile
xmodemrecv recfile 1 1
pause 10
loop while result = 1


Make sure that you are saving to a location that has write permissions.


Jim


VK7JH
MMedit
 
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 122
Posted: 07:36am 04 May 2019
Copy link to clipboard 
Print this post

Hi Jim

Yep got a new version of Tera Term and also looked at the location where I was writing the files. I suspect it was the latter that was at fault.
Played around with the pause values and found the second pause at one(1) provided the same error. However tried 5 and it did work correctly.

Sorry to have put you to so much trouble and thank you again.

Kind regards

Chris K


 
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 122
Posted: 10:18am 14 May 2019
Copy link to clipboard 
Print this post

Hi again
How does one do the equivalent of MMBasic's
INPUT ["prompt string$";] store the string as a variable and then be able to print it (to verify it is correct) in a Tera Term macro.

Chris K
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025