golioth/developer-training

Suggested Documentation Improvements for Offline (non-kasm) Training

Closed this issue · 1 comments

After running the training locally on my Mac, I have some improvements that might make it easier for others

Page: https://training.golioth.io/docs/after-training/local-toolchain-install

  • general note: the use of venv is awesome. Later in the instructions I needed to install some new modules from PIP and if you are not a python dev you might not know why venv is so important. If you were to install NCS or have other python projects they might conflict if you install anything outside the venv. A small note on why a Venv is being used might be helpful
  • I didn't want my Golioth folder in my home, so I created a new folder ~/Documents/Training/Golioth - this works fine, but requires a few tweaks later. However others might like to keep things separated, so a small note that it doesn't have to be in the home folder could be helpful (I happen to have Zephyr, NCS and Golioth all on the same machine, so separation is very helpful!). This means that for the rest of the tutorial I substituted ~/ for ~/Documents/Training/Golioth and everything works fine
  • Mac might not have wget installed (so either install wget or download the zephyr tar.gz directly)
  • i am investigating the impact of zephyr-sdk-0.15.0 ./setup.sh as it modifies ~/.cmake (if you already have NCS or Zephyr for example)

Page: https://training.golioth.io/docs/golioth-exercises/install_esptool

  • a useful reference for installing ESPtool.py on Mac : https://github.com/RavenSystem/esp-homekit-devices/wiki/Install-ESPTool-on-macOS (though the question is if you want to do it in the venv or globally - i elect to do it in the venv to avoid conflicts with other dependencies that esptool uses -> esptool will only be available in the venv in that case); the link contains how to run esptool on mac as well

Page: https://training.golioth.io/docs/golioth-exercises/compile-golioth-demo

  • when building the example it failed for me with the error "ModuleNotFoundError: No module named 'elftools'" -> solution is to install pyelftools from pip (which i did inside the venv). reference: zephyrproject-rtos/zephyr#1392
  • west kasm download will require the user to create ~/Desktop/Downloads first, or use the --output-dir arg to put the merged bin files in a location of the users choice - so west kasm --output-dir="~/Documents/Training/Golioth/artifacts/" download (of course the output dir must be created as well!)
  • on Mac the mag-tag will be on /dev/cu.usbmodem* : see https://learn.adafruit.com/adafruit-magtag/rom-bootloader#step-3076822 for details
  • my flash command ended up being (from inside the venv) python3 -m esptool --chip esp32s2 --port /dev/cu.usbmodem01 write_flash 0x0 ~/Documents/Training/Golioth/artifacts/merged_golioth-demo_114332.bin

@r-colvin thanks for taking the time to record your thoughts on the training flow. We'll definitely use this to improve the process for the next training!

when building the example it failed for me with the error "ModuleNotFoundError: No module named 'elftools'"

This one is something I've run into several times. The elftools get installed when the requirements.txt list is installed during the Zephyr workspace installation process (step 3 under the Install Golioth Zephyr SDK heading). This is another great reason for venv!