Skip to content

AlverGant/camera-router

Repository files navigation

Camera Router - OpenWRT Wireless Bridge

OpenWRT-based solution for bridging isolated camera access points to existing wireless infrastructure using dual-radio routers as a transparent gateway.

Table of Contents

Overview

This project provides a complete solution for connecting wireless cameras (or any device with a fixed IP and no gateway) to your existing wireless infrastructure. It uses OpenWRT-based routers configured as dual-mode wireless bridges with NGINX reverse proxy capabilities.

Use Cases

  • Connect GoPro cameras to remote internet access
  • Bridge professional broadcast cameras (Sony PMW-F55, etc.) to production networks
  • Integrate isolated IoT devices into existing infrastructure
  • Enable remote access to devices with limited networking capabilities

Features

  • Dual-Radio Bridge: Connects two separate wireless networks seamlessly
  • NGINX Reverse Proxy: Handles HTTP to WebSocket upgrades and header rewriting
  • Double-NAT Architecture: Transparent routing between isolated networks
  • Automated Firmware Generation: Builds custom OpenWRT images for multiple cameras
  • SNMP Support: Monitor router status and location via SNMP
  • Web Configuration Interface: Simple web UI for changing camera associations
  • Static/DHCP Support: Flexible network configuration options

System Requirements

Hardware

Supported Routers:

  • Mikrotik RouterBoard RB433/RB433AH with two mini-PCI radios
  • TP-Link WDR3600 or similar dual-band OpenWRT-capable routers

Minimum Specifications:

  • 2x wireless radios (2.4GHz recommended for both, or dual-band)
  • 64MB+ RAM
  • 16MB+ Flash storage

Build Environment

  • Ubuntu Server 14.04 or 18.04 (64-bit)
  • 8 GB RAM minimum
  • 16 GB free disk space
  • Internet connection for downloading dependencies

Network Architecture

