emoncms 9.0 api - set processlist

Hei all,

Im hosting my own emoncms on a embedded computer and therefore am using a low-write version. I now wanted to switch to v9, because of the obvious improvements especially for the low-write merge and had one small problem while updating my api implementation:

Since the newest get/set/reset processlist api alteration I am no longer able to change process settings of an input via api... I am able to do it by hand, and every other api command except for the low-write restricted ones work.

Further I even am able to retrieve the correct input list of manually configured processes with "input/process/get.json?inputid=1" to get something like "3:10,1:1", but setting the same string "input/process/set.json?inputid=1&processlist=3:10,1:2&api... to log e.g. to a different created feed, returns false "Input processlist was not updated". Which indicates, that mySQLs affected_rows returned 0 ?

 

I sadly am not very advanced with php and its handling of mysql and at this point dont know what could cause this. Should this work on a freshly set up low write version? I completely reset mysql and redis and gave emoncms permission to a @localhost mysql user, so I can only imagine for it to be some internal restriction, maybe connected to the redis usage?

If anyone can help me here, even though it kinda is a beta-first-world-problem I really would appreciate it^^

 

Thanks

Ed

chaveiro's picture

Re: emoncms 9.0 api - set processlist

That processlist set actions were changed to pass the processlist parameter by POST.

 

Ed Ryan's picture

Re: emoncms 9.0 api - set processlist

Well that was fast and easy and helpful.

Thank you very much :)

thehellodonkey's picture

Re: emoncms 9.0 api - set processlist

Apologies if I'm being daft, but I'm hoping that someone can spell this out a little more. I'm trying to set processlists via API on a local emoncms v9.1 instance without success. I've tried many different variants of the below:

  1. Create Feed Request: http://192.168.1.100/emoncms/feed/create.json?tag=Node%2001&name=node:Te......
  2. Set Input Processlist
    1. Set Input Processlist POST URL: http://192.168.1.100/emoncms/input/process/set.json?inputid=27&apikey=XXXXXX...
    2. ​Set Input Processlist POST Body: processlist=1:67

Step 1 creates a feed successfully (feed 67 in this example), but I always get a response from step 2 saying 
{"success":false,"message":"Input processlist was not updated"}. Other attempts along this vein have included the processlist parameter in the ...&processlist=1:67&... URL format to no avail.

I've been beating my head against this aspect of the API for some time and would hugely appreciate any help/suggestions! 

Thanks to Chaveiro, Glyn, Trystan, the rest of the developers, and forum participants for the excellent software!!!

chaveiro's picture

Re: emoncms 9.0 api - set processlist

Updated on 9.2

thehellodonkey's picture

Re: emoncms 9.0 api - set processlist

I've updated to 9.2 and am receiving the same response. Any further suggestions?

Thanks!

chaveiro's picture

Re: emoncms 9.0 api - set processlist

Is the error you are reffering  {"success":false,"message":"Input processlist was not updated"}?

Are you setting the processlist to anything different from what it already has?

thehellodonkey's picture

Re: emoncms 9.0 api - set processlist

For posterity:

Yes, that is the error that I've been getting. My objective is to create the first processes, e.g. changing processlists from "" to "1:67". 

(Partial) Resolution:

It seems that my problem was related to the way in which I was POSTing. Making the requests in Postman (Postman - REST Client, no affiliation) worked on the first try. 

Thanks for you help, Chaveiro!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.