Skip to content

Commit

Permalink
add nrf24tool
Browse files Browse the repository at this point in the history
by OuinOuin74
  • Loading branch information
xMasterX committed Nov 11, 2024
1 parent ffdaa14 commit 35b8ffd
Show file tree
Hide file tree
Showing 36 changed files with 6,304 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Apps contains changes needed to compile them on latest firmware, fixes has been

The Flipper and its community wouldn't be as rich as it is without your contributions and support. Thank you for all you have done.

### Apps checked & updated at `11 Nov 13:32 GMT +3`
### Apps checked & updated at `11 Nov 20:49 GMT +3`


# Default pack
Expand Down Expand Up @@ -207,8 +207,9 @@ The Flipper and its community wouldn't be as rich as it is without your contribu
| SD-SPI | ![GPIO Badge] | [by Gl1tchub](https://github.com/Gl1tchub/Flipperzero-SD-SPI) | read more details in original repo | ![None Badge] |
| ICM42688 Air Mouse | ![GPIO Badge] | [by nminaylov](https://github.com/flipperdevices/flipperzero-good-faps/pull/83/files) | read more details in [original repo](https://github.com/flipperdevices/flipperzero-good-faps/pull/83/files) | ![None Badge] |
| WS2812B LED Tester | ![GPIO Badge] | [by jamisonderek](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio/ws2812b_tester) | read more details in [original repo](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio/ws2812b_tester) | ![None Badge] |
| W5500 Ethernet Tester | ![GPIO Badge] | [by karasevia](https://github.com/karasevia/finik_eth) | [with fixes by arag0re](https://github.com/arag0re/fz-eth-troubleshooter/tree/hexUiFix) read more details in original repo | ![None Badge] |
| W5500 Ethernet Tester | ![GPIO Badge] | [by karasevia](https://github.com/karasevia/finik_eth) | [with fixes by arag0re](https://github.com/arag0re/fz-eth-troubleshooter/tree/hexUiFix) read more details in ReadMe + SPI and UI fixes by @xMasterX | ![None Badge] |
| Simultaneous UHF RFID | ![GPIO Badge] | [by haffnerriley](https://github.com/haffnerriley/Simultaneous-UHF-RFID-FlipperZero) | read more details in original repo | [![Author Badge]](https://lab.flipper.net/apps/simultaneous_rfid_reader) |
| NRF24 Tool | ![GPIO Badge] | [by OuinOuin74](https://github.com/OuinOuin74/nrf24tool) | read more details in original repo | ![None Badge] |
| IR Remote | ![IR Badge] | [by Hong5489](https://github.com/Hong5489/ir_remote) | improvements [by friebel](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/535) - Hold Option, RAW support [by d4ve10](https://github.com/d4ve10/ir_remote/tree/infrared_hold_option) | ![None Badge] |
| IR Intervalometer | ![IR Badge] | [by Nitepone](https://github.com/Nitepone/flipper-intervalometer) | | [![UFW Badge]](https://lab.flipper.net/apps/sony_intervalometer) |
| IR Xbox Controller | ![IR Badge] | [by gebeto](https://github.com/gebeto/flipper-xbox-controller) | | [![Author Badge]](https://lab.flipper.net/apps/xbox_controller) |
Expand Down
41 changes: 41 additions & 0 deletions non_catalog_apps/nrf24tool/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "FAP: Build for multiple SDK sources"
# This will build your app for dev and release channels on GitHub.
# It will also build your app every day to make sure it's up to date with the latest SDK changes.
# See https://github.com/marketplace/actions/build-flipper-application-package-fap for more information

on:
push:
## put your main branch name under "branches"
#branches:
# - master
pull_request:
schedule:
# do a build every day
- cron: "1 1 * * *"

jobs:
ufbt-build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: dev channel
sdk-channel: dev
- name: release channel
sdk-channel: release
# You can add unofficial channels here. See ufbt action docs for more info.
name: 'ufbt: Build for ${{ matrix.name }}'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build with ufbt
uses: flipperdevices/[email protected]
id: build-app
with:
sdk-channel: ${{ matrix.sdk-channel }}
- name: Upload app artifacts
uses: actions/upload-artifact@v3
with:
# See ufbt action docs for other output variables
name: ${{ github.event.repository.name }}-${{ steps.build-app.outputs.suffix }}
path: ${{ steps.build-app.outputs.fap-artifacts }}
7 changes: 7 additions & 0 deletions non_catalog_apps/nrf24tool/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist/*
.vscode
.clang-format
.clangd
.editorconfig
.env
.ufbt
135 changes: 135 additions & 0 deletions non_catalog_apps/nrf24tool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# nrf24tool

![License](https://img.shields.io/badge/license-MIT-green) ![Status](https://img.shields.io/badge/status-active-brightgreen)

A complete tool for the **Flipper Zero** device, designed to interface with the NRF24L01+ transceiver. It offers functionalities such as transmitting, receiving, packet sniffing, and an experimental "mouse jacker" mode for controlling Unifying receivers.

## Table of Contents
- [Overview](#overview)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)
- [Contributing](#contributing)
- [License](#license)
- [Authors](#authors)

## Overview
**nrf24tool** is a dedicated tool for the Flipper Zero, providing various operational modes to work with NRF24L01+ modules. It supports custom packet transmission, data reception, passive sniffing, and a "mouse jacker" mode for sending keyboard commands through Unifying receivers.

This project utilizes an enhanced version of the **libnrf24** library, which has been improved and expanded to support additional NRF24L01+ functionalities, optimized specifically for the Flipper Zero.

### Credits
- **Sniffer and Mouse Jacker**: Code for these tools and the `libnrf24` library is based on [mothball187's flipperzero-nrf24 repository](https://github.com/mothball187/flipperzero-nrf24). Special thanks to the author for his foundational work !
- **Mouse Jacker**: Also incorporates code from the [Flipper Zero BadUSB app](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/main/bad_usb)

## Features
- **Transmit (TX)**: Send custom data packets and log events to a file. It can also use a text file as input to send multiple packets.
- **Receive (RX)**: Capture incoming data packets with optional event logging.
- **Sniffing Mode**: Monitor network traffic passively and automatically detect Unifying receiver addresses, saving them to a file for use with the Mouse Jacker tool.
- **Mouse Jacker Mode**: Control Unifying-compatible devices to send keyboard commands remotely, featuring the same functionalities as the **BadUsb** tool it’s inspired by, including full keyboard layout support.

### Additional TX and RX Mode Capabilities

- **TX Mode Data Format**: The TX tool can send data in hexadecimal format, ASCII format, or directly from a file, providing flexibility in how data packets are transmitted.
- **RX Mode Display Options**: The RX tool allows for real-time viewing of incoming data in either hexadecimal (binary) or ASCII format. The display format can be toggled by pressing the "OK" button on the Flipper Zero device.

## Installation

> **⚠ WARNING:** This program requires Flipper Zero firmware version **1.1.2** or higher. It will not function correctly on earlier versions.
1. **Clone the repository**:
```bash
git clone https://github.com/OuinOuin74/nrf24tool.git
cd nrf24tool
```

2. **Compile with UFBT for Flipper Zero**:
Use the **ufbt** tool to compile the project for the Flipper Zero. For more details on installation and usage, visit the [Flipper Zero ufbt repository](https://github.com/flipperdevices/flipperzero-ufbt).

```bash
ufbt build
```

## Usage

This tool runs directly on the Flipper Zero, and all functionalities (TX, RX, Sniffing, Mouse Jacker) are accessible through the device’s interface. Configuration is available on-screen, allowing for mode selection, parameter adjustment, and enabling event logging.

## Settings Overview

Each mode includes a set of configurable settings, allowing for customized operation. Below is a list of settings available for each mode:

### RX Mode Settings (`RxSettingIndex`)
- **RX_SETTING_CHANNEL**: Channel to listen on.
- **RX_SETTING_DATA_RATE**: Data rate for communication (e.g., 250kbps, 1Mbps, 2Mbps).
- **RX_SETTING_ADDR_WIDTH**: Address width for the receiver address.
- **RX_SETTING_CRC**: Cyclic Redundancy Check (CRC) mode for data integrity.
- **RX_SETTING_RPD**: Received Power Detector to assess signal strength.
- **RX_SETTING_ACK_PAY**: Enable or disable acknowledgement payloads.
- **RX_SETTING_P0_PAYLOAD**: Payload size for Pipe 0.
- **RX_SETTING_P0_AUTO_ACK**: Enable or disable auto-acknowledgment for Pipe 0.
- **RX_SETTING_P0_ADDR**: Address for Pipe 0.
- **RX_SETTING_P1_PAYLOAD**: Payload size for Pipe 1.
- **RX_SETTING_P1_AUTO_ACK**: Enable or disable auto-acknowledgment for Pipe 1.
- **RX_SETTING_P1_ADDR**: Address for Pipe 1.
- **RX_SETTING_P2_PAYLOAD**: Payload size for Pipe 2.
- **RX_SETTING_P2_AUTO_ACK**: Enable or disable auto-acknowledgment for Pipe 2.
- **RX_SETTING_P2_ADDR**: Address for Pipe 2.
- **RX_SETTING_P3_PAYLOAD**: Payload size for Pipe 3.
- **RX_SETTING_P3_AUTO_ACK**: Enable or disable auto-acknowledgment for Pipe 3.
- **RX_SETTING_P3_ADDR**: Address for Pipe 3.
- **RX_SETTING_P4_PAYLOAD**: Payload size for Pipe 4.
- **RX_SETTING_P4_AUTO_ACK**: Enable or disable auto-acknowledgment for Pipe 4.
- **RX_SETTING_P4_ADDR**: Address for Pipe 4.
- **RX_SETTING_P5_PAYLOAD**: Payload size for Pipe 5.
- **RX_SETTING_P5_AUTO_ACK**: Enable or disable auto-acknowledgment for Pipe 5.
- **RX_SETTING_P5_ADDR**: Address for Pipe 5.
- **RX_SETTING_LOGGING**: Enable or disable event logging.

### TX Mode Settings (`TxSettingIndex`)
- **TX_SETTING_CHANNEL**: Transmission channel.
- **TX_SETTING_DATA_RATE**: Data rate for transmission (e.g., 250kbps, 1Mbps, 2Mbps).
- **TX_SETTING_ADDR_WIDTH**: Address width for transmission.
- **TX_SETTING_TX_ADDR**: Transmitter address.
- **TX_SETTING_PAYLOAD_SIZE**: Size of the payload to be sent.
- **TX_SETTING_FROM_FILE**: Enable or disable loading packets from a file.
- **TX_SETTING_AUTO_ACK**: Enable or disable auto-acknowledgment.
- **TX_SETTING_SEND_COUNT**: Number of packets to send.
- **TX_SETTING_TX_INTERVAL**: Interval between packet transmissions.
- **TX_SETTING_ACK_PAY**: Enable or disable acknowledgment payloads.
- **TX_SETTING_CRC**: Cyclic Redundancy Check (CRC) for data integrity.
- **TX_SETTING_TX_POWER**: Transmission power level.
- **TX_SETTING_ARC**: Automatic retransmission count.
- **TX_SETTING_ARD**: Automatic retransmission delay.
- **TX_SETTING_LOGGING**: Enable or disable logging of transmitted events.

### Sniffer Mode Settings (`SniffSettingIndex`)
- **SNIFF_SETTING_MIN_CHANNEL**: Minimum channel to scan.
- **SNIFF_SETTING_MAX_CHANNEL**: Maximum channel to scan.
- **SNIFF_SETTING_SCAN_TIME**: Time spent scanning each channel.
- **SNIFF_SETTING_DATA_RATE**: Data rate for sniffing mode.
- **SNIFF_SETTING_RPD**: Received Power Detector to assess signal strength.

### Mouse Jacker Mode Settings (`BadmouseSettingIndex`)
- **BADMOUSE_SETTING_ADDR_INDEX**: Index for the address of target Unifying receiver.
- **BADMOUSE_SETTING_KB_LAYOUT**: Keyboard layout setting for compatibility.
- **BADMOUSE_SETTING_DATA_RATE**: Data rate for communication with the Unifying receiver.
- **BADMOUSE_SETTING_TX_POWER**: Transmission power level.
- **BADMOUSE_SETTING_TX_RETRY**: Number of retries for packet transmission.
- **BADMOUSE_SETTING_KEY_DELAY**: Delay between key presses when sending commands.

## Configuration
Modify `settings.conf` directly or adjust configurations via the Flipper Zero interface.

## Contributing

Contributions are welcome! To contribute:
1. Fork this repository.
2. Create a new branch for your feature.
3. Commit and push your changes, then open a pull request.

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Authors
- **OuinOuin74** - *Creator and main developer* - [GitHub Profile](https://github.com/OuinOuin74)
17 changes: 17 additions & 0 deletions non_catalog_apps/nrf24tool/application.fam
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# For details & more options, see documentation/AppManifests.md in firmware repo

App(
appid="nrf24tool", # Must be unique
name="[NRF24] Tool", # Displayed in menus
apptype=FlipperAppType.EXTERNAL,
entry_point="nrf24tool_app",
stack_size=4 * 1024,
fap_category="GPIO",
# Optional values
fap_version="1.0",
fap_icon="nrf24tool.png", # 10x10 1-bit PNG
fap_description="Utility app for NRF24L01",
fap_author="S. Terrier",
fap_weburl="https://github.com/OuinOuin74/nrf24tool",
fap_icon_assets="images", # Image assets to compile for this application
)
Loading

0 comments on commit 35b8ffd

Please sign in to comment.