-1

I have a raspberry that measure some values through a Python script. I want to send all values to a server where I stored them in db.

What do you propose to use? (possibly an encrypted transfer).

The size of the strings has few bytes. Periods is 1-5 minutes.

2 Answers 2

0

Just connect straight to the remote database and update it, here are some setup instructions

Or open an SSH tunnel using paramiko from the raspi and do it that way I suppose. That will allow for an encrypted channel.

Sign up to request clarification or add additional context in comments.

Comments

0

As suggested before, connect to the DB directly.

Otherwise, in case you already have a web application you want to/must use, you can use Requests

Here it shows how to post data in several ways, e.g.

as form fields

>>> payload = {'key1': 'value1', 'key2': 'value2'}
>>> r = requests.post("http://httpbin.org/post", data=payload)
>>> print(r.text)
{
  ...
  "form": {
    "key2": "value2",
    "key1": "value1"
  },
  ...
}

or json-encoded

>>> import json
>>> url = 'https://api.github.com/some/endpoint'
>>> payload = {'some': 'data'}

>>> r = requests.post(url, data=json.dumps(payload))

Requests supports use of HTTPS/SSL.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.