Today we have a few new updates for you, mostly pertaining to Lua helpers and featured sequences. Here’s what’s new:
The latest version of FarmBot OS includes the following new Lua helpers, giving you even more advanced capabilities and convenience when using Lua to program your FarmBot.
- mount_tool(slot) mounts the tool provided in the argument. Under the hood, this helper uses mostly the same code as our original Mount Tool featured sequence.
- dismount_tool() dismounts the currently mounted tool into it’s assigned slot. Under the hood, this helper uses mostly the same code as our original Dismount Tool featured sequence.
get_xyz() returns a table with the current
zcoordinates of the FarmBot. This is superior to
get_position()because this new function gets the coordinates from FarmBot’s state tree rather than sending a firmware request. This allows
get_xyz()to be used in watcher functions while a movement is occurring in the main Lua process.
safe_z() returns the value of the SAFE HEIGHT setting. Note that
safe_z()on it’s own does not initiate a movement, and it should not be confused with adding a
safe_z=trueargument to a
Please refer to the documentation linked above for simple code examples of each of the new helpers!
It uses the load sensing capabilities of the Farmduino to monitor if the Rotary Tool motor goes over the max load threshold as set in custom settings. If the max load is exceeded, FarmBot will halt its movements, turn off the Rotary Tool, return to the staging position, and try again. The total number of attempts is configurable in custom settings as well.
This new sequence uses all of the latest hardware and software we’ve developed over the last year and is a culmination of what our technology stack is capable of. Let us know what you think!
And if you’re unfamiliar with the Rotary Tool, check out this video:
Because all of their code has been conveniently turned into new Lua helpers, we’ve published updates to our Mount Tool and Dismount Tool featured sequences. Now, each sequence is just a single line of Lua code! Note: Make sure you are running the latest version of FBOS before upgrading these sequences.
We’ve got one more featured sequence to share today called Wait with Job Progress Tracking, which does just what it says in the name. If you need your FarmBot to wait for a long period of time (up to 5 minutes), you can use this command and FarmBot will create a job to track the progress of the waiting. This can be useful if only to give piece of mind that things are still in motion!
- Support token life has been extended to 7 days.
- When a staff member is logged into an account with a support token, there is a second logout option to Logout and Destroy Token, allowing us to not keep support tokens active longer than necessary.