Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to replace the original tag name #19

Open
nkargas opened this issue Mar 1, 2022 · 13 comments
Open

How to replace the original tag name #19

nkargas opened this issue Mar 1, 2022 · 13 comments

Comments

@nkargas
Copy link
Owner

nkargas commented Mar 1, 2022

Thank you @nkargas for the awesome code and a starter for me. I face an issue with multiple tags with their own EPC name instead of Tag ID such as e1 etc 0, 1. How we are able to replace the original tag name?

image

Originally posted by @MuhammadZakirKhan in #4 (comment)

@nkargas
Copy link
Owner Author

nkargas commented Mar 1, 2022

Hello, what do you mean by replacing the original tag name? Can you give some more information? The reader decodes the EPC and prints part of it. See line 349 of tag_decoder_impl.cc.

@MuhammadZakirKhan
Copy link

MuhammadZakirKhan commented Mar 1, 2022 via email

@nkargas
Copy link
Owner Author

nkargas commented Mar 1, 2022

Regarding the first question: Is the reader able to read each tag individually? e.g., what happens if the num slots is 1 and you try to read a single tag (each one of them)?

For the tag id, the decoder reads bits EPC_bits[104:111] and computes an integer (result) in tag_decoder_impl.cc.
int result = 0;
for(int i = 0 ; i < 8 ; ++i)
{
result += std::pow(2,7-i) * EPC_bits[104+i] ;
}

Then this value is printed in hex:
std::cout << std::hex << "| Tag ID : " << it->first << " "; in reader_impl.cc

You can alter any of these parts depending on what you want to do and recompile.

I cannot provide any help with CSI, RSSI and phase other than what is already mentioned here: #9.

@MuhammadZakirKhan
Copy link

MuhammadZakirKhan commented Mar 1, 2022 via email

@MuhammadZakirKhan
Copy link

MuhammadZakirKhan commented Mar 1, 2022 via email

@nkargas
Copy link
Owner Author

nkargas commented Mar 5, 2022

This get 8 bits from the EPC and converts it to decimal. It is the part of the EPC that I used to identify each tag.

@MuhammadZakirKhan
Copy link

MuhammadZakirKhan commented Mar 17, 2022

I solved the problem but taking the help of Adam, for extracting the 96 bits EPC code instead of 2 bits.
std::cout << "+ ";
unsigned int id0;
for(int j = 2 ; j < 14 ; ++j)
{
id0= 0;
for(int i = 0 ; i < 8 ; ++i)
id0 += std::pow(2,7-i) * EPC_bits[8 * j + i] ;
std::cout << std::hex << std::setw(2) << std::setfill('0') << id0;
if(j < 13)
std::cout << "-";
}
std::cout << std::dec << " +" << std::flush;

        // Save part of Tag's EPC message (EPC[104:111] in decimal) + number of reads
        std::map<int,int>::iterator it = reader_state->reader_stats.tag_reads.find(result);
        if ( it != reader_state->reader_stats.tag_reads.end())
        {
          it->second ++;
        }
        else
        {
          reader_state->reader_stats.tag_reads[result]=1;
        }

@ht0102
Copy link

ht0102 commented Mar 27, 2022

I solved the problem but taking the help of Adam, for extracting the 96 bits EPC code instead of 2 bits. std::cout << "+ "; unsigned int id0; for(int j = 2 ; j < 14 ; ++j) { id0= 0; for(int i = 0 ; i < 8 ; ++i) id0 += std::pow(2,7-i) * EPC_bits[8 * j + i] ; std::cout << std::hex << std::setw(2) << std::setfill('0') << id0; if(j < 13) std::cout << "-"; } std::cout << std::dec << " +" << std::flush;

        // Save part of Tag's EPC message (EPC[104:111] in decimal) + number of reads
        std::map<int,int>::iterator it = reader_state->reader_stats.tag_reads.find(result);
        if ( it != reader_state->reader_stats.tag_reads.end())
        {
          it->second ++;
        }
        else
        {
          reader_state->reader_stats.tag_reads[result]=1;
        }

Hello, can you make it clearer? Thank you very much!

@enhenf
Copy link

enhenf commented May 17, 2022

@MuhammadZakirKhan Hi, do you solve the problem of CSI, RSSI and phase? I want to know how to extract them too. Thank you very much!

@MuhammadZakirKhan
Copy link

I solved the problem but taking the help of Adam, for extracting the 96 bits EPC code instead of 2 bits. std::cout << "+ "; unsigned int id0; for(int j = 2 ; j < 14 ; ++j) { id0= 0; for(int i = 0 ; i < 8 ; ++i) id0 += std::pow(2,7-i) * EPC_bits[8 * j + i] ; std::cout << std::hex << std::setw(2) << std::setfill('0') << id0; if(j < 13) std::cout << "-"; } std::cout << std::dec << " +" << std::flush;

        // Save part of Tag's EPC message (EPC[104:111] in decimal) + number of reads
        std::map<int,int>::iterator it = reader_state->reader_stats.tag_reads.find(result);
        if ( it != reader_state->reader_stats.tag_reads.end())
        {
          it->second ++;
        }
        else
        {
          reader_state->reader_stats.tag_reads[result]=1;
        }

Hello, can you make it clearer? Thank you very much!

Dear @ht0102, initially it was 8 bit EPC code extraction and then passing to the main file for counting the number of unique tags and now i added a loop to help me extracting of 96 bits of EPC code and then i converted into ASCII code.

@MuhammadZakirKhan
Copy link

@MuhammadZakirKhan Hi, do you solve the problem of CSI, RSSI, and phase? I want to know how to extract them too. Thank you very much!

Dear @enhenf, I have not extracted CSI only the amplitude and phase so far.

@enhenf
Copy link

enhenf commented May 17, 2022

@MuhammadZakirKhan Hi, do you solve the problem of CSI, RSSI, and phase? I want to know how to extract them too. Thank you very much!

Dear @enhenf, I have not extracted CSI only the amplitude and phase so far.

Thank you very much for your reply!
Even extracting the amplitude and phase is important to me, so I would like to know how you did it.
I'm currently trying the solution mentioned in #9, but it's not working well.

@MuhammadZakirKhan
Copy link

@MuhammadZakirKhan Hi, do you solve the problem of CSI, RSSI, and phase? I want to know how to extract them too. Thank you very much!

Dear @enhenf, I have not extracted CSI only the amplitude and phase so far.

Thank you very much for your reply! Even extracting the amplitude and phase is important to me, so I would like to know how you did it. I'm currently trying the solution mentioned in #9, but it's not working well.

Exactly I have followed #9 but the problem is same then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants