Android Question 'How to' file transfer via Mqtt ?

amorosik

Expert
Licensed User
How to use mqtt communication for file transfer from Android to Pc and viceversa?
On 'payload' is possible to push entire file?
 

BillMeyer

Well-Known Member
Licensed User
Longtime User
I don't think MQTT was designed for this although you could transfer a file but then you need to keep the protocol size limitation of 260MB in mind when setting thus up as well as possible perceived speed issues.
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
MQTT can be lossy as well, you'd need to devise and implement your own transfer protocol -- something like X-Modem or Z-Modem I would think.

I had a project that needed something similar. I used a common FTP site that housed the files and used the MQTT to broadcast that the file was ready for FTP transfer. Those devices that needed it would see the broadcast and then download and process it.
 
Upvote 0

amorosik

Expert
Licensed User
MQTT can be lossy as well, you'd need to devise and implement your own transfer protocol -- something like X-Modem or Z-Modem I would think.
I had a project that needed something similar. I used a common FTP site that housed the files and used the MQTT to broadcast that the file was ready for FTP transfer. Those devices that needed it would see the broadcast and then download and process it.

Your ftp file can transfer file from Android (linked via public telephone network) to pc?
Did you say that ftp pc client can alway connect to ftp server on Android?
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Your ftp file can transfer file from Android (linked via public telephone network) to pc?
Did you say that ftp pc client can alway connect to ftp server on Android?
FTP is FTP, doesn't matter where it is hosted. Coding-wise, network is network, it doesn't matter if it's cellular, Wi-Fi or Ethernet cable. The only differences are throughput and reliability. In my particular case, the FTP site was hosted by a 3rd party, my server uploaded files there, broadcast the MQTT and the devices downloaded from the same FTP site. We had devices using cell network and some using office wi-fi.

I don't know if this is the "most current" example but take a look: [B4X] Net library (FTP, SMTP, POP) with Wait For | B4X Programming Forum
 
Upvote 0
Top