mathiasfrey / ecrterm

Python ZVT 700 interface (electronic cash registers)
GNU Lesser General Public License v3.0
34 stars 31 forks source link

I just get 0x51 : "initialisation required" #7

Closed ladiko closed 7 years ago

ladiko commented 7 years ago

When i start the test_pt.py I just get 0x51 : "initialisation required", as terminal status:

Then on e.payment(50) it says:

Status code of PT is 81
Unknown Status Code 81
> Autohorization{06 01} **[{'amount': '000000000050'}, {'currency_code': '0978'}]
< 'ACK'
< PacketReceived{80 00} ** []
> 'ACK'
< StatusInformation{04 0F} ** [{'resulkt_code}': [223]}, {'tid': '00000000'}, {tlv': 31, 22, 2, 23, 58, 31, 23, 22, 84, 101, 114, 109,105, 110, 97, 108, 32, 105, 115, 116, 32, 98, 108, 111,  99, 107, 105, 101, 114, 116]}]
> 'ACK'
> PacketReceived{80 00} ** []
< 'ACK'

Any idea what that means?

raphaelm commented 7 years ago

Did you copy that by hand or is that verbatim output? Just asking because the output contains some typos like Autohorization or resulkt_code, but they are probably not the problem.

You might need to supply a PIN to your device during initialization. The device we use in production requires an initialization like the following:

            self.ecr = ecr.ECR(device='/dev/ttyUSB1', password='000000')
            self.ecr.register(config_byte=Registration.generate_config(
                ecr_prints_receipt=False,
                ecr_prints_admin_receipt=False,
                ecr_controls_admin=True,
                ecr_controls_payment=True,
            ))
raphaelm commented 7 years ago

Note that the example from my previous config might only work with my yet unmerged branch of the project: https://github.com/mathiasfrey/ecrterm/compare/master...raphaelm:python3

ladiko commented 7 years ago

Seems like it's my fault. The config_byte helped to get over this error. beside that, i didnt do the initial activation with the remote server of the network carrier. I'm a greenhorn!