Officialy Support :
- NV200
- NV11
- NV10
Maybe that other models works, but we haven't tested them.
Over PIP :
pip install eSSP6
or for the latest version ( maybe unstable )
pip install git+https://github.com/Minege/eSSP
- Multi-currency support
- Poll events interaction
- Response data interaction
- Route to storage
- Route to cashbox
- Payout
- Payout next note (NV11 Only)
- Stack next note (NV11 Only)
- Disable the validator
- Disable the payout device
- Reset the validator
- Empty the storage ( Send all storage's bills in the cashbox quickly )
- Get note amount
importthreadingfromeSSP.constantsimportStatusfromeSSPimporteSSP# Import the libraryfromtimeimportsleep# Create a new object ( Validator Object ) and initialize it ( In debug mode, so it will print debug infos )validator=eSSP(com_port="/dev/ttyUSB0", ssp_address="0", nv11=False, debug=True)
defevent_loop():
whileTrue:
# ---- Example of interaction with events ---- #ifvalidator.nv11: # If the model is an NV11, put every 100 note in the storage, and others in the stack(cashbox), but that's just for this example
(note, currency,event) =validator.get_last_event()
ifnote==0orcurrency==0orevent==0:
pass# Operation that do not send money info, we don't do anything with itelse:
ifnote!=4andevent==Status.SSP_POLL_CREDIT:
validator.print_debug("NOT A 100 NOTE")
validator.nv11_stack_next_note()
validator.enable_validator()
elifnote==4andevent==Status.SSP_POLL_READ:
validator.print_debug("100 NOTE")
validator.set_route_storage(100) # Route to storagevalidator.do_actions()
validator.set_route_cashbox(50) # Everything under or equal to 50 to cashbox ( NV11 )sleep(0.5)
t1=threading.Thread(target=event_loop) # Create a new thread on the Validator System Loop ( needed for the signal )t1.setDaemon(True) # Set the thread as daemon because it don't catch the KeyboardInterrupt, so it will stop when we cut the main threadt1.start() # Start the validator system loop thread ( Needed for starting sending action )try: # Command InterpreterwhileTrue:
choice=input("")
ifchoice=="p": # Payout "choice" value bill ( 10, 20, 50, 100, etc. )choice=input("")
validator.payout(int(choice))
elifchoice=="s": # Route to cashbox ( In NV11, it is any amount <= than "choice" )choice=input("")
validator.set_route_storage(int(choice))
elifchoice=="c": # Route to cashbox ( In NV11, it is any amount <= than "choice" )choice=input("")
validator.set_route_cashbox(int(choice))
elifchoice=="e": # Enable ( Automaticaly disabled after a payout )validator.enable_validator()
elifchoice=="r": # Reset ( It's like a "reboot" of the validator )validator.reset()
elifchoice=="y": # NV11 Payout last entered ( next available )print("Payout next 1")
validator.nv11_payout_next_note()
elifchoice=="d": # Disablevalidator.disable_validator()
elifchoice=="D": # Disable the payout devicevalidator.disable_payout()
elifchoice=="E": # Empty the storage to the cashboxvalidator.empty_storage()
elifchoice=="g": # Get the number of bills denominated with their valueschoice=input("")
validator.get_note_amount(int(choice))
sleep(1)
print("Number of bills of %s : %s"%(choice, validator.response_data['getnoteamount_response']))
exceptKeyboardInterrupt: # If user do CTRL+Cvalidator.close() # Close the connection with the validatorprint("Exiting")
exit(0)Set to storage 10 CHF and 20 CHF, putting 10 CHF and 20 CHF, and payout 10 CHF and 20 CHF.
© Loan V.
