When I run the “Read and Write Parameters” pymavlink script example provided on the Ardusub site (Pymavlink · GitBook), I receive a heartbeat but then the code hangs at this point in the script and does not print:
# Print old parameter value
message = master.recv_match(type='PARAM_VALUE', blocking=True).to_dict()
print('name: %s\tvalue: %d' % (message['param_id'].decode("utf-8"), message['param_value']))
I am running the script on a topside computer. Any help much appreciated.
Note that the “Receive data and filter by message type” script does work. I am able to receive data.
Hey Jacob np. Yes still have this issue. Ultimately we would like to modify this script to change the rate at which we receive depth data using the SRn_RAW_SENS parameter.
Did you change something in the example script ?
Can you run and share the output ok Read all parameters example ?
If you are having delay problems, try to increase the time in sleep functions.
Hi Patrick, we have not modified the script. We are using the “Read and Write Parameters” script. The script hangs at this line and does not return a message:
# Print old parameter value
message = master.recv_match(type='PARAM_VALUE', blocking=True).to_dict()
Ultimately we’d like to modify this code to change the SRn_RAW_SENS parameter to 10 Hz so that we can obtain a faster depth reading. Any help on this is appreciated. Once again the provided example “Read and Write Parameters” script here (Pymavlink · GitBook) hangs at this line:
…
Did you change something in the example script ?
No
Can you run and share the output ok Read all parameters example ?
Output:
<pymavlink.dialects.v10.ardupilotmega.MAVLink_heartbeat_message at 0x7f7925a050>
and then I receive a blinking cursor in the terminal indefinitely.
If you are having delay problems, try to increase the time in sleep functions.
There’s no delay problem. The script simply hangs.
This happens in both examples ? Or just in Read and Write ? Did you increase the delay ?
Yes, this happens in both scripts. Changing delay does not help.
Are you able to run this script on your pi+pixhawk setup? This problem occurs on both of our separate pi+pixhawk setups
Thanks for the help!
That is weird…, both scripts does not print the pymavlink message, but a simple string, you can check that read all parameters and read and write parameter scripts contains the follow print functions:
You can see in this simple record that both scripts are working fine in a fresh companion image:
Try to update your pymavlink library with sudo pip install --upgrade pymavlink or a fresh install of the companion image.
Besides that, I can run both scripts fine with Python 3.7.0 with pymavlink 2.2.10 and 2.2.20. Python 2.7.9 with pymavlink 2.2.4 and 2.2.20.