Hardware Deployment Guide

NVIDIA Orin Nano ยท Raspberry Pi ยท RISC-V ยท Docker

Deploy NanoSolana on real hardware using the build-tag HAL. One binary runs identically on a $50 Pi or a $500 Orin Nano โ€” or silently stubs on macOS for development.

๐Ÿ”ฉ Hardware Abstraction Layer (HAL)

NanoSolana uses a build-tag HAL so the same binary runs on real hardware or in simulation. Build tags are automatic โ€” go build on Linux links hal_linux.go, everywhere else gets hal_stub.go.

HAL Stack
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         MawdBot Agent (OODA Loop)               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚          DeviceManager (pkg/hardware)           โ”‚
โ”‚  Modulino drivers ยท Event routing ยท Mapping    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚             HAL Interface (internal/hal)        โ”‚
โ”‚   Bus ยท Device ยท GPIO ยท PWM ยท Platform         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  hal_linux.go    โ”‚     hal_stub.go             โ”‚
โ”‚  (periph.io)     โ”‚     (synthetic data)        โ”‚
โ”‚  Real I2C/GPIO   โ”‚     Logs + mock sensors     โ”‚
โ”‚  Orin/RPi/RISCV  โ”‚     macOS/Windows/CI        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
๐Ÿง

hal_linux.go

  • periph.io I2C driver
  • Real GPIO + PWM
  • Orin / RPi / RISC-V
  • /dev/i2c-1 direct access
๐Ÿงช

hal_stub.go

  • Synthetic sensor data
  • Log-only GPIO
  • macOS / Windows / CI
  • No hardware needed
โš™๏ธ

Build Commands

  • make build โ€” macOS stub
  • make orin โ€” NVIDIA Orin
  • make rpi โ€” Raspberry Pi
  • make riscv โ€” RISC-V

๐Ÿ“‹ Supported Boards

Board Arch Build Target I2C GPIO Notes
NVIDIA Orin Nano arm64 make orin โœ“ โœ“ Primary target, /dev/i2c-1
NVIDIA Orin NX arm64 make orin โœ“ โœ“ Same as Nano
Raspberry Pi 5 arm64 make rpi โœ“ โœ“ /dev/i2c-1
Raspberry Pi 4B arm64 make rpi โœ“ โœ“ /dev/i2c-1
Raspberry Pi Zero 2W arm64 make rpi โœ“ โœ“ Low RAM, works fine
Raspberry Pi Zero W armv6 make rpi-armv6 โœ“ โœ“ Limited CPU
StarFive VisionFive 2 riscv64 make riscv โœ“ โœ“ Experimental
BeagleBone AI-64 arm64 make orin โœ“ โœ“ TI TDA4VM
x86 Server amd64 make linux-amd64 โœ— โœ— Software-only
Mac (dev) arm64/amd64 make build โœ— โœ— Stub mode

๐ŸŸข NVIDIA Orin Nano Setup

1

Flash & Boot

# Flash JetPack 6.x via SDK Manager or SD card image
# Boot into Ubuntu desktop, connect via SSH
2

Enable I2C

# Check I2C buses
ls /dev/i2c-*

# If not present, enable in device tree
sudo /opt/nvidia/jetson-io/jetson-io.py
# Select "Configure Jetson 40pin Header" โ†’ Enable I2C

# Install tools
sudo apt install -y i2c-tools

# Test โ€” you should see your Modulino addresses
sudo i2cdetect -y 1
3

Deploy NanoSolana

# On your dev machine:
make orin
scp build/mawdbot-orin build/mawdbot-tui-orin user@orin-nano:~/

# On the Orin Nano:
chmod +x ~/mawdbot-orin ~/mawdbot-tui-orin
sudo mv mawdbot-orin /usr/local/bin/mawdbot
sudo mv mawdbot-tui-orin /usr/local/bin/mawdbot-tui

# Add user to i2c group (logout/login after)
sudo usermod -aG i2c $USER

# Initialize, configure, scan
mawdbot onboard
cp ~/.mawdbot/.env.example ~/.mawdbot/.env
nano ~/.mawdbot/.env

mawdbot hardware scan
mawdbot hardware test
4

Systemd Service

