Do get a file from a core to a PC, you can just use the REST interface like this: import urllib.request
import ssl
import json
ssl._create_default_https_context = ssl._create_unverified_context
def auth():
head = {
"Content-Type": "application/json",
"Accept": "application/json",
}
body = {
'name': 'boschrexroth',
'password': 'boschrexroth',
}
data = json.dumps(body).encode("utf-8")
req = urllib.request.Request('https://192.168.1.1/identity-manager/api/v2/auth/token', data, head)
with urllib.request.urlopen(req) as f:
res = f.read()
resonse = json.loads(res.decode())
return resonse['access_token']
def download(token, name):
opener = urllib.request.build_opener()
opener.addheaders = [('Authorization', 'Bearer ' + token)]
urllib.request.install_opener(opener)
urllib.request.urlretrieve("https://192.168.1.1/solutions/files/DefaultSolution/configurations/appdata/" + name, name)
token = auth()
download(token, 'configuration.json') Modify the IP-adress and filenames according to your settings. This can download files from the APP data folders of the core, in the example above the configuration.json file:
... View more