Minege / eSSP

Python 3 implementation of the Encrypted Smiley Secure Protocol
Other
26 stars 14 forks source link

get_last_event() don't work? #21

Open Pollermo opened 4 years ago

Pollermo commented 4 years ago

Hi. get_last_event() always return (0, 0, 0) I have a NV11, S.O. armbian and running on python 3.7.3 Thank You.

rms5566 commented 1 year ago

From eSSP.py remove line 313 and 314. Edit the get_last_event to this: def get_last_event(self): """Get the last event and delete it from the event list""" event = [0,0,0] if(len(self.events) >= 1): event = self.events[len(self.events) - 1] self.events.pop(len(self.events) - 1) return event

It couldn't work because the Event list got filled up with garbish and sometimes with a real event.

BrainOnFire commented 1 year ago

I'm having a similar issue with the get_last_event() function and get the following error:

File "/home/waitnrest/Documents/WaitNRest_Projects/Billetero/lib/python3.6/site-packages/eSSP/eSSP.py", line 346, in get_last_event event = self.events[len(self.events) - 1] IndexError: list index out of range

Using the code you provided I get another error: (note, currency, event) = validator.get_last_event() TypeError: 'NoneType' object is not iterable

I'm using the example code with an NV11+. A little bit of help would be much appreciated.

rms5566 commented 1 year ago

Which Version of python you're using? I was using 3.7.x on a raspberry pi and it worked. Make sure that you execute and compile the library with the correct python version!

BrainOnFire commented 1 year ago

I'm currently using python 3.7.5 on a jetson nano in a virtual environment.

I get this new error:

Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "example_billetero.py", line 14, in event_loop (note, currency, event) = validator.get_last_event() TypeError: cannot unpack non-iterable NoneType object

It might be an error with the library because I could not use the command pip install eSSP6 to install it. Only with the pip install git+https://github.com/Minege/eSSP would install. I may need a recent version of Python. Or maybe the library does not work with the NV11+. From the tests I've been doing, it looks like the Threading is not working properly.

rms5566 commented 1 year ago

On raspi pip used python 2.7. I had to use pip3 for python 3.

I changed to the offical ITL C# Library on Windows and implemented the example code from ITL dev pack into ASP.NET Application for a custom API which I'm able to use later. It makes life much easier because most commands are implemented but depending on your situation you might need to implement threading, queuing and proper error handling for commands yourself. Without proper queuing CRC checks might fail and will fail if you're using a NV11+ and SmartHopper SH4 together. You're able to request the dev package via support.

BrainOnFire commented 1 year ago

Thanks for the help. I will certainly look into it.