sudo tee /etc/systemd/system/mawdbot.service << 'EOF'
[Unit]
Description=MawdBot Solana Trading Agent
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=mawdbot
Group=i2c
EnvironmentFile=/home/mawdbot/.mawdbot/.env
ExecStart=/usr/local/bin/mawdbot ooda --interval 60
Restart=always
RestartSec=10

# Security
NoNewPrivileges=true
ProtectSystem=strict
ReadWritePaths=/home/mawdbot/.mawdbot
PrivateTmp=true

# Device access
SupplementaryGroups=i2c
DeviceAllow=/dev/i2c-1 rw

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable mawdbot
sudo systemctl start mawdbot
sudo journalctl -u mawdbot -f

๐Ÿ“ Raspberry Pi Setup

1

Enable I2C

sudo raspi-config
# Interface Options โ†’ I2C โ†’ Enable

sudo apt install -y i2c-tools
sudo i2cdetect -y 1
2

Deploy

# On your dev machine:
make rpi
scp build/mawdbot-rpi pi@raspberrypi:~/mawdbot
3

Wiring (Qwiic)

Connect Modulino nodes to the RPi's I2C pins:

SDAGPIO 2 โ€” Pin 3
SCLGPIO 3 โ€” Pin 5
3.3VPin 1
GNDPin 6

Or use a Qwiic HAT / breakout for plug-and-play daisy-chaining.

๐Ÿ”Œ Arduino Modulinoยฎ Wiring

All Modulino nodes connect via Qwiic (I2C daisy-chain). No soldering required.

Qwiic daisy-chain
[Orin Nano / RPi]
     โ”‚
     โ”‚ Qwiic Cable
     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   Qwiic   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   Qwiic   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Distance โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚ Movement โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚  Thermo  โ”‚
โ”‚  0x29    โ”‚            โ”‚  0x6A    โ”‚            โ”‚  0x44    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                      โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
     โ”‚ Qwiic
     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   Qwiic   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   Qwiic   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Pixels  โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚  Buzzer  โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚ Buttons  โ”‚
โ”‚  0x6C    โ”‚            โ”‚  0x3C    โ”‚            โ”‚  0x7C    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
     โ”‚ Qwiic
     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Knob   โ”‚
โ”‚  0x76    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Hardware โ†” Agent Mapping

SensorAgent Integration
Distance 0x29 Proximity alert โ€” pause trades if someone is near the hardware
Movement 0x6A Vibration/tilt detection โ€” emergency stop on physical disturbance
Thermo 0x44 Thermal throttle โ€” reduce activity if board overheating
Knob 0x76 Live strategy tuning โ€” maps to position_size, stop_loss, or RSI threshold
Buttons 0x7C A = force cycle ยท B = toggle simulate ยท C = checkpoint vault
Pixels 0x6C OODA phase display (tealโ†’purpleโ†’amberโ†’green) + signal strength bar
Buzzer 0x3C Trade alerts (rising tone) ยท error alerts (low tone)

๐Ÿณ Docker with Hardware Access

1

Build Image

docker build -t mawdbot .
2

Run with I2C

docker run --rm \
  --device /dev/i2c-1 \
  --env-file .env \
  mawdbot ooda --interval 60
3

Full Hardware Access

docker run --rm \
  --privileged \
  --env-file .env \
  mawdbot ooda --interval 60

๐Ÿ“Š Monitoring

monitoring commands
# Live sensor stream
$ mawdbot hardware monitor

# System status
$ mawdbot status

# Logs (systemd)
$ journalctl -u mawdbot -f --no-pager

# Resource usage (should be <10MB RSS)
$ ps aux | grep mawdbot
๐Ÿ’พ

Resource Budget

  • Binary: ~9.6 MB
  • RAM: <10 MB RSS
  • Boot: <1 second
  • CPU: idle ~0%
๐Ÿ”’

systemd Security

  • NoNewPrivileges
  • ProtectSystem=strict
  • PrivateTmp
  • DeviceAllow /dev/i2c-1
๐ŸŒก๏ธ

Sensor Thresholds

  • Proximity <5cm โ€” wake cycle
  • Tilt detected โ€” pause trades
  • Temp overheating โ€” throttle
  • Knob turn โ€” adjust RSI

Ready to deploy on hardware?