Welcome to TrainThing’s documentation!

– todo::

This is just the beginning


This is the software for the LapTop, part 4 of the TrainThing

This top level module provides a menu of program options to display and implement.

Module client

This module provides: A socket client for the internet (WiFi LAN) connection to the Raspberry Pi (3), running TrainThing software, and on to the Arduino (2), running the DCC++ Base Station. All DCC++ and TrainThing commands strings passed to this module are sent to the Raspberry Pi. All received status messages are converted from bytes to strings bounded by “<” and “>”, and placed in a large circular buffer.

class client.Client

Establish internet client (WiFi LAN) connection with Raspberry Pi server

__dict__ = mappingproxy({'__module__': 'client', '__doc__': 'Establish internet client (WiFi LAN) connection with Raspberry Pi server', 'socket': <module 'socket' from 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\\lib\\socket.py'>, 'threading': <module 'threading' from 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\\lib\\threading.py'>, '__init__': <function Client.__init__>, 'send': <function Client.send>, '_collect': <function Client._collect>, 'get_response': <function Client.get_response>, '__dict__': <attribute '__dict__' of 'Client' objects>, '__weakref__': <attribute '__weakref__' of 'Client' objects>, '__annotations__': {}})

Initialize link to Raspberry Pi. Start thread to receive responses

__module__ = 'client'

list of weak references to the object (if defined)


Returns a received response


Send command to Raspberry Pi/Arduino

socket = <module 'socket' from 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\\lib\\socket.py'>
threading = <module 'threading' from 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\\lib\\threading.py'>

Module dumb

Opens a window to enter a command to send to TrainThing. No editing or validity checking.

Module smart

Replacement for module “dumb” . Open a window to enter DCC++ and TrainThing commands to be sent to the Raspberry Pi and Arduino. Bracketing “<” and “>” are provided. Command syntax and value validity are checked.

Module dump

Opens a window to display responses placed in the buffer by module client.

Module printit

Provides a menu of data elements/tables to print in a ‘pretty’ format.

Indices and tables