June 21, 2023 Software Update
Hello FarmBot community, and happy Solstice 🌞 Today we have a very cool app update to share with you all, as well as a few other newsworthy items. Here’s what’s new:
You can now automatically generate Lua code for use with your FarmBot! To start, press the new magic wand button 🪄 in a Lua step header, describe what you would like the code to do in plain language (or use one of the example prompts), and then click GENERATE CODE.
Behind the scenes we’ll query OpenAI’s
gpt-3.5-turbo-16k API with:
- Your prompt
- Our entire written Lua developer documentation
- Names and pin numbers of all your peripherals, sensors, and tools
- Some extra prompt engineering
Within seconds you’ll see commented Lua code streaming into the code field.
Once the generation is complete, you can review the code and make any necessary modifications, rate the generation, save the sequence, and try it out! If you don’t like the first generation, you can always tweak your prompt and try again.
By including the names and pin numbers of all your peripherals, sensors, and tools automatically, you can ask things like “Turn on the lights” and the AI will understand which pin number to operate.
Code comments will be written in the language set by the new LANGUAGE field in your account settings. By default this is set to English, but our international users are welcome to use their preferred language for more easily understanding the generations. You can also write prompts in your preferred language!
This new feature aims to make our Lua API and its advanced capabilities much more accessible to less technical users, those who are still learning, developers who don’t speak English as their primary language, and more. It is also useful for speeding up the development of unique and interesting use cases that may use 3rd party APIs or use FarmBot in non-standard ways. We look forward to seeing what you all do! Just remember to always review and test auto-generated code.
Got writer’s block giving your sequence a clever name and useful description? Just click the new magic wand buttons 🪄 to have an AI write these for you as well as choose a fitting color for your sequence. Colors will be chosen based on the primary interpreted concern of the sequence:
- Red for removing weeds or error conditions
- Green for taking care of plants
- Yellow for lights
- Blue for watering
- Orange for warnings
- Purple for logic, data manipulation, or using 3rd party APIs
- Pink for taking photos, detecting weeds, or measuring soil height
- Gray if the sequence is neutral in its action or there is not a clear primary concern
You can now edit the STATUS and START DATE of new plants before adding them to the map.
Water, spread, and height curves (as well as status and start date) will now be applied to plants added through the Grid and Row planting fields.
You can now use the
mount_tool() helper with a tool’s name rather than the tool object. For example:
-- Mount a tool by name mount_tool("My Tool")
To make the aforementioned AI Lua generation possible, we significantly improved our Lua developer docs with additional code examples, clearer descriptions, and more consistent formatting.
We’ve overhauled our seed selection guides in the FarmBot Genesis and FarmBot Express documentation hubs. You’ll now find that we recommend using pelleted seeds whenever possible because their coating provides a consistent spherical shape that improves the reliability of handling by machinery such as FarmBot.
We have also added product safety information to the documentation to outline the hazards associated with assembling and operating a FarmBot, the certifications the product has, and the built-in safety features.
Earlier this month we attended SAP Sapphire 2023 in São Paulo, Brazil to see how SAP built a custom dashboard and integration with FarmBot to demonstrate the power of intelligent agriculture. Under the hood they used farmbot-js and our other open-source resources to make their demonstration possible. Check it out: