Android Question Problems with samba

fabian

Member
Licensed User
Longtime User
I write because I have a problem with samba library. My applicative copy files from phone / tablet about 3000 times per day. Sometimes there are weeks that no error is produced in the execution of the copies (smb.UploadFile) but there are days when mistakes (and frequently) occur. I did many tests and am having doubts that the java library CIFS works well (I have seen that the latest version is 2011). I have also doubts that the wifi in android communication is consistent. I wonder if it would be appropriate to transfer these files with FTP. Have a suggestion? .Thanks
 

Attachments

  • error.JPG
    error.JPG
    44.5 KB · Views: 127

sorex

Expert
Licensed User
Longtime User
it seems that you lost connection to the wifi when it happends?

I see 0.0.0.0 there which I guess is your current IP address?

try to add TRY commands to bypass error dumps like that so that the app can continue and try again 30 seconds later.
 
Upvote 0

fabian

Member
Licensed User
Longtime User
Sorex Thanks for the reply. The error (in the picture) is already controlled by a command try. The program is critical because it transmits orders in the restaurant environment and can not wait 30 seconds. Moreover once the error happens the connection is lost until it turns off and on the wifi. I do not know if the problem are the WIFI or samba. I use android phones samnsug with Cyanogenmod to have more reliability. So I want to know if samba is reliable or perhaps be better to use ftp (or other method of transmission).
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
also make sure you add logging to the try/catch so that you can figure out why it's giving errors.
 
Upvote 0

fabian

Member
Licensed User
Longtime User
I have checked the IP 0.0.0.0 (indicated by sorex) holds in almost all situacions wifi error (for example if I turn off the access point) which is not true because the ip phone is fixed.
After doing a lot of testing I have come to the conclusion that when a very intensive use of the library is samba, communication is lost. This is solved by turning off and on the wifi on the phone / tablet. For now I control this problem by having the program turn off and on wifi and then re send the file.
Therefore wondering if anyone had tried the FTP library. Any other suggestions? Thanks in advance for the answer.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
there much more going on with smb than with the ftp protocol. ftp was kept lightweight for simple file transfer purposes so it will probably work better/faster for your POS tool. It probably has better error handling aswell.

another benefit is that you can probably leave the ftp session open and just transfer data.

which is again less overhead compared to sending data via http.
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
Upvote 0

fabian

Member
Licensed User
Longtime User
Thanks for the answer. The WIFI setup is always active. I use Cyanogenmod on devices to have a cleaner and reactive Android. I have also configured the access point at different frequencies, but the problem appears before or after. I have also tried access points and phones / tablets of different brands and dd-wrt for access point (for greater setup) but nothing changes.
I've taken a wifi lock type solution (when the error happens I turn off and turn on wifi and after connect to ssid). For now it works .... Thank you all for the help ..
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
First I'll start by saying that I'm not a networking expert, but it does sound to me like the connection is dropping out. Having searched for this type of problem I've found others having the same issue on Windows PC's... http://en.kioskea.net/forum/affich-12116-connection-keeps-timing-out
You've already stated that you use a fixed IP and so it can't be down to a dhcp lease time setting but it might still be worth delving into your router settings to see if you can find anything that might be causing the connection drop out.

Regards,
RandomCoder
 
Upvote 0

fabian

Member
Licensed User
Longtime User
Thanks for the answer. I think I have tried everything I know about networks and IEEE 802.11 protocol and also different types of configurations, tablets, phones, and routers / access points . Some perform better than others but I have come to the conclusion that live with this problem in this technology (this happened less times with win ce devices). Android has evolved very fast but makes much more things. Thank you for your cooperation.
 
Upvote 0
Top