0
\$\begingroup\$

I am currently working with the Bluetooth module HC05 using a Teensy 3.2 board. I successfully established a connection between the laptop and the board using Bluetooth. I can send data from the board and read it on the laptop.

This only happens when I run a python script that maintains connection between the module and the laptop; when I close it, the connection gets lost (even though it is paired properly).

What I want to do is to ping the device, to know what the percentage of packet loss is. I do not know how to do it, as when I am running the python script, it does not allow me to write on the command line to ping it. Then when I stop the script the connection is lost, so the computer does not recognize any device.

Is it possible to maintain the connection while not running the python script, or perhaps ping it through the Teensy or through the python script that establishes the connection?

Many thanks.

\$\endgroup\$
0
\$\begingroup\$

You need to ping it using the Python script. Using Python Ping is probably the easiest way. This tutorial shows you step by step how to set it up and use it. https://www.ictshore.com/python/python-ping-tutorial/

If you want to do it without that, read this stack overflow response. https://stackoverflow.com/questions/2953462/pinging-servers-in-python

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.