#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2017
    Posts
    6
    Rep Power
    0

    data push from logger to server


    Hello,

    I have a data logger (electrical meter for a building) that is capable of pushing data to a server URL. The technical documents state that the logger uses HTML POST and it will transmit the data in XML format.

    I have a Python script that I want try and use that will parse the data from XML to CSV, but I dont know what I need to do on the server to make it ready to accept the data.

    Do I need to setup the server as an HTML server? Or what is the server side web development would need to be done in order to do this? Ultimately what I am trying to do is setup a server to continuously collect & log the data in a database.

    Any recommendations for this would be greatly appreciated on setting up the server & database options... Ill also need to get some help from experience developers with this but I first need to know the basics!

    Thanks!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,340
    Rep Power
    630
    Yes, you will need an HTML server process the URL and execute your script. You can make the Python code a CGI script and reference it directly in the URL for the client link that is posting the data.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2017
    Posts
    6
    Rep Power
    0
    Thank you for the response.

    Could I just download something like Apache HTML server and install it on the machine that I am looking to store the data? Or what else could I use for the server software? (Anything free?)

    This link below is the Python script that I found on Github that will handle parsing the data from XML to CSV. Can you tell me how I can get this Python script to run on the web server automatically? Does run in the browser or do I need to just install Python on the web server? In the Python script I cant find a URL even in the script to modify for the application I am using.

    https://github.com/thecardcheat/egau...thon/eGauge.py
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,340
    Rep Power
    630
    Apache is an almost universal HTTP server for Linux. It is also available for Windows Server but not as common. Mainly because a Linux server is much easier to configure and safer to run. You will need Python installed along with the appropriate libraries to run that script.

    That github script is just a set of function calls to process the data. You will need to write a 'main' that will accept the data from the client and call the appropriate function and do whatever. Once Apache is properly configured you can reference the main script directly in the URL on the client side.
    Last edited by gw1500se; May 2nd, 2017 at 10:31 AM.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2017
    Posts
    6
    Rep Power
    0
    Can we use Ubuntu desktop to run the Linux server? We have Linux setup on a desktop computer with Ubuntu 16.04

    I ran across a "how to document" on how to install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04

    This seems like it will at least get us marching down the correct path... Hopefully!? Thanks for your help.. We also have Python installed on this machine for another program written in this language
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2017
    Posts
    6
    Rep Power
    0
    Could we do anything with web2py for this application on our Linux machine?
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,340
    Rep Power
    630
    Yes, Ubuntu is very common and as good as any other NIX.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.

IMN logo majestic logo threadwatch logo seochat tools logo