Skip to content

Commit

Permalink
Merge pull request #1 from haffnerriley/yrm-release
Browse files Browse the repository at this point in the history
adding new files for next release
  • Loading branch information
haffnerriley authored Aug 29, 2024
2 parents 93ebda6 + a0f2b18 commit 57e2e3a
Show file tree
Hide file tree
Showing 43 changed files with 4,149 additions and 196 deletions.
46 changes: 36 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Now available on the official Flipper Zero [app catalog](https://github.com/flipperdevices/flipper-application-catalog)!

## Overview
This app is designed to work with the M6e Nano UHF RFID Reader and the Flipper Zero. This app supports reading up to 150 tags per second, writing to tags (EPC, TID, Reserved, and User Memory Banks), viewing all tag information, saving tags, and more!
This app is designed to work with the M6e Nano, M7E Hecto, and YRM100 UHF RFID Readers and the Flipper Zero. This app supports reading up to 150 tags per second (M6E & M7E only), writing to tags (EPC, TID, Reserved, and User Memory Banks), viewing all tag information, saving tags, and more!

![Main Menu](images/uhf-rfid-m6e-main-menu.png)

Expand All @@ -16,12 +16,19 @@ This app is designed to work with the M6e Nano UHF RFID Reader and the Flipper Z

**Please note that all values scroll across the screen.

![Lock Menu](images/lock-screen.png)

![Kill Tag Screen](images/kill-screen.png)

## Special Note for M6E & M7E Users
Currently, not all features work for the M6E & M7E. In the next release, support for locking, killing, and reading PC/CRC will be added for the M6E & M7E. Stay on the first version of the app to have a more stable version of the app.

## Coming Soon
In the future, I plan on developing a custom pcb that utilizes the M6e Nano module offering a powerful UHF Reader that plugs right into the Flipper Zero! Additionally, I plan to add support for other UHF RFID modules such as the YRM1001 module. Some other feature enhancements to the configuration menu will also be added including custom baud rate, power and antenna selection, UHF RFID module selection, and selecting/setting custom UHF RFID tag types (adjusting read/write size for memory banks).
In the future, I plan on developing a custom pcb that utilizes the M6e Nano module offering a powerful UHF Reader that plugs right into the Flipper Zero! Some other feature enhancements to the configuration menu will also be added in the future including antenna selection, saving configuration menu settings, and selecting/detecting/setting custom UHF RFID tag types (adjusting read/write size for memory banks).


## Features
- Read and view up to 150 UHF RFID tags at once!
- Read and view up to 150 UHF RFID tags at once (M6E & M7E Only)!
- EPC, TID, User, and Reserved Memory Banks
- Can cycle through multiple tags from a single read!
- Save, rename, delete and view UHF tags on your flipper!
Expand All @@ -31,22 +38,33 @@ In the future, I plan on developing a custom pcb that utilizes the M6e Nano modu
- TID Memory Bank (not supported if tag is locked)
- User Memory Bank
- Reserved Memory Bank
- Lock UHF Tags
- Lock each memory bank of the UHF Tag (assuming you know the access password, and the tag isn't permanently locked/unlocked)
- Set access password
- Kill UHF Tags
- Set the kill password
- Permanently inactivate a tag
- UHF RFID Reader Configuration
- Set RF Power
- Set UHF Module
- Set Baud Rate
- Set Region
- Set default access password used for reading/writing/locking operations
- Save on Write (Set this to Yes if you want saved tags to update after writing to them)
- Set antenna type (WIP)
- Features coming soon:
- Support for other UHF RFID Modules (YRM1001)
- Support for custom baud rate, region, protocol, and more!
- Set custom size for user/reserved memory banks to read
- Custom PCB with M6e Nano module and external antenna support!
- Adding support for new features for the M6E & M7E

## Hardware Requirements

Currently, this Flipper Zero application requires an [M6e Nano](https://www.jadaktech.com/product/thingmagic-m6e-nano-uhf-rain-rfid/) compatible UHF RFID Reader. I recommend one of the following options:
- [SparkFun Simultaneous RFID Reader](https://www.sparkfun.com/products/14066)
- The [M7E Hecto](https://www.sparkfun.com/products/24738) that just came out should work too, however, this I haven't been able to test.
- The [YRM100](https://www.alibaba.com/product-detail/Invelion-YRM-1001-The-antenna-is_1600873986609.html) Is now supported for all features!

Additionally, a [Raspberry Pi Zero](https://www.adafruit.com/product/2885) is required in order to run the [ThingMagic Mercury API](https://github.com/gotthardp/python-mercuryapi)
Additionally, if you are using a M6E or M7E, a [Raspberry Pi Zero](https://www.adafruit.com/product/2885) is required in order to run the [ThingMagic Mercury API](https://github.com/gotthardp/python-mercuryapi)
- I hope to eliminate the need for the RPi, however, I thought having it could allow for easier adoption of different UHF RFID readers.

Also, you need the Flipper Zero which is available from [Flipper Devices](https://www.flipperdevices.com).
Expand All @@ -56,13 +74,19 @@ Also, you need the Flipper Zero which is available from [Flipper Devices](https:

1. Clone this GitHub repository to the `applications_user` folder of your Flipper Zero using the firmware of your choice.
2. Using VSCode with the desired firmware:
- Press `Ctrl+Shift+B` in VScode inside the simultaneous-rfid-reader folder
- Press `Ctrl+Shift+B` in VScode inside the simultaneous_rfid_reader folder
- Select the `Launch App on Flipper` option
- If you do not have VScode you can use the following command in your terminal `./fbt COMPACT=1 DEBUG=0 launch APPSRC=applications_user\simultaneous-rfid-reader`
3. Now that you have the app set up, you can follow the instructions below to get the Raspberry Pi Zero working correctly.
- If you do not have VScode you can use the following command in your terminal `./fbt COMPACT=1 DEBUG=0 launch APPSRC=applications_user\simultaneous_rfid_reader`
3. Now that you have the app set up, you can follow the instructions below to get the Raspberry Pi Zero working correctly (M6E & M7E Users Only!).

## YRM100 Wiring

![YRM100 Pinout](images/yrm100-pinout.png)

## UHF RFID Reader & Raspberry Pi Zero Setup
1. To connect the YRM100 to the FLipperZero, just follow the schematic above. Then the module should be ready to commuicate over UART!


## UHF RFID Reader & Raspberry Pi Zero Setup (M6E & M7E Users Only!)

![Raspberry Pi Zero Pinout](images/rpi-zero-pinout.png)

Expand Down Expand Up @@ -104,6 +128,8 @@ I found a few resources useful while developing this app:

4. The `soft_uart` module was super helpful for creating another serial port on the [Raspberry Pi Zero](https://github.com/adrianomarto/soft_uart).

5. Most of the functionality for reading, writing, and interacting with the YRM100 module was modified from [Frux-C's](https://github.com/frux-c/uhf_rfid) UHF-RFID App for the FlipperZero.

## Contributions

Feel free to reach out, or open a PR for bug fixes, ideas, or new feature requests. This application is still a work in progress, so I am open to new ideas or areas for improvement!
Expand Down
Binary file added images/kill-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/lock-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/read-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/write-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/yrm100-pinout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 36 additions & 3 deletions simultaneous_rfid_reader/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ static UHFReaderApp* uhf_reader_app_alloc() {
App->CurResIndex = 1;
App->CurMemIndex = 1;
App->FileName = (char*)malloc(App->NameSize);

//Creating the initial GUI
Gui* Gui = furi_record_open(RECORD_GUI);
App->ViewDispatcher = view_dispatcher_alloc();
view_dispatcher_enable_queue(App->ViewDispatcher);
//view_dispatcher_enable_queue(App->ViewDispatcher);
view_dispatcher_attach_to_gui(App->ViewDispatcher, Gui, ViewDispatcherTypeFullscreen);
view_dispatcher_set_event_callback_context(App->ViewDispatcher, App);

Expand All @@ -107,6 +107,8 @@ static UHFReaderApp* uhf_reader_app_alloc() {
view_read_alloc(App);
view_saved_menu_alloc(App);
view_tag_actions_alloc(App);
view_lock_alloc(App);
view_kill_alloc(App);
view_write_alloc(App);
view_epc_alloc(App);
view_epc_info_alloc(App);
Expand All @@ -123,6 +125,7 @@ static UHFReaderApp* uhf_reader_app_alloc() {
uart_helper_set_baud_rate(App->UartHelper, DEVICE_BAUDRATE);
uart_helper_set_delimiter(App->UartHelper, LINE_DELIMITER, INCLUDE_LINE_DELIMITER);
uart_helper_set_callback(App->UartHelper, uart_demo_process_line, App);

return App;
}

Expand All @@ -141,8 +144,20 @@ static void uhf_reader_app_free(UHFReaderApp* App) {
furi_record_close(RECORD_GUI);

//Freeing the UART helper
uart_helper_free(App->UartHelper);
if(App->UHFModuleType != YRM100X_MODULE){
uart_helper_free(App->UartHelper);
}
else{
//Free Tag Wrapper
uhf_tag_wrapper_free(App->YRM100XWorker->uhf_tag_wrapper);

//Freeing yrm100x worker
uhf_worker_stop(App->YRM100XWorker);
uhf_worker_free(App->YRM100XWorker);
}



//Freeing all views, widgets, and menus
view_delete_free(App);
view_delete_success_free(App);
Expand All @@ -154,6 +169,8 @@ static void uhf_reader_app_free(UHFReaderApp* App) {
view_config_free(App);
view_saved_free(App);
view_tag_actions_free(App);
view_lock_free(App);
view_kill_free(App);

//Freeing the main menu view
view_dispatcher_remove_view(App->ViewDispatcher, UHFReaderViewSubmenu);
Expand Down Expand Up @@ -181,8 +198,24 @@ static void uhf_reader_app_free(UHFReaderApp* App) {
*/
int32_t main_uhf_reader_app(void* _p) {
UNUSED(_p);
Expansion* expansion = furi_record_open(RECORD_EXPANSION);
expansion_disable(expansion);

bool PowerOn = false;

if(!furi_hal_power_is_otg_enabled()) {
furi_hal_power_enable_otg();
PowerOn = true;
}

UHFReaderApp* App = uhf_reader_app_alloc();
view_dispatcher_run(App->ViewDispatcher);

if(PowerOn) {
furi_hal_power_disable_otg();
}
uhf_reader_app_free(App);
expansion_enable(expansion);
furi_record_close(RECORD_EXPANSION);
return 0;
}
24 changes: 20 additions & 4 deletions simultaneous_rfid_reader/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,40 @@
//Defining the UART parameters for communicating with the Raspberry Pi Zero
#define DEVICE_BAUDRATE 9600
#define LINE_DELIMITER '\n'
//#define YRM100X_LINE_DELIMITER 0x7E
#define INCLUDE_LINE_DELIMITER false

//Setting the backlight on
#define BACKLIGHT_ON 1

//Creating different messages used for display
#define TAG "UHF_RFID"
#define WRITE_EPC "EPC Value"
#define WRITE_EPC_MEM "Reserved Memory"
#define TAG "simultaneous_rfid_reader"
#define WRITE_EPC_VAL "EPC Value"
#define WRITE_RES_MEM "Reserved Memory"
#define WRITE_USR_MEM "User Memory"
#define WRITE_TID_MEM "TID Value"
#define WRITE_EPC_OK "EPC Written!"
#define WRITE_EPC_CANCELED "Write Canceled!"
#define WRITE_EPC_FAIL "Write Failed!"

//Content for the about screen
#define UHF_RFID_VERSION_APP "0.1.0"
#define UHF_RFID_VERSION_APP "0.1.1"
#define UHF_RFID_MEM_DEVELOPER "@Haffnerriley"
#define UHF_RFID_GITHUB "https://github.com/haffnerriley"
#define UHF_RFID_NAME "\e#\e! UHF RFID Reader \e!\n"
#define UHF_RFID_BLANK_INV "\e#\e!"
#define YRM100X_MODULE 1
#define M6E_NANO_MODULE 2
#define M7E_HECTO_MODULE 3

#define NO_SAVE_ON_WRITE 1
#define YES_SAVE_ON_WRITE 2
//Defining different region values
#define USA_REGION 0
#define EU_REGION 1
#define KOREA_REGION 2
#define CHINA_800_REGION 3
#define CHINA_900_REGION 4

//Including the different views and helper files
#include "views/view_about.h"
Expand All @@ -36,6 +50,8 @@
#include "views/view_epc_info.h"
#include "views/view_read.h"
#include "views/view_tag_actions.h"
#include "views/view_lock.h"
#include "views/view_kill.h"
#include "helpers/extract_tag_info.h"
#include "helpers/uart_process.h"
#include "helpers/saved_epc_functions.h"
Expand Down
6 changes: 4 additions & 2 deletions simultaneous_rfid_reader/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ App(
name="Simultaneous UHF RFID Reader",
apptype=FlipperAppType.EXTERNAL,
entry_point="main_uhf_reader_app",
stack_size=22 * 1024,
stack_size=28 * 1024,
requires=["gui"],
fap_icon="app.png",
fap_category="GPIO",
fap_icon_assets="icons",
fap_icon_assets_symbol="simultaneous_rfid_reader",
fap_author="@RileyHaffner",
fap_weburl="https://github.com/haffnerriley/Simultaneous-UHF-RFID-FlipperZero",
fap_version="1.0",
fap_description="Simultaneous UHF RFID Reader that supports the M6E Nano Reader. Read up to 150 UHF tags per second!",
fap_description="Simultaneous UHF RFID Reader that supports the M6E Nano, M7E Hecto, and YRM1000 series Readers. Read up to 150 UHF tags per second [Using ThingMagic Readers]!",
)
Loading

0 comments on commit 57e2e3a

Please sign in to comment.