Skip to content

Sensor Pairing (OCR) Technical Overview

Overview

The Pair Sensor screen enables users to quickly and accurately pair a level sensor with their Smarta device by scanning the sensor's MAC address using the device camera and Optical Character Recognition (OCR). This feature streamlines the pairing process, especially on iOS devices, by eliminating manual entry errors.

Key Functionalities

1. Camera-Based MAC Address Scanning

  • Camera Integration:
    • The screen requests camera permissions and displays a live camera preview for scanning.
    • Users are prompted to ensure the MAC address is clearly visible and in focus.
  • OCR Processing (iOS):
    • On iOS, the app uses the react-native-text-recognition library to extract text from the camera image.
    • The system automatically scans for a valid MAC address pattern and, if found, navigates back to the local device screen with the detected MAC address.
    • The scan process repeats every 2 seconds until a MAC address is detected or the user leaves the screen.
  • Zoom Controls:
    • Users can zoom in and out to help focus on the MAC address label.

2. User Experience & Feedback

  • Permission Handling:
    • If camera permission is not granted, the user is prompted to allow access.
  • Status Indicators:
    • The UI displays scanning status and a loading indicator while processing.
    • A footer message clarifies that OCR scanning is currently only available on iOS.

3. Security & Data Handling

  • No Data Storage:
    • Images and recognized text are processed in-memory and not stored on the device.
  • Navigation:
    • On successful scan, the detected MAC address is passed to the local device screen for further configuration.