Making HTTP requests from scripts

Results 1 to 4 of 4

Thread: Making HTTP requests from scripts

  1. #1
    Member theRat's Avatar
    Join Date
    Jun 2017
    Location
    Australia
    Posts
    143
    Downloads
    0
    Uploads
    0

    Default Making HTTP requests from scripts

    Is it possible to make HTTP requests from within scripts?

    I have a bad habit of forgetting to turn my compressor off at the end of the day, and because of a slow leak somewhere it decides to start up in the middle of the night and annoy the neighbours. So I am about to install some Sonoff smart switches so that I can ensure that it gets turned of at the end of the day. These switches have an HTTP api among others that allow control across the network. What I would like to do is have PlanetCNC also turn the compressor on at startup and off at shutdown using scripts. I am also installing a smart switch on my shop vac so that it can be controlled remotely so being able to turn that on/off in scripts would also be useful.

    Cheers
    Simon

    Similar Threads:


  2. #2
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1295
    Downloads
    0
    Uploads
    0

    Default Re: Making HTTP requests from scripts

    Yes, this is possible. TNGv2 fully integrates Python on several levels and with Python this is a piece of cake.
    When I'm done with high priority tasks I'll make some examples/tutorials.



  3. #3
    Member theRat's Avatar
    Join Date
    Jun 2017
    Location
    Australia
    Posts
    143
    Downloads
    0
    Uploads
    0

    Default Re: Making HTTP requests from scripts

    Thank you. I was just about to post that I figured out how to do it using Python. There is no rush for this as I am waiting for the Sonoff devices to ship and then I will have to deal with installing them before I can do much more with PlanetCNC to integrate them.

    Thanks
    Simon



  4. #4
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1295
    Downloads
    0
    Uploads
    0

    Default Re: Making HTTP requests from scripts

    Oftopic:
    In API examples is Arduino project showing how to create custom USB expansion board for TNGv2. This might also be an interesting thing to play with.



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Making HTTP requests from scripts

Making HTTP requests from scripts