Skip to main content

Programming and Development

Development Environment

The BB-400 supports multiple programming languages and development approaches. Code can be developed on a standard PC and deployed to the device via secure copy (SCP), SFTP, or packaged as Docker containers.

Supported Languages and Platforms

  • Python (pre-installed)
  • Node.js
  • .NET (C#/VB) via Mono runtime
  • Node-RED (pre-installed visual programming)
  • Bash scripting
  • Any language supported by Linux ARM

Python Development

Python is the recommended language for rapid development on the BB-400. The pyserial library provides serial port access, and the websocket-client library enables WebSocket communication.

Serial Port Example

import serial

ser = serial.Serial(
port='/dev/ttySC0',
baudrate=115200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE
)

ser.write(b'Hello World')

Node-RED

Node-RED is pre-installed and accessible via the web interface. It provides a visual flow-based programming environment ideal for integrating I/O, serial communication, and network protocols without writing code.

Access Node-RED at: http://bb400-xxxx:1880

Pre-built example flows are included for serial port communication, WebSocket I/O control, REST API integration, and Modbus protocols.

Docker Containers

Docker is pre-installed and enabled by default. Containers provide isolated application environments and simplify deployment across multiple devices.

Brainboxes provides pre-built containers on Docker Hub. The web interface includes Docker container management for downloading, starting, stopping, and configuring containers.

Arduino Co-processor

The ATMEGA32U4 co-processor managing the I/O lines can be reprogrammed with custom Arduino firmware for specialised real-time I/O requirements. This is an advanced feature that replaces the standard Brainboxes I/O server functionality.

caution

Reprogramming the Arduino co-processor will disable standard I/O protocols and web interface I/O control. Ensure you have a backup and understand the implications before proceeding.