Code Monkey home page Code Monkey logo

sllurp's People

Contributors

daemacles avatar donkikos avatar ewfuentes avatar fviard avatar hanyangzhao avatar ivarveen avatar jettan avatar jonasgroeger avatar lqf96 avatar nhlien93 avatar pbogey avatar ransford avatar reingart avatar sheeley avatar thijmenketel avatar ukrutt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sllurp's Issues

C1G2Filter : overflow error

Hello @fviard

An error occurred when I try to set the tag_filter_mask parameter. I get a C1G2Filter : overflow.
It happens with your sllurp:fviard-develop-v2 branch but it does not happen with the sllurp:fviard-develop_untwisted

tag_filter_mask="e" => works well

INFO:root:[] tag_filter_mask=<e>
INFO:root:[{'AccessSpecID': 0, 'EPC': b'e28068100000003982ebf837', 'EPC-96': b'e28068100000003982ebf837', 'TagSeenCount': 91}] tag_filter_mask=<e>
INFO:root:[{'AccessSpecID': 0, 'EPC': b'e28068100000003982ebf837', 'EPC-96': b'e28068100000003982ebf837', 'TagSeenCount': 83}] tag_filter_mask=<e>
INFO:root:[{'AccessSpecID': 0, 'EPC': b'e28068100000003982ebf837', 'EPC-96': b'e28068100000003982ebf837', 'TagSeenCount': 83}] tag_filter_mask=<e>

tag_filter_mask="000" => does not work

CRITICAL:sllurp.llrp:Error OverflowParameter adding ROSpec: b'LLRP [398] : //C1G2Filter : overflow'
INFO:root:[] tag_filter_mask=<000>

Missing some parantheses / apostrophes in Line 4628 of llrp_proto.py

Thank you for your work. I'm using this code to help me understand LLRP with the Zebra FX 7500.

Line 4628 in llrp_proto.py says: par, _ = decode_all_parameters(data[ubyte_size:], MotoFilterRule, par)

This throws an error when you run the sllurp gui because when this line of code runs, Python thinks MotoFilterRule is a variable.
MotoFilterRule should be 'MotoFilterRule', just as all the other commands have apostrophes around them.

Adding Keepalivespec

Hi,

I'm trying to add Keepalivespec inside 'SET_READER_CONFIG'. In the original version of sllurp, it was like this :

llrp.py

    msg = {
        'SET_READER_CONFIG': {
            'ResetToFactoryDefaults': False,
            'ReaderEventNotificationSpec': {
                'EventNotificationState': {
                    'HoppingEvent': False,
                    'GPIEvent': False,
                    'ROSpecEvent': False,
                    'ReportBufferFillWarning': False,
                    'ReaderExceptionEvent': False,
                    'RFSurveyEvent': False,
                    'AISpecEvent': False,
                    'AISpecEventWithSingulation': False,
                    'AntennaEvent': False,
                    ## Next one will only be available
                    ## with llrp v2 (spec 1_1)
                    #'SpecLoopEvent': False,
                },
            },
            'KeepaliveSpec': {
                'KeepaliveTriggerType': 1,
                'TimeInterval': llrp_keepalive_interval
            },
        }
    }

llrp_proto.py

def encode_KeepaliveSpec(msg):
    msgtype = Message_struct['KeepaliveSpec']['type']
    msg_header = '!HH'
    msg_header_len = struct.calcsize(msg_header)
    data = struct.pack('!B',msg['KeepaliveTriggerType'])
    data += struct.pack('!I',msg['TimeInterval'])
    data = struct.pack(msg_header, msgtype,
                       len(data) + msg_header_len) + data
    return data

Message_struct['KeepaliveSpec'] = {
    'type': 220,
    'fields': [
        'KeepaliveTriggerType',
        'TimeInterval'
    ],
    'encode': encode_KeepaliveSpec
}

I see in the new llrp_proto.py, there is the following

# v1.1:17.2.6.4 KeepaliveSpec Parameter
Param_struct['KeepaliveSpec'] = {
    'type': 220,
    'fields': [
        'KeepaliveTriggerType',
        'TimeInterval',
    ],
    'decode': basic_param_decode_generator(ubyte_uint_unpack,
                                           'KeepaliveTriggerType',
                                           'TimeInterval')
}

I guessing i'll need to add the encoding call here. However I'm having a bit of trouble understand how the data is being encoded. In the original version you could calculate the size of each data field and append, but the refactor seems to do something different. Do you have any pointer?

Thanks

Maintainership?

@fviard: how would you feel about becoming the maintainer of sllurp?

This would involve a few things:

  • Merge your popular fviard-develop-v2 branch
  • Make a new release with a version bump and push to PyPI

I've already moved sllurp to a new GitHub organization (http://github.com/sllurp) and could make you an administrator of that as well. I believe CI hasn't broken. I'd have to make you an owner on PyPI as well.

It's up to you, of course! You were the first person I thought of because you've helped many people find your branch/fork and have been helpful in GitHub issues and such.

Cleanup of the qtgui for pep8

Hi @papapel ,
Looking at the Gui you provided, I think that you might still be new to python, so I hope that you will not mind my following recommandations:

