Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:23 22 May 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 : Best practices to transfer files from PC to SD card in Picomite?

Author Message
Gadgetguy
Regular Member

Joined: 26/04/2025
Location: France
Posts: 59
Posted: 11:15am 18 May 2025
Copy link to clipboard 
Print this post

Hello all,

I would like to copy files from my PC (including folders and individual files).

I can of course plug my SD card in my PC and copy that way.

Are there any other ways?

Can I use for example Teraterm to do this? I see I can transfer individual files (which protocol should I use) - but how do I select where they go (to a: or b:) and how do I transfer folders?

Thank you for any pointers!
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2449
Posted: 11:35am 18 May 2025
Copy link to clipboard 
Print this post

As far as I know in TeraTerm Xmodem can only transfer individual files.

The MaxiMite Control Centre (MMEdit / MMCC) is a good way to transfer multiple files.
Hidden from view it also uses Xmodem but MMCC automates transferring the files on your list.
 
Gadgetguy
Regular Member

Joined: 26/04/2025
Location: France
Posts: 59
Posted: 11:56am 18 May 2025
Copy link to clipboard 
Print this post

Thank you. Now I just need to figure out mmcc. I have another post related to that.
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 230
Posted: 02:24pm 18 May 2025
Copy link to clipboard 
Print this post

Hi Gadgetguy,

I wrote a python tool to transfer files from and to the picomite.
https://github.com/teuler/picom

Cheers
Thomas
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 359
Posted: 04:22pm 18 May 2025
Copy link to clipboard 
Print this post

Tried to get it to run under Ubuntu22 but it complains about not finding tomllib. Tried with tomli as tomllib then errors that a bytes-like object is required, not a str.
 
Gadgetguy
Regular Member

Joined: 26/04/2025
Location: France
Posts: 59
Posted: 04:49pm 18 May 2025
Copy link to clipboard 
Print this post

  karlelch said  Hi Gadgetguy,

I wrote a python tool to transfer files from and to the picomite.
https://github.com/teuler/picom

Cheers
Thomas


Thank you, this would be amazing... but it does not work. I downloaded the windows package, extracted it - then when I click "picom.exe" a command window very briefly pops up and then it disappears. Nothing else is visible. I tried to run as administrator, same thing. Would you have any suggestions please to try? (I use Windows 11).
A tool like this would be really really nice!
Thank you!
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 230
Posted: 05:01pm 18 May 2025
Copy link to clipboard 
Print this post

  Gadgetguy said  Thank you, this would be amazing... but it does not work. I downloaded the windows package, extracted it - then when I click "picom.exe" a command window very briefly pops up and then it disappears. Nothing else is visible. I tried to run as administrator, same thing. Would you have any suggestions please to try? (I use Windows 11).
A tool like this would be really really nice!
Thank you!

It does not have a GUI, it is a command line tool, to be used from a shell (under Windows 11, e.g. powershell). You start a shell (powershell) and change into the folder, where you copied picom.exe. The folder "_internal" also needs to be there. Then you call the program using,. e.g., ".\picom p", which should list all COM ports, or ".\picom -h", which prints the help

Best
Thomas
 
Gadgetguy
Regular Member

Joined: 26/04/2025
Location: France
Posts: 59
Posted: 05:09pm 18 May 2025
Copy link to clipboard 
Print this post

  karlelch said  
  Gadgetguy said  Thank you, this would be amazing... but it does not work. I downloaded the windows package, extracted it - then when I click "picom.exe" a command window very briefly pops up and then it disappears. Nothing else is visible. I tried to run as administrator, same thing. Would you have any suggestions please to try? (I use Windows 11).
A tool like this would be really really nice!
Thank you!

It does not have a GUI, it is a command line tool, to be used from a shell (under Windows 11, e.g. powershell). You start a shell (powershell) and change into the folder, where you copied picom.exe. The folder "_internal" also needs to be there. Then you call the program using,. e.g., ".\picom p", which should list all COM ports, or ".\picom -h", which prints the help

