Live data from Hacker News

Open Source Farming Robot

farm.bot

21–30 of 369 posts

Re: Open Source Farming Robot

#23
post #5

It's written in Elixir. Maybe it's just a grass-is-greener thing but the more Kubernetes I have to stomach, the more interested I become in BEAM languages like Elixir. Not like they're alternatives exactly, but I get the feeling that the BEAM way is to solve the ops problems in a way resembles how you solved your dev problems. More holistic, less ad hoc.

Can you elaborate? I’m intrigued.

Well, you're hearing it from a guy who has written hardly any Elixir or any other BEAM language. (For a proper intro I recommend this video https://youtu.be/JvBT4XBdoUE). Less practitioner, more fanboy. So I may not be the best source. But I'll try anyhow.

The BEAM is a virtual machine, I guess kinda like the JVM. So just like you can write Java or Kotlin or Clojure or a million other JVM languages, so too can you write Erlang or Elixir or Gleam (I like the look of Gleam)... And expect similar interoperability.

The BEAM has its roots in the telecom world. So while Sun Microsystems was doing the Java thing to make webservers or applets or whatever for the JVM, Ericcson was doing Erlang things to make things like long distance phone calls happen on the BEAM.

(I'm not a fan of Java, I just think it's a decent thing to compare with in this case)

The BEAM folks take a different approach to concurrency than is common elsewhere. BEAM processes are much more lightweight than OS processes, so while it might be insane to run a separate copy of your server for each user, it's less insane to run a separate BEAM process for each user.

BEAM processes interact through message passing. Of course most other processes do to, but only because the developer built it that way. With the BEAM it's built in, each process periodically checks its mailbox for a message which matches its criteria, and if there's no message, it sleeps until it is revisited by the scheduler. There's no async/await business. They're all single threaded and sequential. Instead, you achieve coordination by having many of them, some of which are in charge of starting/stopping/organizing others. (I guess they build structures out of these things called "supervision trees" but I don't precisely know what that is).

This has all grown up in a world where nodes are expected to be physically separate (like either end of a phone call) so you end up with a bit more fault tolerance than if each process is expected to be on the same machine.

In Kubernetes you've got this mountain of yaml which you craft to tell the container orchestrator how to treat your app. And then you've got your app itself which is probably not written in yaml. So I find it very jarring to switch between my dev hat and my ops hat.

And Kubernetes... That's Google's baby, right, so it makes sense that it doesn't feel the same as the underlying app. As a cloud provider, they need a rather high wall between the app and the infra. But I think it causes all kinds of problems. At least in my world, the apps are either in Python or Go, so when there's a problem someone will come along and solve it with yaml-glue to add an additional container which may or may not resemble the app which has the problem.

My brain struggles to hop from Python to Yaml to Go (and there's usually some bash in there too).

The BEAM, by contrast, expects processes to start and stop other processes. So your orchestration logic and your application logic are in the same language. You don't have to express your wishes in yaml and then navigate all of these superfluous layers (e.g. the container entrypoint script, port forwarding, in-cluster DNS, etc) to have your wish granted. That kind of communication is handled by the BEAM's inbuilt message passing system.

If I got to rebuild our stack from scratch I'd use Kubernetes as a cloud-provider-agnostic interface to get access to compute, but instead of expressing anything about the app in YAML, I'd handle all of that extra stuff (e.g. log scraping, metric aggregation, whatever hacky fix is needed today...), I'd handle it in the BEAM, right alongside my app.

People like to say "build security into the app" or "build observability into the app", but standard practice is to bolt on solutions that don't resemble the app at all. My (probably flawed) perspective is that if you scratch those itches within the BEAM, then you're going to end up with fewer superfluous layers of abstraction. Also fewer distinct niches that you now must find a specialist to fill when the old one quits. Also, you end up more in control of your app because since you more or less wrote the orchestrator, you're relying less on the cloud provider to be a reliable puppet master.

---

It's slow going, one class per semester, but I've been taking biology classes on the side. I sometimes think about making a break for it and trying to build something like farmbot but for driving a microscope, or a pipette, or maintaining the temperature/pH/etc in a bioreactor.

These are, for now, just dreams.

Sorry for the diatribe, but you did ask me to elaborate :)

Re: Open Source Farming Robot

#25
post #6

For some values of "open source": the datasets used for information about the plants and such are unavailable as of the last time I checked.

You can probably get anything you need from practicalplants

Re: Open Source Farming Robot

#26

How many Farmbots would I need to feed 2 adults and 2 children year round? What challenges might I run into? Edit: Found a link to yield analysis https://farm.bot/pages/yield It appears the answer is however many Farmbots cover 549 square meters

You'd be better off doing the farming the old fashioned way if the goal is to feed a family. Farming is a terrible business to be in today, but that's mainly due to the abysmal profit margins. When your goal is to feed your family rather than turn a profit, that stops mattering. Most people with any yard or outdoor space could get to the point of growing/raising a large portion of their own food without too much inve…

I've talked about this on this site over the years. My family is close to providing enough food on its own little farm for the whole family, all year (except dairy products and wheat products).

It has taken decades. And about 15 acres. And honestly I don't know how many hours. Tens and tens of thousands.

You can grow a small amount of your own food "without too much investment or work". To replace a substantial portion of your food with home grown takes a shit load of work and time.

Re: Open Source Farming Robot

#27
I can't help but feel like this is a satirical send up of "tech bros solve farming," except it's not satire.

I am a software engineer, I also runs a small family farm. I have 3d printers and laser cutters and lots of aluminum extrusion and raspberry pis... but I keep those things indoors, away from the dirt, sun, and rain. I can't imagine a real farmer using a contraption like this. Tools have to be reliable to last. I have to replace my solid steel shovels every few years because they wear out, how is this supposed to work?

Re: Open Source Farming Robot

#29

Earlier quoted context omitted.

why not?

To each their own, but small gardens like this are about the journey, not the destination.

You just stated two contradictory things :).

> To each their own

I agree. Some people might just want to be in control of where there food comes from.

> but small gardens like this are about the journey, not the destination

Again, to each their own. Also, coding a robot to automate gardening is a journey as well.

Re: Open Source Farming Robot

#30
It sill looks like the software is written by people who don't know how to care for plants. You don't spray water on leaves as shown in the video; you'll just end up with fungus infestation. You water the soil and nourish the microorganisms that facilitate nutrient absorption in roots. But, I don't see any reason the technology can't be adapted to do the right thing.
Post reply on HN