Skip to content

Working on the code on an ethoscope

Some problems, especially those involving hardware such as sleep deprivation modules, can only be debugged on an ethoscope. The easiest way is to change the code directly on the device.

  1. From the node, log in to the ethoscope. Its address is shown on its page in the node.

    Terminal window
    # if you are not on the node already, log in to it first
    ssh node@your-node-address
    # then log in to the ethoscope

    The node live image’s default user is node (password node) and the ethoscope image’s is ethoscope (password ethoscope). These defaults are public: change them on machines that other people can reach.

  2. Stop the ethoscope services. The ethoscope then disappears from the node; this is expected.

    Terminal window
    sudo systemctl stop ethoscope_device ethoscope_listener
  3. Make the code writable by the ethoscope user, so that you can edit it remotely. The software is in /opt/ethoscope, owned by root:

    Terminal window
    sudo chown -R ethoscope:ethoscope /opt/ethoscope
    # when you are done, give it back to root
    sudo chown -R root:root /opt/ethoscope
  4. Open the code on your computer. Your computer must be on the ethoscope network: the node itself, or a computer on the same network. In a Linux file manager, press Ctrl+L to show the location bar and enter:

    sftp://[email protected]/opt/ethoscope/src

    Log in with the ethoscope’s password. You can now edit the files on the ethoscope with any text editor, such as Geany.

  5. To test your changes, run the device server in the foreground, with debug messages, from an SSH session on the ethoscope:

    Terminal window
    cd /opt/ethoscope/src/ethoscope/scripts
    sudo python device_server.py -D

    Your print statements, or messages sent through the logging module, appear in that terminal. Tracking and video recording are started by the listener, device_listener.py in the same folder; run it in a second session if you need them.

When you have finished, restore the ownership of /opt/ethoscope and start the services again (sudo systemctl start ethoscope_device ethoscope_listener), or reboot.