Best
Thomas


Thank you. It works. Studying "help" now.
 
Gadgetguy
Regular Member

Joined: 26/04/2025
Location: France
Posts: 59
Posted: 05:29pm 18 May 2025
Copy link to clipboard 
Print this post

Update: I have changed "picom.toml" so it uses COM3 (my picomite is on that), I have not changed anything else.

Then I just want to check if Picom sees my Picomite, so I do picom.exe c

And I get:

.\picom.exe c
PicoM v0.1.7 (beta)
Traceback (most recent call last):
 File "picom.py", line 1118, in <module>
 File "picom.py", line 285, in isPicoMitePresent
 File "picom.py", line 223, in sendCommand
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 5: invalid start byte
[PYI-13160:ERROR] Failed to execute script 'picom' due to unhandled exception!

-------

This works:

.\picom.exe p
PicoM v0.1.7 (beta)
1 serial port(s) found :
 `COM3`, USB-SERIAL CH340 (COM3)

-------------

But this does not work either

.\picom.exe f
PicoM v0.1.7 (beta)
Traceback (most recent call last):
 File "picom.py", line 1118, in <module>
 File "picom.py", line 285, in isPicoMitePresent
 File "picom.py", line 223, in sendCommand
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 5: invalid start byte
[PYI-6740:ERROR] Failed to execute script 'picom' due to unhandled exception!

-----------------

Any ideas please?


Teraterm works and MMCC also seems to work (have not tested too much, but starts and I see the files on the Picomite)

Thank you for any suggestions!
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 230
Posted: 05:49pm 18 May 2025
Copy link to clipboard 
Print this post

Is it possible then you closed Teraterm whil still in the build-in editor or with a program running? Because then, picom cannot correctly communicate with the PicoMite. Please try to connect to the PicoMite via Teraterm, make sure that you are at the prompt level, exit Teraterm and try picomite again.

Best
Thomas
 
Gadgetguy
Regular Member

Joined: 26/04/2025
Location: France
Posts: 59
Posted: 05:57pm 18 May 2025
Copy link to clipboard 
Print this post

  karlelch said  Is it possible then you closed Teraterm whil still in the build-in editor or with a program running? Because then, picom cannot correctly communicate with the PicoMite. Please try to connect to the PicoMite via Teraterm, make sure that you are at the prompt level, exit Teraterm and try picomite again.

Best
Thomas


Thank you so much Thomas for trying to figure this out!

So, I rebooted my computer.

Then started Teraterm - checked its connected (by typing "files" at the command prompt), then exited (using "exit") in Teraterm.

Then, I go to picom and I get:

.\picom.exe p
PicoM v0.1.7 (beta)
1 serial port(s) found :
 `COM3`, USB-SERIAL CH340 (COM3)

But then

.\picom.exe ft
PicoM v0.1.7 (beta)
Traceback (most recent call last):
 File "picom.py", line 1118, in <module>
 File "picom.py", line 285, in isPicoMitePresent
 File "picom.py", line 223, in sendCommand
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 5: invalid start byte
[PYI-9144:ERROR] Failed to execute script 'picom' due to unhandled exception!

What else can I try please?

Thank you!

-------------

Update: I pressed "reset" on the picomite and now I get

picom.exe ft
PicoM v0.1.7 (beta)
Retrieving file tree from `A:` :
0 file(s) and 0 folder(s) found.
Content of `A:` :

So it works (there is nothing on A).
------

Well I celebrated too early.

I tried drive B: - could not switch over (probably bad syntax).

But now I get
.\picom.exe ft
PicoM v0.1.7 (beta)
Traceback (most recent call last):
 File "picom.py", line 1118, in <module>
 File "picom.py", line 285, in isPicoMitePresent
 File "picom.py", line 223, in sendCommand
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 5: invalid start byte

And I did reset the pico (same way where it worked before)

