Device File Transfer

Support forum for MegunoLink
Post Reply
strud
Posts: 23
Joined: Sat Nov 18, 2023 6:51 am

Sat Nov 18, 2023 9:20 pm

I am very interested in using Meguno Link for a product I have developed but a key requirement is the ability to transfer and maintain files on the remote device (SD card file system).

I note in the documentation there is a Device File Transfer visualiser but I cannot see this in the IDE that I am using in trial mode.

Is this visualiser only available once the licence has been activated?
strud
Posts: 23
Joined: Sat Nov 18, 2023 6:51 am

Wed Nov 22, 2023 8:06 pm

I have been able to insert this visualiser now, I think it was just not available from the Interface panel visualiser list.

My next question relates to where the FileManger library exists?

As I am using TeensyDuino there are some subtle differences in the manner I need to implement the SD card file system.

If the FileManager library is something that is part of Arduino specifically then I might need to write my own equivalent.

Anyone with experience here?
strud
Posts: 23
Joined: Sat Nov 18, 2023 6:51 am

Wed Nov 29, 2023 8:26 pm

I now have this working to some extent but having problems with actual file transfer.

So it is working for "Request file list" but when I try to "Request file from device" it times out.
megunoLink_file_transfer_Screenshot 2023-11-30 071945.png
megunoLink_file_transfer_Screenshot 2023-11-30 071945.png (59.91 KiB) Viewed 4445 times
I have stopped all other comms from my device during this time but that has had no effect.

Any thoughts why requesting file list will work ie returns an accurate file list but not a file transfer?

I am using the sdFat implementation.

I have defined a buffer size of 200bytes at both ends.

I note that there is an option to enable diagnostics in the buffer size selection dialog. Is there a specific channel that needs to be defined for this to work?
admin
Site Admin
Posts: 20
Joined: Mon May 26, 2014 10:53 am

Sat Dec 02, 2023 11:37 pm

Hi, I think there is a bug somewhere but I haven't been able to reproduce it. In the screen shot, the Arduino program is responding to the file request (that is the message

Code: Select all

!FM < 0 config.txt
with:

Code: Select all

{DFT|FDe|config.txt
|0|o}
This message is generated by FileSystemWrapper::SendFileContent because opening the file failed. That reply shouldn't have a line break though, which may mean it is trying to open the wrong file. That is, the filename it got has a newline on the end of it. The filename comes from FileManager::HandleGetFileContent. I'm not sure if MegunoLink is sending the wrong filename or the command handler isn't parsing the message it receives from MegunoLink properly (possibly retaining part or all of the new line).

Would you mind sharing a screenshot from the monitor with end-of-line markers visible please? Use Image in the monitor to turn on end-of-line markers. It would be helpful to see the messages from the file listing (!FM ?) and file request (!FM < Config.txt. Also, were the config.txt and webpage.html files already on the SD card, or were they uploaded by MegunoLink (if by MegunoLink, perhaps the file name problem occurs there).

It would be worth checking you have the latest version of MegunoLink, Arduino library too.
strud
Posts: 23
Joined: Sat Nov 18, 2023 6:51 am

Sat Dec 16, 2023 9:17 pm

With some excellent debugging assistance from the MegunoLink team, I have been able to resolve this issue.

Turns out the problem was of my own making as I am using my own existing CLI to detect MegunoLink specific messages and them pass them on using the DispatchCommand function.

What I was not aware of is the requirement to strip the carriage return and line feed chars on the end of the message prior to sending these on. Once this was implemented all worked as intended.
strud
Posts: 23
Joined: Sat Nov 18, 2023 6:51 am

Fri Dec 22, 2023 9:22 pm

I have found another issue relating to this feature.

In the device file pane, the modified date time does not seem to be showing up even though the files seem to have the appropriate date and time stamps.

Anyone else having this issue?
Post Reply