GithubHelp home page GithubHelp logo

vasanthl / esp32qrcodereader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alvarowolfx/esp32qrcodereader

0.0 0.0 0.0 51 KB

A library to read QR Codes using an ESP32 with a camera module.

License: MIT License

C 90.32% C++ 8.66% Objective-C 1.02%

esp32qrcodereader's Introduction

ESP32 QR Code Reader

This library provides a interface to read QR Codes using an ESP32 with a camera.

Internally this lib uses a slight modified version of the Quirc library and some code from OpenMV port on the MaixPy project.

Demos

Usage

Is recommended to use PlatformIO to install this lib. Add ESP32QRCodeReader to your platformio.ini file.

From PlatformIO library:

lib_deps=
  ESP32QRCodeReader

Directly from Github:

lib_deps =
  alvarowolfx/ESP32QRCodeReader

Examples

This library comes with a number of example sketches. See File > Examples > ESP32QRCodeReader within the Arduino application. You can see them on the examples folder on this repository.

Basic example:

#include <ESP32QRCodeReader.h>

// See available models on README.md or ESP32CameraPins.h
ESP32QRCodeReader reader(CAMERA_MODEL_AI_THINKER);

void onQrCodeTask(void *pvParameters)
{
  struct QRCodeData qrCodeData;

  while (true)
  {
    if (reader.receiveQrCode(&qrCodeData, 100))
    {
      Serial.println("Found QRCode");
      if (qrCodeData.valid)
      {
        Serial.print("Payload: ");
        Serial.println((const char *)qrCodeData.payload);
      }
      else
      {
        Serial.print("Invalid: ");
        Serial.println((const char *)qrCodeData.payload);
      }
    }
    vTaskDelay(100 / portTICK_PERIOD_MS);
  }
}

void setup()
{
  Serial.begin(115200);
  Serial.println();

  reader.setup();
  reader.beginOnCore(1);
  xTaskCreate(onQrCodeTask, "onQrCode", 4 * 1024, NULL, 4, NULL);
}

Limitations

  • Need an ESP32 module with PSRAM - See below.

Compatible Hardware

The QR Code recognition lib required a lot of memory, so I was only able to get this to work with an ESP32 that has PSRRAM available and also the Quirc library is modified to use that directly.

  • ESP32 module
  • PSRAM Available
  • Camera module - Tested with OV2640

ESP32 modules with camera that have PSRAM and should work:

  • CAMERA_MODEL_WROVER_KIT
  • CAMERA_MODEL_ESP_EYE
  • CAMERA_MODEL_M5STACK_PSRAM
  • CAMERA_MODEL_M5STACK_V2_PSRAM
  • CAMERA_MODEL_M5STACK_WIDE
  • CAMERA_MODEL_AI_THINKER

ESP32 modules without PSRAM that will not work:

  • CAMERA_MODEL_M5STACK_ESP32CAM
  • CAMERA_MODEL_TTGO_T_JOURNAL

License

This code is released under the MIT License.

References

esp32qrcodereader's People

Contributors

alvarowolfx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.