Picom sees it

.\picom.exe p
PicoM v0.1.7 (beta)
1 serial port(s) found :
 `COM3`, USB-SERIAL CH340 (COM3)

-------------
A few resets later it works again

.\picom.exe ft
PicoM v0.1.7 (beta)
Retrieving file tree from `A:` :
0 file(s) and 0 folder(s) found.
Content of `A:` :

------

But then I want to switch over to B:

.\picom.exe -d --drive B:
PicoM v0.1.7 (beta)
Traceback (most recent call last):
 File "picom.py", line 1118, in <module>
 File "picom.py", line 285, in isPicoMitePresent
 File "picom.py", line 223, in sendCommand
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 14: invalid start byte
[PYI-6024:ERROR] Failed to execute script 'picom' due to unhandled exception!

--------

And after doing this I try

.\picom.exe ft
PicoM v0.1.7 (beta)
Traceback (most recent call last):
 File "picom.py", line 1118, in <module>
 File "picom.py", line 287, in isPicoMitePresent
IndexError: list index out of range
[PYI-1268:ERROR] Failed to execute script 'picom' due to unhandled exception!



So not sure what to do... Sorry for bothering you with this!
Edited 2025-05-19 04:09 by Gadgetguy
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 230
Posted: 08:25pm 18 May 2025
Copy link to clipboard 
Print this post

Thanks for the extensive testing.

I am a bit confused why it works sometimes and sometimes not … what Baudrate are you using in Teraterm? Maybe for some reason the Baudrate is too high; you could try to reduce it in the .toml file.

Note that „.\picom p“ is not actually connecting to the PicoMite; it just lists the available ports. Therefore, this command is not good for testing if the communication with the PicoMite works.

I can do some more testing tomorrow evening. In the meantime, it would be helpful if you send me what PicoMite (firmware, chip) and options you use. Thanks.

Best
Thomas
 
Gadgetguy
Regular Member

Joined: 26/04/2025
Location: France
Posts: 59
Posted: 06:32am 19 May 2025
Copy link to clipboard 
Print this post

  karlelch said  Thanks for the extensive testing.

I am a bit confused why it works sometimes and sometimes not … what Baudrate are you using in Teraterm? Maybe for some reason the Baudrate is too high; you could try to reduce it in the .toml file.

Note that „.\picom p“ is not actually connecting to the PicoMite; it just lists the available ports. Therefore, this command is not good for testing if the communication with the PicoMite works.

I can do some more testing tomorrow evening. In the meantime, it would be helpful if you send me what PicoMite (firmware, chip) and options you use. Thanks.

Best
Thomas

Thank you Thomas - any investigation helps and is VERY appreciated!

To answer your questions

1. Baudrate in Teraterm - I am using what Teraterm suggested - 115200 baud. Not sure if faster / slower would also work?

2. The picomite is the reference design by Peter - HDMIUSB

3. The options are:
PicoMiteHDMI MMBasic USB RP2350B Edition V6.00.02RC23
OPTION SERIAL CONSOLE COM2,GP8,GP9
OPTION SYSTEM I2C GP20,GP21
OPTION FLASH SIZE 16777216
OPTION COLOURCODE ON
OPTION KEYBOARD US, 0, 0, 300, 50
OPTION PICO OFF
OPTION RESOLUTION 640x480 @ 252000KHz
OPTION HDMI PINS  1, 3, 5, 7
OPTION SDCARD GP29, GP30, GP31, GP32
OPTION KEYBOARD REPEAT 300,50
OPTION AUDIO I2S GP10,GP22', ON PWM CHANNEL 11
OPTION RTC AUTO ENABLE
OPTION COUNT GP0,GP1,GP2,GP3
OPTION MODBUFF ENABLE  512
OPTION PLATFORM FM
OPTION PSRAM PIN GP47
OPTION HEARTBEAT PIN GP25
>

