Python Forum
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
data push from logger to server
#1
Hello,

Newb question here...

I'm trying to figure out how to push data from an electrical meter that is capable of sending XML to a server thru HTML POST.

I have a python script that Im interested in trying that can parse the XML to CSV, but for starters on the server end do I need to setup the server as an HTML server? Any recommendations on what to use? Like Appache or something similar setting up the server to accept the data push from the device to a server URL?

Thanks


my code here
Reply
#2
Any web framework can accept xml as a post. To get started quickly, check out Flask: http://flask.pocoo.org/
Introducing apache/nginx depends on what your goals are. If this is exposed to the internet, then maybe. If it's just running locally at your home/business and isn't accessible outside the intranet, that might not be needed.

If you want to put a little more work into the server end of it, Twisted is also a good networking library: http://twistedmatrix.com/trac/
Reply
#3
Quote:but for starters on the server end do I need to setup the server as an HTML server?
You can test all out locally Flask as posted over has a build in web-server.
Here a demo.
python app.py in browser http://127.0.0.1:5000/.
So getting a value from XML when push a button(call a Python function on the server side).

If you all new to this and web-development stuff with Python there is a learning process.
When it comes deploy,here some stuff that i like.
Gunicorn with Nginx(better than and easier than Apache) on host Digital Ocean.
There are host like PythonAnywhere and AWS Lambda Zappa,
they do all server side setup for you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Push Button on website cg1980 1 419 Feb-07-2024, 01:25 AM
Last Post: snippsat
  Sending data from a websocket client to another server lemon 1 3,602 May-25-2020, 02:26 PM
Last Post: lemon
  Automated Git add/commit/push rxndy 0 2,034 May-13-2019, 11:51 AM
Last Post: rxndy
  logger saisankalpj 3 3,160 Jun-27-2018, 07:12 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020