How to debug Python on Arduino Yun

171 Views Asked by At

How can you:

  1. Print debugging messages from a Python script?
  2. Access those messages in real-time on a remote device (Arduino Yun) you're SSH'ed into?

So far, I've been making changes, copying them to the Yun, restarting it, and doing all this without the benefit of debugging. (I have to test on the Yun itself.)

1

There are 1 best solutions below

0
On

In a Python script, you can give yourself messages like this: print("var x = {0}; y = {1}".format(x, y))

Run python path/to/file.py (while SSH'ed) to access the server w/real-time logs.

If the server is already running, you can do ps | grep python then kill XXXX for the running process, then run the above instruction again.