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.
-
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 firstssh node@your-node-address# then log in to the ethoscopeThe node live image’s default user is
node(passwordnode) and the ethoscope image’s isethoscope(passwordethoscope). These defaults are public: change them on machines that other people can reach. -
Stop the ethoscope services. The ethoscope then disappears from the node; this is expected.
Terminal window sudo systemctl stop ethoscope_device ethoscope_listener -
Make the code writable by the
ethoscopeuser, 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 rootsudo chown -R root:root /opt/ethoscope -
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/srcLog in with the ethoscope’s password. You can now edit the files on the ethoscope with any text editor, such as Geany.
-
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/scriptssudo python device_server.py -DYour
printstatements, or messages sent through theloggingmodule, appear in that terminal. Tracking and video recording are started by the listener,device_listener.pyin 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.