Re: emokit issue - keyerror

22 views
Skip to first unread message
Message has been deleted
Message has been deleted

Bruce D.

unread,
Mar 17, 2017, 4:31:01 PM3/17/17
to openyou


On Friday, 17 March 2017 21:24:01 UTC+1, Bruce D. wrote:
I got it fixed. Changed a lot in the source code I dont know which one was the culprit. But the main difference in output was that '' is research'' changed from  'False' to 'True'.



On Friday, 17 March 2017 20:00:25 UTC+1, Bruce D. wrote:
Hi, 

It is my first time using Emotiv Epoch+ and emokit. When I was running the example code from emokit's github page :

import time
from emokit.emotiv import Emotiv
if __name__ == "__main__":
    with Emotiv(display_output=True, verbose=True) as headset:
        while True:
            packet = headset.dequeue()
            if packet is not None:
                print("Gyro - X:{x_position} Y:{y_position}".format(x_position=packet.sensors['X']['value'],y_position=packet.sensors['Y']['value']))
                pass
            time.sleep(0.001)
 

But I got a key error:


Initializing Reader Thread...
Reader detected serial number: UD201701030023E3
Initializing Writer Thread(s)...
Initializing Crypto Thread...
Initializing Output Thread...
EmotivCrypto: Generating new AES cipher.
EmotivCrypto: Serial Number - UD201701030023E3
EmotivCrypto: Generated Crypto Key from Serial Number...
   Serial Number - UD201701030023E3 | is research - False 
   AES KEY - [u'3', '\x00', u'E', 'T', u'3', '\x10', u'2', 'B', u'3', '\x00', u'E', 'H', u'3', '\x00', u'2', 'P']
Exception in thread Thread-37:
Traceback (most recent call last):
  File "C:\Anaconda3\lib\threading.py", line 801, in __bootstrap_inner
    self.run()
  File "C:\Anaconda3\lib\threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Anaconda3\lib\site-packages\emokit\emotiv.py", line 298, in run
    new_packet = EmotivPacket(decrypted_task.data, timestamp=decrypted_task.timestamp)
  File "C:\Anaconda3\lib\site-packages\emokit\packet.py", line 39, in __init__
    self.battery = battery_values[str(self.counter)]
KeyError: '199'




The code is crashing at the line Emotiv(display_output=True, verbose=True) 

Do you know what I can do to fix it?

Thanks a lot for your help.


Cheers,
Bruce

Reply all
Reply to author
Forward
0 new messages