I'm trying to send files to a remote modem using unetstack. Right now i have the following python script:
from unetpy import *
import sys
if len(sys.argv) != 6:
print("Usage: python3 ac_sender.py <source_ip_address> <port> <destination_address> <timeout(ms)> <filename>")
sys.exit(1)
ip_address = sys.argv[1]
port = int(sys.argv[2])
node = int(sys.argv[3])
timeout = int(sys.argv[4])
file_name = sys.argv[5]
sock = UnetSocket(ip_address, port)
gw = sock.getGateway()
req = RemoteFilePutReq(to=node, filename=file_name)
resp = gw.request(req, timeout)
print(resp)
But it is not working.I execute the scrip and it ends when the timeout returns. The response is None. There are no logs on the side of the remote modems. And the file is not uploaded. And yes the system arguments are being set correctl What am i doing wrong?
Suppose you want to send a file from modem A to modem B. Ensure that you enable the remote functionality on destination modem B by using the command
remote.enable=true. Once remote is enabled, you can utilize the Python class below to initiate the file transfer between the two modems.You can check the logs on remote by enabling
subscribe remote.