4. Reduced the baud rate in the .toml file to 115200 and ... it seems to be working!!! I did several quick tests this AM (before switching off for a week of travel) and everything worked (but not perfect yet).

On question: what is the correct syntax to switch to drive B please?

I get the following
.\picom.exe -d --drive B:
PicoM v0.1.7 (beta)
Error: Command `b:` not recognized

And if I try this:

.\picom.exe -d --drive B
PicoM v0.1.7 (beta)
Error: Invalid drive parameter (`--drive`)

This nearly works
.\picom.exe -d B: ft
PicoM v0.1.7 (beta)
Retrieving file tree from `B:` :
2 file(s) and 0 folder(s) found.
Content of `B:` :
├──cldr.bas
└──fm.bas

There is a small issue here: in reality I also have two folders on drive b:
So in teraterm I get this:

> files
B:/
  <DIR>  di26
  <DIR>  zmim
17:40 17-05-2025       3072  cldr.bas
17:40 17-05-2025      55552  fm.bas
2 directories, 2 files


I will try higher speeds over the weekend and report at which baud rate I start to see problems. But at 115200, it seems to be working fine (except the missing folders on drive B).

Thank you again, this is starting to work very nicely!
Edited 2025-05-19 16:38 by Gadgetguy
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4904
Posted: 06:49am 19 May 2025
Copy link to clipboard 
Print this post

  Gadgetguy said  Hello all,

I would like to copy files from my PC (including folders and individual files).

I can of course plug my SD card in my PC and copy that way.

Are there any other ways?



For small amount of files:

Install MMEdit
Use MMCC filemanager

For complete folders and large files:

Put SD card in a PC

Volhout
PicomiteVGA PETSCII ROBOTS
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2449
Posted: 06:54am 19 May 2025
Copy link to clipboard 
Print this post

The Pico uses a virtual COM Port that runs at USB speed regardless of the baud-rate selected.
The only exception is 1200 baud. That puts the Pico in 'Firmware Update' mode, awaiting a .uf2 file.
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 230
Posted: 09:45pm 19 May 2025
Copy link to clipboard 
Print this post

Hi Gadgetguy

If you are using a USB version of the firmware, you are connecting the PicoMite to the PC via the GPIOs and a serial-to-USB adapter, correct?
In this configuration, I observed that the timing may need to be adjusted. Try longer delays for the „com_timeout_s“ parameter in the .toml file. You may also need a longer wait time for XModem (see parameter there). The default Baudrate and timings are for the standard firmware and using the onboard USB connector on the Pico.

Regarding the issues with B: - I need to test this. This will not be before the weekend, as daytime work is keeping me busy.

Best
Thomas
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 230
Posted: 09:47pm 19 May 2025
Copy link to clipboard 
Print this post

  phil99 said  The Pico uses a virtual COM Port that runs at USB speed regardless of the baud-rate selected.
The only exception is 1200 baud. That puts the Pico in 'Firmware Update' mode, awaiting a .uf2 file.

Not, when using the serial connection via the GPIOs (as is default for the USB firmware versions), no? My understanding is that it then uses the set Baudrate.

Best
Thomas
 
Gadgetguy
Regular Member

Joined: 26/04/2025
Location: France
Posts: 59
Posted: 05:25am 20 May 2025
Copy link to clipboard 
Print this post

  karlelch said  Hi Gadgetguy

If you are using a USB version of the firmware, you are connecting the PicoMite to the PC via the GPIOs and a serial-to-USB adapter, correct?
In this configuration, I observed that the timing may need to be adjusted. Try longer delays for the „com_timeout_s“ parameter in the .toml file. You may also need a longer wait time for XModem (see parameter there). The default Baudrate and timings are for the standard firmware and using the onboard USB connector on the Pico.

Regarding the issues with B: - I need to test this. This will not be before the weekend, as daytime work is keeping me busy.

Best
Thomas


Thank you Thomas,

I am using the usb c port - not sure where that goes.

Thank you for looking into the issue with B:
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025