Home        Store        Docs        Blog

Pymavlink read and write parameters code example


(Tim) #1

When I run the “Read and Write Parameters” pymavlink script example provided on the Ardusub site (https://www.ardusub.com/developers/pymavlink.html), 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.

Thanks, Tim


(Jacob) #2

Hi Tim, we’ve been busy!

Are you still having trouble here?

ping @patrickelectric


(TMJ) #3

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.


(Patrick José Pereira) #4

Hi,

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.


(TMJ) #5

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()

(Patrick José Pereira) #6

This happens in both examples ? Or just in Read and Write ? Did you increase the delay ?


(Jacob) #7

What version of ArduSub and pymavlink are you using?


(TMJ) #8

Ardusub 3.5.2
pymavlink 2.2.8
We are able to reproduce the problem on two separate pi + pixhawk setups.