Is it possible to add new plants when OpenFarm is down?

I want to add some new plants but I get an error message (“Unexpected error occurred”.) and “No search result” when I enter the name of the plant in “Choose a crop”.

Checking openfarm.cc directly, their site is down (500 Internal Error).

Is there a way to add new plants if/when openfarm is down?

Hi @ClosedCircuit yes it is.

You ‘talk to’ the Web API directly (use whatever tool or language you’re most familiar with).

Here’s a simple example using curl on Linux which creates 1 corn plant defined in my file corn.json

jhs@debian:~$ cat corn.json
   {
      "depth" : 0,
      "device_id" : 3505,
      "height_curve_id" : null,
      "meta" : {
         "gridId" : "f1572b66-befa-420e-93bc-5c26eea11b5c"
      },
      "name" : "Corn",
      "openfarm_slug" : "corn",
      "plant_stage" : "sprouted",
      "planted_at" : "2024-04-30T14:00:00.000Z",
      "pointer_type" : "Plant",
      "radius" : 25,
      "spread_curve_id" : null,
      "water_curve_id" : null,
      "x" : 2442,
      "y" : 100,
      "z" : 0
   }

jhs@debian:~$ curl --header @jwt --request POST --data-ascii @corn.json https://my.farm.bot/api/points | json_pp
{
   "created_at" : "2024-09-08T01:09:18.784Z",
   "depth" : 0,
   "device_id" : 3505,
   "height_curve_id" : null,
   "id" : 1446554,
   "meta" : {
      "gridId" : "f1572b66-befa-420e-93bc-5c26eea11b5c"
   },
   "name" : "Corn",
   "openfarm_slug" : "corn",
   "plant_stage" : "sprouted",
   "planted_at" : "2024-04-30T14:00:00.000Z",
   "pointer_type" : "Plant",
   "radius" : 25,
   "spread_curve_id" : null,
   "updated_at" : "2024-09-08T01:09:18.784Z",
   "water_curve_id" : null,
   "x" : 2442,
   "y" : 100,
   "z" : 0
}
jhs@debian:~$ 
1 Like

Thanks John. This is really helpful.

I have been lazy until now and delayed learning how to use scripts in a farmbot environment. This could be the motivational tap on the behind that I needed.

Best

Phil

1 Like

The FarmBot Inc. Developer Documentation has the essentials but I’m happy to help to make your question “work for you” :slight_smile:

[ My example was quite crude … you can also create a bunch of Plants (of differing types) with just a single API call (put each plant object into a JSON Array); and I think you don’t need all those properties that I used in my corn.json file example ]

1 Like

Thanks a lot John. That’s very kind. It’s a very busy week but I’ll have go at creating a script next week-end.

1 Like

Just FYI, OpenFarm is back online. There was an issue with the search provider having updated a system and wiping the search indices. Sorry for the inconvenience!

1 Like

Hi Rory,

Thanks for having taken the time to post your reply. Much appreciated!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.