🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    UHF RFID unit problems interfacing with arduino mega using code example from github

    Scheduled Pinned Locked Moved Units
    uhfrfidarduino
    2 Posts 2 Posters 4.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K Offline
      kasperhvid
      last edited by

      Hello,

      I have purchased your reader and i am trying to port the library from this url:

      https://github.com/m5stack/M5Unit-UHF-RFID

      To work on an arduino mega. So far i'm not having much luck. I can't even get the UHF RFID unit to print its version using getVersion in setup void much less read my tags..

      I have made the following changes to the .begin void in order to accomodate it being a mega:

      /*! @brief Initialize the Unit UHF_RFID.*/
      void Unit_UHF_RFID::begin(HardwareSerial *serial, long baud, bool debug) {
         _debug  = debug;
         _serial = serial;
         _serial->begin(baud);
      }
      

      And then my setup void looks like this:

      #include "Unit_UHF_RFID.h"
      
      Unit_UHF_RFID uhf;
      
      String info = "";
      
      void setup() {
       // put your setup code here, to run once:
       Serial.begin(9600);
       Serial.println("Serial begin");
      
       uhf.begin(&Serial2, 115200, false);
      
       Serial.println("Serial begin2");
      
       while (1) {
         info = uhf.getVersion();
         Serial.println("Version: "+info);
         if (info != "ERROR") {
           Serial.println(info);
           break;
         }
       }
       Serial.println("Version: "+info);
       // max: 26dB
       uhf.setTxPower(2600);
      
      
      }
      

      Hope someone can help me understand why this isn't working..

      1 Reply Last reply Reply Quote 0
      • P Offline
        pierrethr
        last edited by

        Hi @kasperhvid, any luck on that?
        I was hoping to do the same but all I get is an obscure "ERROR" response back from the getVersion() method.

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post