MacOS – Send file using wifi to the MacBook while connected to wi-fi

macosNetworksd cardwifi

just a quick question.
I've got a MacBook Air and I'm a journalist, I need the SD Card slot.

I've to switch to the new MacBook Pro and I will lose the SD Card, so I'm trying to solve the issue.

I'm planning to use a wireless SD Card (Transcend) and a ruby script on my MacBook that looks for new files on the card and download them on a folder on my Mac.

Here is the issue: everything is ok if I connect to the wi-fi hotspot created by the transcend, but of course I must connect to the wifi of the event / venue so I cannot lose the wifi connection.

At this moment I'm using the iPhone as camera and AirDrop: I can send photos to my Mac without any issue to the wi-fi connection: my Macbook receive images while connected to the wi-fi.

Is there a way to create a virtual wi-fi interface that looks for the Transcend SSID, connect to the card and download images?

I can also use a EyeFi card that act as a server, and the server is another script that runs on my Mac. This doesn't solve the problem: is my MacBook is connected to the network I cannot use the access point mode so the EyeFi can't connect.

Any idea? AirDrop work in that wy, but I cannot understand how can I create a sort of "airdrop" tunnel to connect to my card

Best Answer

In my suggestion, instead of finding one virtual interface why not you add option in your script itself to associate with Transcend before transfer and when its done it comes back to your original network.

To do this, you just add below given commands to your script.

  • Whenever script finds a new file, it force to associate the Transcend's SSID (I assume your Mac is already associated to Venue's Wi-Fi)

    networksetup -setairportnetwork en0 Transcend_SSID PASSWORD

  • This command will force to associate with Transcend's SSID.

  • Check the association

    networksetup -getairportnetwork en0

  • Once Transfer is done remove the Transcend SSID from the network and toggle the Wi-Fi power.

    networksetup -removepreferredwirelessnetwork en0 Transcend_SSID

    networksetup -setairportpower en0 off

    networksetup -setairportpower en0 on

  • According to Wi-Fi property it will associate back to your venue's Wi-Fi.

I think it might be helpful to you. It will break your connectivity with Venue's Wi-Fi for very less time as script is always running in background. Please let me know your thoughts.