Random error in watering sequence with curve

Hi all,
I’ve been having an issue lately with my watering sequence that I would love some help with.
I wrote a watering sequence for my garden (written in the end) that goes through each plant and retrieves its water curve, age and dispenses the appropriate amount of water, and another sequence that executes that on the group variable “all plants”. It works just fine most of the time yet every now in then it will get stuck on a random plant, toast an error and quit the sequence, giving up on watering the next crops.

The errors:
{:lua_error, {:illegal_index, nil, “day”}, {:luerl, {:tstruct, %{0 => {:table, {:array, 0, 10, nil, 10}, {{{{{{:empty, “_G”, {:tref, 0}, :empty}, “_VERSION”, "Lu

image

I made sure all plants have a planting date, and since it is working most days I’m confused about what the error could be. Any thoughts? Thank you!

plant = variable(“plant”) – has an externally defined variable named “plant”
move_absolute(plant.x - 50, plant.y, -300) – compensate for water nozzle size on x axis
if plant.water_curve_id and plant.age then
water_curve = get_curve(plant.water_curve_id)
water_ml = water_curve.day(plant.age)
dispense(water_ml)
else
toast(plant.name … " at location (" … plant.x … ", " … plant.y … “) has no assigned water curve/age. Watering 100ml”, “warn”)
dispense(100)
end
wait(2000)

Hi @Oma I think the screenshot of the errors gives some answers.
The Lua script failure is sure to be caused by the NETWORK ERROR: “HTTP CLIENT ERROR - See log for details” event.

I’d be checking the Wi-Fi strength at the bot around the time of day when this sequence runs . . the Web App will indicate this (provided the bot is online !). Press the top CONNECTIVITY button and then the NETWORK button and the strength will be in the left drop down panel.

1 Like

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