Filecopy wifi question

fatman

Active Member
Licensed User
Longtime User
Hi everbody,

I have written an application for a datalogic memor barcode-scanner. The purpose is taking orders during shows and exhibitions.
Everything is working fine. But I am facing difficulties sending files from the device to my notebook via wlan using an accesspoint.
- The wlan has been tested
- I can access the shared directory on my notebook with another notebook

This does not work: FileCopy (fname, "\\192.168.0.210\transfer\" & fname2 ) :BangHead:

Fname is a nortmal filename like this: app.path + ABC.CSV where as \\192.168.0.210\transfer\" & fname2
transfer ist the shared directory on my notebook.

Has anybody had the same probs in the past?

Has filecopy a problem with paths like that: \\192.168.0.210\transfer\ ?

Any hints are highly appreciated...

Thanx fatman
 

linum

Active Member
Licensed User
Hello. i once had the same issue trying to copy a file over wlan. I ended up noticing that it takes about 15 seconds for the device to see the target DIR so I ended up doing a simple loop to like this:


B4X:
MyWLANDirectory = "\\60fs\MyFilesDIR"

Do Until DirExist(MyWLANDirectory)
    
Loop



Maybe there is a better way of doing this, I don't know but this worked for me.
 

linum

Active Member
Licensed User
In my original code I also used a Timer to create a Timeout routine to escape the loop in case it went over 18 seconds. Here's the exact code I used in my program:

B4X:
Sub Globals
   'Declare the global variables here.
   Twifi = 0
   
End Sub

Sub CopyToWIFILocation_Do   
      
      Twifi = 0
      Timer1.Interval = 800
      Timer1.Enabled = True
      wifiLocation = "\\60fs\SHARED\Plant\Safety\_DB"      
      Do Until DirExist(wifiLocation) OR Twifi = 18 'Set to 18 seconds      
         DoEvents
      Loop      
      If Twifi >= 18 Then
         Msgbox("Unable to Establish a WIFI connection with your Network.")
         Twifi = 0
         Timer1.Enabled = False
         WaitCursor(False)
         Return
      End If

      'Place your FileCopy Code HERE

End Sub

Sub Timer1_Tick
   
   Twifi = Twifi + 1
   
End Sub
 
Top