Skip to content

ntilau/IoT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

IoT Project

Multi-platform wireless IoT firmware repository featuring Bluetooth Low Energy (BLE) tracking and Sub-GHz wireless communication systems.

πŸ“‹ Project Overview

This repository contains embedded firmware for two distinct IoT applications:

Module Technology Microcontroller Frequency Purpose
BLE Bluetooth Low Energy TI CC2640/CC2650 2.4 GHz IoT tracker/beacon
SubGHz FSK/OOK Radio PIC18F4620 868 MHz Wireless counter network

πŸš€ Quick Start

Building BLE Firmware

cd BLE/src
# Use TI Code Composer Studio or similar tools
# Refer to BLE/README.md for detailed instructions

Building SubGHz Firmware

# Base Station
cd SubGHz/BS
make

# Peripheral Stations (all 4 modules)
cd SubGHz/PS
make all          # Builds ps1.hex, ps2.hex, ps3.hex, ps4.hex
make PS1          # Build individual module

πŸ“ Repository Structure

IoT/
β”œβ”€β”€ README.md                    # This file
β”œβ”€β”€ BLE/
β”‚   β”œβ”€β”€ README.md                # BLE project documentation
β”‚   β”œβ”€β”€ src/                     # BLE firmware source
β”‚   └── cc26xxware/              # TI driver library
└── SubGHz/
    β”œβ”€β”€ README.md                # Sub-GHz documentation
    β”œβ”€β”€ BUILD.md                 # Additional build details
    β”œβ”€β”€ BS/                      # Base station firmware
    β”‚   β”œβ”€β”€ main.c               # BS main code
    β”‚   β”œβ”€β”€ Makefile             # Build configuration
    β”‚   └── pic18f4620.h         # Microcontroller header
    └── PS/                      # Peripheral stations (PS1-PS4)
        β”œβ”€β”€ main.c               # Unified PS source (configurable)
        β”œβ”€β”€ Makefile             # Multi-module build
        └── pic18f4620.h         # Microcontroller header

πŸ”§ Tools & Requirements

BLE Development

  • IDE: TI Code Composer Studio or similar
  • Compiler: TI ARM compiler (included in CCS)
  • Microcontroller: CC2640 or CC2650
  • Programmer: TI XDS100 or similar JTAG debugger

SubGHz Development

  • Compiler: SDCC v2.9.0 (Small Device C Compiler)
  • Utilities: gputils v0.13.7
  • Programmer: PICkit 2 v2.61.00
  • Microcontroller: PIC18F4620
  • Transceiver: QUASAR ALPHA-TRX868S

πŸ’» Installation

SDCC (for SubGHz)

# macOS
brew install sdcc gputils

# Ubuntu/Debian
sudo apt-get install sdcc gputils

# Or download from: http://sdcc.sourceforge.net/

PICkit 2

Download from Microchip's website or use open-source alternatives like pk2cmd.

πŸ“š Documentation

πŸ—οΈ Architecture

SubGHz Wireless Network

The SubGHz module implements a master-slave architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Base Station (BS)                   β”‚
β”‚  β€’ Master controller                 β”‚
β”‚  β€’ Polls peripherals sequentially    β”‚
β”‚  β€’ Aggregates counter data           β”‚
β”‚  β€’ Controls 16 GPIO outputs (4/PS)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”˜
         β”‚        β”‚        β”‚        β”‚
    868 MHz (wireless protocol)
         β”‚        β”‚        β”‚        β”‚
    β”Œβ”€β”€β”€β”€β–Όβ”€β”  β”Œβ”€β”€β–Όβ”€β”€β”  β”Œβ”€β”€β–Όβ”€β”€β”  β”Œβ”€β”€β–Όβ”€β”€β”
    β”‚ PS1  β”‚  β”‚ PS2 β”‚  β”‚ PS3 β”‚  β”‚ PS4 β”‚
    β”‚0x01  β”‚  β”‚0x02 β”‚  β”‚0x03 β”‚  β”‚0x04 β”‚
    β””β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”˜

Communication Protocol:

  • Base Station β†’ Peripheral: 0x5A + MODULE_ID
  • Peripheral β†’ Base Station: 0x2D + 0xA5 + 0x5A + [data] + checksum + 0xEF

πŸ”¨ Build Features

Code Consolidation

  • βœ… Test variants (main_1.c - main_4.c) consolidated into single main.c
  • βœ… Conditional BUILD_MODE flags for testing without separate files
  • βœ… All 4 PS modules built from unified source with configurable MODULE_ID
  • βœ… Single Makefile generates multiple firmware images

Build Targets (SubGHz)

cd SubGHz/PS
make all          # Build all PS modules
make PS1          # Build PS1 only (-DMODULE_ID=0x01)
make PS2          # Build PS2 only (-DMODULE_ID=0x02)
make PS3          # Build PS3 only (-DMODULE_ID=0x03)
make PS4          # Build PS4 only (-DMODULE_ID=0x04)
make clean        # Remove build artifacts

πŸ“‹ Features

BLE Module:

  • CC26xx-based BLE tracker/beacon
  • Low-power operation
  • TI driver library integration

SubGHz Module:

  • 868 MHz wireless communication
  • Base station + 4 configurable peripheral stations
  • Checksum-based error detection
  • GPIO-based counter I/O
  • Optional test modes for development

πŸ“ License

See individual module documentation for license information.

🀝 Contributing

Contributions welcome! Please maintain code consolidation principles:

  1. Avoid duplicating module-specific variants
  2. Use compile-time configuration flags (e.g., MODULE_ID, BUILD_MODE)
  3. Update documentation with any changes
  4. Test all build targets before committing

πŸ“ž Support

For issues or questions, refer to:

  • Individual module README files
  • BUILD.md files for detailed build instructions
  • Inline code comments for implementation details

About

Embedded software experiments

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages