General

Our MDB devices work with an easy to use API. To communicate with them, just open a serial port with the following settings:

  • Baudrate - 115200
  • Data bits - 8
  • Parity - none
  • Stop Bits - 1

To open the serial port we recommend:

  • minicom - if you are using a linux/raspbian/opkg machine
  • PuTTY - if you are using a windows machine
  • pySerial if you are developing a python application
  • MobaXterm - "Putty on steroids" for windows

To learn how to open the serial Port, please check the following sections minicom and MobaXterm , depending on your operating system. Once the connection is setup, head try getting the Firmware version to test it. Please check sections below to learn how to get the firmware version from the MDB-USB or Pi Hat.

We do not support SPI Communication Protocol

Minicom

To open a serial connection to an MDB-USB Interface or an MDB-Pi Hat with minicom, just issue the following command:

The following example opens the serial connection to /dev/ttyACM0, the actual name might differ in case there are other ACM devices. Nonetheless, only the index should change, and the port should always be named /dev/ttyACMX, with X varying.

Bash
Copy

Minicom can be installed using rpm package manager for your Linux distro. Below is an example of how to install it in latest Ubuntu.

Bash
Copy

MobaXterm

MobaXTerm can be downloaded in this link. It is our recommendation for Windows users as it stores the Serial Port Definitions and auto detects available COM Ports. As a bonus it is also capable of starting SSH and Telnet sessions, storing the IP Addresses and usernames.

After installing the application, open it and follow these steps:

1 - Click Session(top left corner)

2 - Select "Serial" on the pop-up.

3 - Select the correct baudrate 115200

4 - Once previous step completed, on User Sessions (stored sessions) there will be a "Serial" Entry. To open it, just double click it.

5 - Select COMX.

This example shows COM4, but it may differ in each situation. To learn what COM Port is the MDB-USB, use Device Manager from Windows and Unplug/Plug the MDB-USB. The corresponding COM port will be available only when you plug the MDB USB back into the computer.

All commands must be followed by a newline (\n)

Retrieve Version Information

Firmware Version command
Copy

Answer:

  • v,s.s.s.s,xxxxxxxxxxxx

Where:

  • s.s.s.s = software version
  • xxxxxxxx = CPU ID

Retrieve hardware info

Hardware version command
Copy

Future Enhancement

Answer:

  • h,x.x,yyyy

Where:

  • x.x is the hardware version
  • yyyy are capabilities

Reboot and enter firmware update mode

Enable Firmware update mode
Copy

Answer:

  • no answer is sent. The device enters bootloader mode

Reset the interface by forcing a reboot

This command, although accepted in the MDB-Pi Hat (Standard and Plus), does not reboot the interface. The interface can be rebooted by rebooting the Pi Hat (power cycle) or alternatively by toggling Raspberry's GPIO6 (setting to 0 to shutdown, and back to 1 to turn it back on).

Reboot Interface
Copy

Answer:

  • No answer is sent. The device reboots.

Revert to default configuration

To rollback to default settings (nothing configured), issue the following command:

Revert to default
Copy

Set license code

Set license code
Copy

Future Enhancement

Answer:

  • f,ACK license has been set
  • f,NACK license code is not valid (or not applicable)

Modify Relay State

Modify Relay State
Copy

This operation is only possible on MDB-USB Plus only!

Answer:

  • l,ACK : success on activate/deactivate relay.
  • l,NACK: unknown parameter relay control, such as L,xx

Possible States:

  • L,0: deactivate relays
  • L,1: activate relay 1
  • L,2: activate relay 2
  • L,3: activate both relays

Watchdog

Once watchdog is enabled it cannot be stopped, that is the principle of watchdog

Watchdog
Copy

X is time in seconds

Y is 'any command' flag. Accept 0 or 1

Z is 'store permanent' flag. Accept 0 or 1

Examples:

  • W,10 - This will start the watchdog with 10 seconds time, and from then you need to 'pet' it before 10 seconds or the device will hard reboot (and reenumerate on usb). Petting of watchdog is done by same 'W' command, so you can send 'W10' every 4 seconds for example

    • So if you have given W,10 command, you CANNOT disable it with W,0 but a REBOOT will disable it for the permanent setting
  • W,10,1 - Then the watchdog will be reset with ANY command, NO W is needed. You just need to ensure that within 10 seconds any kind of command is sent

  • W,10,0,1 - Given 1 will store the setting permanently so that the device always will have the watchdog enabled after boot. Will configure the device to reboot after 10 seconds if it has not seen a W command in that timeframe

  • W,0,0,1 - Watchdog will always be active (even after power off). Will delete watchdog setting from permanent memory

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard