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

get_last_event() don't work? #21

Open
Pollermo opened this issue May 19, 2020 · 6 comments
Open

get_last_event() don't work? #21

Pollermo opened this issue May 19, 2020 · 6 comments

Comments

@Pollermo
Copy link

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
Copy link

rms5566 commented Apr 3, 2023

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
Copy link

BrainOnFire commented Aug 1, 2023

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
Copy link

rms5566 commented Aug 2, 2023

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
Copy link

BrainOnFire commented Aug 2, 2023

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
Copy link

rms5566 commented Aug 3, 2023

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
Copy link

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

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

3 participants