How to Make the FarmBot Travel a Grid Using Lua

Hi everyone,

I’m looking for advice on how to program my FarmBot to travel across a grid pattern efficiently using Lua. My goal is to have it cover the entire area systematically, moving from one point to the next in a structured way (like a serpentine or zig-zag path).

I know how to program in many languages, but when using Lua scripts on the FarmBot, I’ve noticed there are a lot of limitations. I’d like to set the following parameters in the script:

  • Starting point (x, y)
  • Grid dimensions: width and length
  • Number of columns and rows

Does anyone have experience setting this up with Lua? I’d appreciate tips on:

  • The best way to define the grid coordinates
  • Optimizing movement to reduce unnecessary travel time
  • Any Lua scripts or FarmBot sequences that could help with this

Thanks in advance for your help!

Hi @nbourre

Have you looked at this ?
March 4, 2022 Software Update - Announcements - FarmBot Forum

2 Likes

Thanks! I just found out about this script.

Is it possible to automate it such as “Take the soil humidity at every cell on the grid” everyday at X o’clock.

@nbourre

Yes, such time-scheduled automation was built into the Web API and FarmbotOS years ago.
Use Farm Events to do this job.

Take a copy of that Grid Sequence and modify the Lua to do the actions you need, then
use this modified Sequence for your Farm Event.