This class provides an interface with the Acrome Controller board. For basic communication checks and configuration via 4 different methods.
-
__init__(self, portname="/dev/serial0", baudrate=115200)
Return:
None
This is the constructor of the Controller class.
portname
argument is the serial/COM port of the host computer which is connected to the Acrome Controller board. Since the board is designed with Raspberry Pi in mind, default portname is /dev/serial0
to provide out of the box support for Raspberry Pi.
baudrate
argument must not be changed by the user since different baudrates are not supported by the hardware, yet.
-
ping(self)
Return:
boolean
This method provides a basic ping functionality between the board and the host computer as the name suggests. If the communication succeeded method returns true, otherwise false.
-
reboot(self)
Return:
None
This method immediately reboots the Acrome Controller board when called.
-
enter_bootloader(self)
Return:
None
When this method called, the Acrome Controller board boots into the embedded bootloader to provide a firmware update. When bootloader activated, the board does not respond to any other command rather than specific instruction for bootloader operation.
-
get_latest_version(self)
Return:
string / None
This method returns the latest firmware version available as a string with a 'v' suffix. (Example: v0.1.0)
-
fetch_fw_binary(self, version='')
Return:
boolean
This method fetches the given firmware version from related repository. When version argument is not given by the user, fetches the latest version available. User must provide version information as a string and with a suffix 'v'. Returns True on success.
-
update_fw_binary(self, baudrate=115200)
Return:
None
This method initiates the firmware download procedure. This procedure must not be interrupted since it may brick the hardware. Baudrate argument can be selected between 1200 and 115200. Update procedure with low baudrates may take some time. Serial port in use on the host computer must support EVEN parity to work properly. When used with a Raspberry Pi, ttyAMA0 should be used as the serial port since ttyS0 does not support parity bits.
-
get_board_info(self)
Return:
dict
This method returns a dictionary that contains information about the underlaying hardware configuration and status. Since gathering that information interrupts the any other operation at the hardware, calling it in any control loop might affect the system performance and should be avoided.