guide_debugging_marcos_software - vnegnev/marcos_extras GitHub Wiki

Guide: debugging the MaRCoS software environment

Overview

This guide outlines a more detailed series of tests in the event that the selftests of Tutorial 1 partially or wholly failed. Ultimately you may need to learn more about the MaRCoS system to pinpoint your issue, but hopefully these tests help you narrow it down.

It assumes you have run through Tutorial 1 and are using its folder structure; adjust if needed.

Building and testing the MaRCoS server manually

Open a terminal and go to the marga/build folder:

~ $ cd marcos_pack/marga/build/
~/marcos_pack/marga/build $ make clean && make
-- Executing Verilator...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/vlad/marcos_pack/marga/build
[  6%] Building CXX object CMakeFiles/marga_sim.dir/marga_sim_main.cpp.o
... many lines...
[ 87%] Linking CXX executable marga_sim
[100%] Built target marga_sim
~/marcos_pack/marga/build $ fallocate -l 516KiB /tmp/marcos_server_mem
~/marcos_pack/marga/build $

Start the marga simulator, with no arguments:

~/marcos_pack/marga/build $ ./marga_sim
MaRCoS server + MARGA sim model, Aug 31 2021 23:56:02
Server version 1.0.5

	 Usage: /home/vlad/marcos_pack/marga/build/marga_sim DUMPTYPE DUMPPATH(S)
	 where DUMPTYPE (optional) is csv, fst or 'both', DUMPPATH (optional) is (are) non-default output file paths.
	 Examples:
		/home/vlad/marcos_pack/marga/build/marga_sim # (no dump files will be produced)
		/home/vlad/marcos_pack/marga/build/marga_sim csv # (will dump to /home/vlad/marcos_pack/marga/build/marga_sim.csv)
		/home/vlad/marcos_pack/marga/build/marga_sim csv /path/to/test.csv
		/home/vlad/marcos_pack/marga/build/marga_sim fst # (will dump to /home/vlad/marcos_pack/marga/build/marga_sim.fst)
		/home/vlad/marcos_pack/marga/build/marga_sim fst /path/to/test.fst
		/home/vlad/marcos_pack/marga/build/marga_sim both # (will dump to /home/vlad/marcos_pack/marga/build/marga_sim.csv and /home/vlad/marcos_pack/marga/build/marga_sim.fst)
		/home/vlad/marcos_pack/marga/build/marga_sim both /path/to/test.csv /path/to/test2.fst

	 Hit ctrl-c to halt the program.

Open a second terminal, navigate to the marcos_client folder and run a few tests in test_server.py:

~ $ cd ~/marcos_pack/marcos_client/
~/marcos_pack/marcos_client $ python -m unittest test_server.ServerTest.test_leds
.
----------------------------------------------------------------------
Ran 1 test in 0.007s

OK
~/marcos_pack/marcos_client $

If you received a ConnectionRefusedError,

  • make sure the simulator started correctly and is running,
  • make sure marcos_client/local_config.py specifies localhost and not an actual SDRlab device

If any of these steps did not successfully run, there is a problem in your setup – please contact the MaRCoS developers for advice.

**

⚠️ **GitHub.com Fallback** ⚠️