BrickNil provides an easy way to connect to and program LEGO® Bluetooth hubs (including the
PoweredUp Passenger Train 60197 and Cargo Train 60198 sets, and the Lego
Duplo Steam Train 10874 and Cargo Train 10875 ) using Python on OS X and
Linux. This work was inspired by this EuroBricks thread …