Home        Store        Docs        Blog

Ping Altimeter simulator script

(Leon Steijger) #1

Hello

I am trying to implement the ping altimeter into my software and I was trying to use the Python simulator to send some sample data over the UDP port. For some reason the following error is returned:

Traceback (most recent call last):
  File "./ping1d-simulation.py", line 162, in <module>
    sim.sendMessage(PING1D_PROFILE)
  File "./ping1d-simulation.py", line 76, in sendMessage
    msg.pack_msg_data()
  File "/home/leon/.local/lib/python2.7/site-packages/brping/pingmessage.py", line 477, in pack_msg_data
    self.msg_data = bytearray(struct.pack(msg_format, *values))
struct.error: argument for 's' must be a string

I am not into Python, but could somebody guide me into the right direction ?

Leon

0 Likes

(Patrick José Pereira) #2

Hi Leon,

Try with python3, python2 will retire in 9 months.

0 Likes

(Leon Steijger) #3

Hello Patrick,

Thanks, it now runs. What do I have to change to send the UDP packets to another host ?
Sorry, complete Python noob here :slight_smile:
Leon

0 Likes

(Leon Steijger) #4

Hi Patrick, found it, first line duh.
Thanks for your help, data is broadcasting now.

Leon

0 Likes

(Patrick José Pereira) #5

Hi Leon,

Glad that you figure it out, let us know if you need any further help.

0 Likes