(solved) upload rule remote via json or any other remote script

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

(solved) upload rule remote via json or any other remote script

#1 Post by riker1 » 09 Mar 2019, 08:38

Hi

I am wondering if it would be possible to use the flash process remote
via json
or other methodes?

Thanks T
Last edited by riker1 on 28 Mar 2019, 18:15, edited 1 time in total.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: upload rule remote via json or any other remote script

#2 Post by grovkillen » 09 Mar 2019, 09:16

You can use curl and upload a rule text file.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: upload rule remote via json or any other remote script

#3 Post by riker1 » 09 Mar 2019, 09:19

Sounds great
Naming of Textfile Just rules1.txt?
Thanks

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: upload rule remote via json or any other remote script

#4 Post by grovkillen » 09 Mar 2019, 09:28

Yep, and make sure you have the latest and greatest version.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: upload rule remote via json or any other remote script

#5 Post by riker1 » 09 Mar 2019, 15:09

Hi I am struggling with the curl command

do you have an example please?

I assume it is a curl -u upload

Thanks thomas

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: upload rule remote via json or any other remote script

#6 Post by riker1 » 27 Mar 2019, 12:56

Hi

could yo upost a template uploading rules?

It is not working for me.

Thanks T

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: upload rule remote via json or any other remote script

#7 Post by ThomasB » 28 Mar 2019, 18:01

Code: Select all

could you post a template uploading rules? It is not working for me.
Uploading rules files using curl appears to be partially broken. The main issue is that it will only work if the file to be uploaded is already named in the file system.

Try this:
1. Go to the rules tab and choose the rule set you wish to update. If it does not exist then this action will create a blank rule file in SPIFFS with the rulesX.txt naming convention. If there is already a rule file present then that is fine too.

2. Close the rules tab (exit the rules page). This is mandatory! Failure to do this will cause rules1.txt to be copied to the currently selected rules page when you use curl. {this bug caused me a lot of grief}

3. Use curl to submit the new ruleX.txt file, using this format:

Code: Select all

curl -v -F upload=@FULL_PATH_TO_RULES\rules2.txt http://IP_ADDRESS/upload
note: Change FULL_PATH_TO_RULES\rules2.txt and IP_ADDRESS with your information.

- Thomas

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: upload rule remote via json or any other remote script

#8 Post by riker1 » 28 Mar 2019, 18:14

Hi Thomas

thanks working perfect!!

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: (solved) upload rule remote via json or any other remote script

#9 Post by ThomasB » 28 Mar 2019, 18:40

Great! Thanks for confirming the workaround helped you out.

- Thomas

User avatar
schnurzel59
Normal user
Posts: 32
Joined: 18 Feb 2019, 12:41
Location: Germany
Contact:

Re: (solved) upload rule remote via json or any other remote script

#10 Post by schnurzel59 » 29 Mar 2019, 00:56

ThomasB do not Sleeping. ThomasB must be an Robot.
Greetings Martin

Oh God, my English is horrible.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: (solved) upload rule remote via json or any other remote script

#11 Post by ThomasB » 29 Mar 2019, 02:17

ThomasB must be an Robot.
Shhhush! That's suppose to be a secrete. :)

- Thomas

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 17 guests