Real time data streaming - Error with Python Command

hey,

i'm following the github repository for RTDS via the following link:

https://github.com/urbanairship/connect-python-library

when i'm running the Python script and changing the following parameters: 

Url (for EU), app key, access token. 

>>> import uaconnect
>>> consumer = uaconnect.Consumer(
...     'application_key', 'access_token',
...     uaconnect.FileRecorder('.offset'))
>>> consumer.connect()
>>> for event in consumer.read():
...     if event is None:
...        continue
>>>     print("Got event: {}".format(event))
>>>     consumer.ack(event)

i'm receiving the following error: 

Traceback (most recent call last):
  File "C:\Users\asafha\PycharmProjects\Learning_Project\venv\Airship int live streaming.py", line 5, in <module>
    consumer.connect()
  File "C:\Users\asafha\PycharmProjects\Learning_Project\venv\lib\site-packages\uaconnect\consumer.py", line 241, in connect
    elif self.start:
AttributeError: 'Consumer' object has no attribute 'start'

please note, that with Curl Command i'm receiving the events.

questions: 

1. should i add Bearer string before the access_token such as in Curl command? 

2. how can i solve this error and get the streaming events? 

Assaf 

 

 

 

Didn't find what you were looking for?

New post

Comments

2 comments

  • Hi Assaf, 

     

    Thanks so much for contacting Airship Technical Support. We can definitely help you with this! It appears that the full error and code aren't listed, do you mind kindly adding it so we can take a closer look? 

     

    In addition to this, have you been able to follow along with our RTDS Python documentation in GitHub and our Airship Documentation? Here are those documents if you need additional resources: GitHub and Airship Documentation.

     

    In regards to your question, the Bearer string is added automatically, and the reason that the cURL command is appearing is due to the Bearer Authentication. 

     

    If you have any additional questions or concerns, please kindly let us know as we'd be happy to help you! 

     

    Thank you for your time and patience in advance. 

     

    Best Wishes,

    Ashley Y.

    Technical Support Engineer | New York

    Comment actions Permalink
  • hi,

    I'm facing the same problem do you have any solution ?

    Comment actions Permalink
    0

Please sign in to leave a comment.