For the GUI, the code is working good, but I see that you are not following the usual Python "codestyle", so I think that you may not be aware of it.

For Python, the codestyle is not very strongly enforced, but there is a standard one that is recommended by the Python project and that is used in almost all projects.
It is called PEP-8 (because it is the number of the PEP specification defining it).
By following it, you make the code more readable and easy to understand by other people.

The best resource I have found to give a summary of the rules is this page:
https://pep8.org/

Also, there are 2 python command line tools that can be useful as they scan the code, and inform you of the line that are not conformant:
pylint or pycodestyle

So, to come to the point of this issue:
It would be nice if you could rework the code style of the gui and do a new PR with the changes so that it will be more conformant to pep-8.

For example, I see a lot of issues with long lines and missing spaces around "=" for assignements.

I could do it, but I don't have so much free time :-p and also, foremost, I think that it would be a good exercice for you if you want to gain in Python skills.

Thank you!
Don't hesitate to tell me if you need help or have questions.

error sllurp access

sllurp access -mb 2 -r 6 192.168.1.240

File "C:\Users\arhey\AppData\Local\Programs\Python\Python38\lib\site-packages\sllurp-2.0-py3.8.egg\sllurp\llrp_proto.py", line 1529, in encode_AccessSpec
int(par['AntennaID']),

Start scanning after connect after packit in class

I pack the reader logic in a class so my project is like
UI
-RFID.py(The class)
Call sllurp here

When I create the RFID class, it start to scan already, before I call the join which I comment out while debugging.

Here is my testing code
UI:

import RFID
scanning = RFID.Rfid("testing.db")
print(scanning.scan())

RFID.py:

from sllurp.llrp import LLRPReaderConfig, LLRPReaderClient, LLRP_DEFAULT_PORT
class Rfid():
    def __init__(self, dbname):
        //////Some db init and config
        config = LLRPReaderConfig()
        config.update_config({'impinj_reports': True, 'report_every_n_tags': 1,
                              'impinj_tag_content_selector': {'EnableRFPhaseAngle': True, 'EnablePeakRSSI': True,
                                                              'EnableRFDopplerFrequency': False}})

        self.reader = LLRPReaderClient(READER_IP_ADDRESS, LLRP_DEFAULT_PORT, config)
        self.reader.add_tag_report_callback(self.tag_report_cb)
        self.reader.connect()

        print("initialized")

    def tag_report_cb(reader, space, tag_reports):
        print("Call back")
        ////More db and logic

I am having a hard time understanding the Continuous reading

Hi, fviard, and thanks a lot for your work with IMPINJ readers.
I have one here and I am trying to make continuous readings, but withou sucess. I run the Quick start, but I only receive one tag reading from the reader, nothing more.
I have wrote a while loop trying to understand how to get contiunous readings, but only connecting and disconnecting the reader I can achieve that: something make me feel that this is the wrong way to use the library.

I attached my code just in caseyou can take a look. And I am newbie in Python and any other High Level language. I am most used to Microcontrollers and C, so, if you can give me a little help, I would be very glad
teste.txt
!

TypeError: unsupported operand type(s) for >>: 'tuple' and 'int'

Hello,

I was using Ben Ransford's sllurp and decided to give this version a try, because I can't wrap my head around twisted.

I am using a Zebra FX9500 fixed RFID reader. Running sllurp inventory <host> resulted in the error from the title:

TypeError: unsupported operand type(s) for >>: 'tuple' and 'int'

This happened when decode_C1G2TagInventoryStateAwareSingulationAction was called, from llrp_proto, because ISA was (0,) in my case.

I modified the fucntion to:

def decode_C1G2TagInventoryStateAwareSingulationAction(data, name=None):
    logger.debugfast('decode_C1G2TagInventoryStateAwareSingulationAction')
    par = {}

    ISA = ubyte_unpack(data)[0]
    par['I'] = (ISA >> 7) and 'State_B' or 'State_A'
    par['S'] = ((ISA >> 6) & 1) and 'Not_SL' or 'SL'
    par['A'] = ((ISA >> 5) & 1) and 'All' or 'No'

    return par, 

and it worked well afterwards. Well, I mean I still need to find a way to stop the inventory process, after some time :)

I guess the decode_C1G2TagInventoryStateAwareSingulationAction function needs to check ISA type before the byte shifting happens or add a try-except clause. I've started to learn programming 1,5 years ago, so I'll let you decide how to best handle it :).

Support for multiple readers in v2

Hi,

I was looking at the code for enabling specific antennas readers and noticed the following in llrp.py

class LLRPReaderConfig(object):
    def __init__(self, config_dict=None):
        self.duration = None
        self.tari = 0
        self.session = 2
        self.mode_identifier = None
        self.tag_population = 4
        self.report_every_n_tags = None
        self.report_timeout_ms = 0
        self.antennas = [1] 

Does that mean the software is hard-coded to only use the antenna #1? Any reason why it's hard-coded?

Thanks

sllurp doesn't re-send ROSPEC on reconnection?

Hi,

I'm currently testing this fork for performance gain over the original software. I have found when the llrp reader gets rebooted, sllurp will eventually reconnect to it but not send any ROSPEC to restart the operation. Is there a quick fix for this?

Thanks

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.