+----------------+          +------------------+          +----------------+
|                |          |                  |          |                |
|  Camera (AP1)  | )) 2.4G  |  OpenWRT Router  |  2.4G (( | Infrastructure |
|                |          |   (Dual Radio)   |          |     (AP2)      |
|  10.0.0.1      |          |                  |          |                |
|  No Gateway    |          | IP_A  |  |  IP_B |          | DHCP/Static    |
|                |          | 10.0.0.2 | x.x.x.x|          |                |
+----------------+          +------------------+          +----------------+
                                     |
                              NGINX Reverse Proxy
                         (HTTP/WebSocket passthrough)

Network Interfaces

  • Interface A (Camera Side)

    • Static IP within camera subnet (e.g., 10.0.0.2/16)
    • Wireless client mode to camera AP
  • Interface B (Infrastructure Side)

    • DHCP or static IP from existing network
    • Wireless client mode to infrastructure AP
  • LAN Interface

    • Management interface (192.168.1.254/24)
    • Access to LuCI web interface (port 8880)

Installation

1. Clone the Repository

git clone https://github.com/AlverGant/camera-router.git
cd camera-router

2. Configure Camera Settings

Edit camera_configs.cfg to match your environment:

nano camera_configs.cfg

Key configuration parameters:

  • numberofnodes: Number of camera routers to generate firmware for
  • devicetype: Hardware model (rb433 for Mikrotik RB433/RB433AH)
  • camera_ssid[]: Array of camera WiFi SSIDs
  • camera_wpa2key[]: Array of camera WiFi passwords
  • estudio_ssid: Infrastructure WiFi SSID
  • estudio_passwd: Infrastructure WiFi password
  • estudio_ip[]: Static IPs for each router on infrastructure network
  • net_config[]: Network configuration (IP ranges, netmasks, gateways)

3. Generate Firmware

Make the firmware generator executable and run it:

chmod +x camera_firmware_generator.sh
./camera_firmware_generator.sh

Note: First compilation takes 1+ hour. Dependencies are downloaded automatically.

4. Flash Router

Firmware files will be generated in firmwares/ directory:

  • camera-X_rootfs.tar.gz - Root filesystem
  • camera-X_kernel.bin - Kernel image
  • camera-X_sysupgrade.bin - Sysupgrade image (for updates)

For Mikrotik RB433/RB433AH:

Use the provided installation script:

./Install_OpenWRT_on_Routerboard_RB433AH.sh

Or use TFTP method:

./TFTP_ServerOpenwrt.sh

Configuration

Camera Configuration File Structure

# System Configuration
numberofnodes='20'              # Number of routers to generate
devicetype="rb433"              # Hardware platform

# Wireless Configuration
radio_estudio_channel=auto      # Infrastructure radio channel
radio_camera_channel=auto       # Camera radio channel

# Camera Association (per-camera settings)
camera_ssid[camera-1]=DIRECT-IqF0:PMW-F55_0120112
camera_wpa2key[camera-1]=X23tBk3b
estudio_ip[camera-1]=10.100.176.40

# Infrastructure Settings (shared)
estudio_ssid=GCam
estudio_passwd=mobilidade@123

# Network Configuration
net_config[camera_ip]=10.0.0.1
net_config[camera_iface_ip]=10.0.0.2
net_config[estudio_protocol]=static  # or dhcp

Runtime Configuration

After flashing, you can modify settings via:

  1. Web Interface: http://[router-ip]:8880 (LuCI)
  2. SSH: ssh root@[router-ip]
  3. SSID Change Interface: http://[router-ip]:8080

Usage

Accessing the Camera

Once configured, access your camera through the router's infrastructure IP:

# Example: Camera on router with IP 10.100.176.40
http://10.100.176.40

The NGINX proxy automatically:

  • Forwards requests to camera (10.0.0.1)
  • Upgrades HTTP to WebSocket
  • Rewrites headers for compatibility

Monitoring via SNMP

Routers include SNMP support for monitoring:

snmpwalk -v2c -c public [router-ip]

GPS coordinates and system contact info configured in camera_configs.cfg.

Changing Camera Association

Access the web interface on port 8080 to change camera SSID/password without reflashing:

http://[router-ip]:8080

Available operations:

  • Switch to different camera SSID
  • Reset WiFi configuration
  • Revert to previous settings

Project Structure

camera-router/
├── README.md                                    # This file
├── camera_configs.cfg                           # Main configuration file
├── camera_firmware_generator.sh                 # Firmware build script
├── camera_functions.sh                          # Build functions
├── configure_node.sh                            # Manual configuration script
├── Install_OpenWRT_on_Routerboard_RB433AH.sh   # RB433 installer
├── TFTP_ServerOpenwrt.sh                        # TFTP flash utility
├── network.png                                  # Network diagram
├── rb433/                                       # RB433 configuration files
│   ├── diffconfig                               # OpenWRT build config
│   ├── wireless                                 # WiFi configuration
│   ├── network_wwan_*                           # Network configs
│   ├── firewall                                 # Firewall rules
│   ├── nginx.conf                               # NGINX proxy config
│   └── *.cgi                                    # Web interface scripts
└── firmwares/                                   # Generated firmware (created during build)

Troubleshooting

Build Issues

Problem: Compilation fails with missing dependencies

# Update system and retry
sudo apt update
sudo apt upgrade
./camera_firmware_generator.sh

Problem: Out of disk space during compilation

OpenWRT build requires ~16GB. Free up space and retry.

Network Issues

Problem: Router not connecting to camera WiFi

  1. Check camera SSID/password in camera_configs.cfg
  2. Verify camera WiFi is enabled and broadcasting
  3. Check wireless channel compatibility

Problem: Cannot access camera through router

  1. Verify NGINX is running: ssh root@[router] "/etc/init.d/nginx status"
  2. Check firewall rules: ssh root@[router] "iptables -L -n"
  3. Verify network interfaces: ssh root@[router] "ifconfig"

Problem: Router not getting IP from infrastructure

  1. Check infrastructure SSID/password
  2. Verify DHCP is enabled (or static IP configured correctly)
  3. Check signal strength: ssh root@[router] "iwinfo"

Common Commands

# Check WiFi status
ssh root@[router] "wifi status"

# Restart networking
ssh root@[router] "/etc/init.d/network restart"

# View NGINX logs
ssh root@[router] "logread | grep nginx"

# Monitor system logs
ssh root@[router] "logread -f"

License

This project is provided as-is for educational and production use. Modify and distribute freely.

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Test your changes thoroughly
  4. Submit a pull request

Credits

Developed for TV Globo's wireless camera infrastructure.


Note: Default credentials and network configurations in this repository are examples. Always use strong passwords and appropriate security measures in production environments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors