Connecting to the Vanguard shell

There are two ways to connect to the Python shell of your Vanguard board. The alternatives are:

  1. attach it to your laptop using a USB cable and load the python shell using a terminal emulator
  2. connect to its built-in WiFi access point and load the python shell in the Google Chrome browser

In summary, there are benefits to configuring your laptop for a USB connection, but for quick and easy access without having to install or configure any software, WiFi is hard to beat. The pros and cons of each are explored in more detail below.

Why connect over WiFi instead of USB?

Connecting to the python shell over WiFi is rapid and achievable on almost any device (including tablets and phones). Assuming you have Google Chrome or an equivalent modern browser, no installation or configuration will be required. This means that learners without a laptop or support from a technical adult at home can run python commands and experiment with physical computing straight away.

The WiFi interface can also upload python scripts and other files to the Vanguard board, but only one file at a time, which is suitable if you just want to add a single python module, upload a gif image, or change the main.py startup regime.

Why connect over USB instead of WiFi?

If you want to brainwash the operating system on the Vanguard board to reset it or program in a different language (for example to install CircuitPython, Javascript or program using C++ using Arduino) this must be done over USB. Similarly making a brainfreeze of a board (saving its configuration) must be done over USB.

There will also be circumstances when you can’t rely on the built-in webserver being available, or when the operations offered by the Wifi shell interface are too minimal for the complexity of your project. USB would be preferred when…

  • you expect to frequently reboot the Vanguard board as part of your development
    • to develop your own main.py startup regime for your board, you must reboot each time to test it
    • a reboot restarts the Wifi Access point, Webserver and REPL, requiring manual reconnection
    • using the serial link, you can press the RST (reset) button and the board is instantly available over USB
  • you are managing a large number of modules on the board
    • sending files one by one from the browser over WiFi is a pain
    • it is easy to forget to upload a changed file that you have modified locally
    • using the rsync command in rshell synchronizes multiple files and directories over USB
  • you have multiple Vanguard boards
    • multiple boards are broadcasting a vanguard-xxxxxx access point, and you don’t know which is which
    • the USB shell allows you to connect to a specific device, to retrieve its unique id
  • your board is no longer connecting over WiFi
    • for example if you removed the code in boot.py which loads the webserver
    • you have written a script which crashes the whole board on boot, killing the webserver too
    • you can brainwash your board to factory settings over USB to get your board working again
  • you want to see the startup messages
    • you have written a startup script which doesn’t do what you expect
    • by the time you have reconnected to the webserver, the startup sequence has finished
    • on USB you can press RST (reset) and instantly see any information printed during the startup sequence