Go to file
Emran Billah c5d79b7fdc Fixed bridging issues with ipvlan which allows comms from container to host but not the other way around. Macvlan not working, which would be ideal for network isolation and 2 way comms. 3rd route to manually bridge xbnet0 and eth0 interfaces over br0, but this is least appealing. Need to find a way to make macvlan work 2024-08-16 18:07:17 -03:00
scripts Fixed bridging issues with ipvlan which allows comms from container to host but not the other way around. Macvlan not working, which would be ideal for network isolation and 2 way comms. 3rd route to manually bridge xbnet0 and eth0 interfaces over br0, but this is least appealing. Need to find a way to make macvlan work 2024-08-16 18:07:17 -03:00
tests Working on automating build and deploy steps 2024-08-09 16:21:47 -03:00
xbnet Fixing xbnet copy for temporary testing 2024-08-08 12:26:15 -03:00
.env Fixed bridging issues with ipvlan which allows comms from container to host but not the other way around. Macvlan not working, which would be ideal for network isolation and 2 way comms. 3rd route to manually bridge xbnet0 and eth0 interfaces over br0, but this is least appealing. Need to find a way to make macvlan work 2024-08-16 18:07:17 -03:00
.gitignore Fixing gitignore 2024-08-08 12:22:21 -03:00
Dockerfile Fixed bridging issues with ipvlan which allows comms from container to host but not the other way around. Macvlan not working, which would be ideal for network isolation and 2 way comms. 3rd route to manually bridge xbnet0 and eth0 interfaces over br0, but this is least appealing. Need to find a way to make macvlan work 2024-08-16 18:07:17 -03:00
README.md Fixed bridging issues with ipvlan which allows comms from container to host but not the other way around. Macvlan not working, which would be ideal for network isolation and 2 way comms. 3rd route to manually bridge xbnet0 and eth0 interfaces over br0, but this is least appealing. Need to find a way to make macvlan work 2024-08-16 18:07:17 -03:00
docker-compose-run-multiple.yml Working ok with a single xbnet, file structure and code encapsulation looking good, iptable updating ok, need to figure out issues with bridge network 2024-08-16 13:14:54 -03:00
docker-compose.yml Fixed bridging issues with ipvlan which allows comms from container to host but not the other way around. Macvlan not working, which would be ideal for network isolation and 2 way comms. 3rd route to manually bridge xbnet0 and eth0 interfaces over br0, but this is least appealing. Need to find a way to make macvlan work 2024-08-16 18:07:17 -03:00
supervisord.conf Working ok with a single xbnet, file structure and code encapsulation looking good, iptable updating ok, need to figure out issues with bridge network 2024-08-16 13:14:54 -03:00

README.md

This repo is currently a work in progress

  • The README.md will be fully updated once the repo is in a stable state

TODO

  • Need to automate Rust project (xbnet)
    • Configure (looks good)
    • Build
    • Deploy
      • On Ubuntu for testing
      • On Linux for Tegra for TX2
      • On Jetson Orin
  • Working on setup_host_device.sh
    • Issues with bridging interfaces
  • Need to add setup_end_device.sh
  • Need to dockerize service
  • Possibly may need to bridge docker xbnet network with local wifi interface as well
  • Make a submodule of xbnet, or copy over raw files, depending on future decisions

   

SERVICES-XBEE-NET

This project contains a Dockerized setup to create and manage an XBee network using the xbnet utility. The network interface is bridged with a host Wi-Fi interface, enabling internet access for connected devices.

Note: This project uses the tap xbnet protocol, which is a layer 2 protocol. This supports full ethernet pipeline. For a simple IP level protocol support, the tun xbnet protocol can be used.

File Structure

services-xbee-net/
├── scripts/
│   ├── entrypoint.sh                   # Entrypoint script for Docker container
│   ├── get_connected_wifi_info.sh      # Script to fetch connected Wi-Fi device information
│   ├── health_check.sh                 # Script to perform health checks on the container
│   ├── setup_end_device.sh             # Script to set up the XBee end device
│   ├── setup_host_device.sh            # Script to set up the XBee host device
│   ├── test.sh                         # Script to run tests
├── tests/                              # Directory for testing-related scripts and files
├── xbnet/                              # The xbnet source code directory
├── .env                                # Environment variables for the Docker setup
├── .gitignore                          # Git ignore file
├── docker-compose-run-multiple.yml     # Docker Compose file to run multiple instances
├── docker-compose.yml                  # Main Docker Compose file
├── Dockerfile                          # Dockerfile to build the Docker image
├── README.md                           # Project documentation
└── supervisord.conf                    # Supervisor configuration file

Prerequisites

Ensure Docker and Docker Compose are installed on your machine.

Getting Started

1. Clone the Repository

git clone https://github.com/your-username/services-xbee-net.git
cd services-xbee-net

2. Modify the .env File

The .env file contains the configuration parameters for the XBee network. You may need to update these parameters according to your specific setup.

  • For a single xbnet setup, modify all the XBEE0 params only
  • For multi xbnet setup, add similar config chunks like XBEE1

(Note: Multi node xbnet setup is currently under progress)

# Configuration for xbnet0
XBEE0_PORT=/dev/ttyUSB0               # The serial port for the XBee device
XBEE0_BAUDRATE=230400                 # Baud rate for the XBee device
XBEE0_NET_SRC_IP=192.168.1.10         # Source IP for the XBee network
XBEE0_NET_DST_IP=192.168.1.11         # Destination IP for the XBee network
XBEE0_NET_IFACE_NAME=xbnet0           # Interface name for the XBee network

# Configuration for xbnet1
XBEE1_PORT=/dev/ttyUSB1
XBEE1_BAUDRATE=230400
XBEE1_NET_SRC_IP=192.168.1.11
XBEE1_NET_DST_IP=192.168.1.10
XBEE1_NET_IFACE_NAME=xbnet1

3. Build and Start the Docker Container

To build the Docker image and start the container, run:

docker-compose -f docker-compose.yml up --build

This will build the Docker image and start the container with the XBee network and the required setup.

4. Health Check and Container Management

The container includes a health check that pings the XBee network interface to ensure it is functioning properly. The container is configured to restart automatically if the health check fails.

5. Troubleshooting

Ensure the XBee devices are connected to the correct serial ports. Verify the network interfaces using ip a inside the container. The container logs can be viewed using:

docker logs xbee_node