Mission Planner Build 1.3.81 Error

I’m sorry but I think you have it wrong Andras, this is how I believe it should be …
How else would it know what the command ID is? In this case 1720 is a servo PWM value required at that location.
DS3

Nope, the Command column has the value 217. It is just converted to textual representation.
ID is not the ID of the mavlink command, but it is the first parameter of the DO_SEND_SCRIPT_MESSAGE command which is happened to named ID in the mavlink command definition.
P1 is the second parameter of the same command… and so on…


Look at the first column of the definition above Param (:Label)

Then what is “unit16 ID value to be passed to scripting”?

that is 1720 in your case…
DO_SEND_SCRIPT_MESSAGE command passes four parameters to the script. one uint16 (labeled ID) and three floats.

-- receive mission command from running mission
---@return uint32_t_ud|nil -- command start time milliseconds
---@return integer|nil -- command param 1
---@return number|nil -- command param 2
---@return number|nil -- command param 3
---@return number|nil -- command param 4
function mission_receive() end

When I select ‘Add Below’ and select UNKNOWN it asks me for the Command ID which in my case is 217, how will D_S_S_M know the command id if I don’t tell it, or is command id always 217?

Yes, the id of the D_S_S_M command is 217.
image
The same way if you select WAYPOINT, then the commandID is 16

According to this, my example of setme column 1 value of 1720 should fall under “param 1”
– receive mission command from running mission
@return uint32_t_ud|nil – command start time milliseconds
@return integer|nil – command param 1
@return number|nil – command param 2
@return number|nil – command param 3
@return number|nil – command param 4
function mission_receive() end

Exactly.

Again: you pass param1, param2, param3 and param4. param1 is labeled ID, but you put whatever you want into it, param2 is labeled P1…
In the script you receive param1, param2, param3 and param4… labels are just for setting the table header.

Andras, please Sir, can you not see the insanity of this … “param1 is labeled ID, but you put whatever you want into it, param2 is labeled P1…”?

No I don’t. There is only one command can send values to scripting, it is MAV_CMD 217, DO_SEND_SCRIPT_MESSAGE. Which sends a message to the script with three parameters.

In the definition of that message the four numbers that you can send are called ID, P1, P2, and P3. The logic behind it is if you want to send messages to the script that triggers more than one functions, the you have to differentiate them, and for that is it logical to use the first integer parameter, this is why its called ID. However lousy script programmers who use it only for one type of message used the ID for else.

param1-param4 are the fields for the MAVLINK COMMAND,
id, p1, p2, p3 are the name of these fields when the command is a DO_SEND SCRIPT_MESSAGE

Thank you Andras, the good news is that the way you say it is I don’t have hours and hours of editing to do on all my saved flight plans.