ccTalk 硬币接收器插入硬币时没有反应 [英] ccTalk coin acceptor no reaction when coin inserted

查看:60
本文介绍了ccTalk 硬币接收器插入硬币时没有反应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了应该处理硬币插入的 Linux 应用程序(假设现在我需要在应用程序中识别已插入的硬币).我使用 SCA1 硬币接收器 (ICT).我需要使它与波兰硬币(货币 - 波兰兹罗提)一起使用.我能够使 PC 和 Coin Acceptor 之间的通信正常工作,但我遇到了一些问题.

I write Linux application that is supposed to handle coins insertations (let's say that for now I need to recognize in application what coin has been inserted). I use SCA1 Coin Acceptor (ICT). I need to make it work with polish coins (currency - polish zloty). I was able to get the communication between PC and Coin Acceptor to work, but I have some issues.

我的设置的简要说明:

  • PC 通过 RS232(+USB 转换器)通过 ccTalk 协议连接到硬币接收器.
  • 开关块 1:全部关闭,但第 10 个开关设置为开启(根据文档)
  • 开关块 2:全部关闭
  • 我将禁止状态设置为允许所有(来自手动文档)
  • 我设置了主禁止状态以启用设备(来自手册文档)

我可以从 Coin Acceptor 中提取关于序列号、软件版本等的数据.简单的轮询也能正常工作.唯一的问题是有关插入硬币的实际信息.我发送读取缓冲信用或错误代码"(标题 229)命令 - 根据文档 - 每 500 毫秒左右,每次我得到结果 0(字节等于 0x00)时,结果正确返回,看起来就像我没有插入任何硬币一样,当我插入时.我尝试使用波兰硬币和 10 美分硬币.所有硬币都被拒绝",而拒绝我的意思是硬币接受器似乎没有处理这些硬币(只是返回它们),另一方面,当我发送命令以获取被拒绝硬币的数量时,我再次得到 0.

I'm able to pull data from Coin Acceptor regarding serial number, software revision etc. Simple poll works as well. The only issues is with actuall information about inserted coins. I send "Read buffered credit or error codes" (Header 229) command - according to the docs - every 500ms or so, and every time I get result 0 (bytes are equal to 0x00), the result is returned correctly, it just seems like I haven't inserted any coin, when I have. I tried to use polish coins as well as 10 cent coin. All coins are "rejected", and by rejected I mean Coin Acceptor doesn't seem to process those coins (just returns them), on the other hand, when I send command to get the number of rejected coins I get 0, again.

那么现在问你,你知道让它工作所需的任何额外设置吗(最好使用波兰硬币)?此外,默认情况下(假设硬币接收器未连接到 PC,但已通电)硬币接收器应如何对插入的硬币做出反应?只需返回它们(就像我的情况一样)或处理"它们然后返回它们或将它们放入银行"?

So now question for you, are you aware of any additional setup that is required to get it work (preferabley with polish coins) ? Also, by default (let's say the Coin acceptor is not connected to PC, but is powered) how does the Coin Acceptor should react on inserted coins ? Just returns them (like in my case) or "processes" them and then returns them or puts them into the "bank" ?

我想我发布代码没有意义.我创建了两个不同的应用程序,问题是相同的.

I guess there is no point of me posting the code. I've created two different applications, and the issue is the same.

python 中的一个,我利用了 https://github.com/Baldanos/ccTools,第二个应用程序是用 C 编写的,类似于:https://github.com/BitCoding/cctalk.

One in python, I took adventage of https://github.com/Baldanos/ccTools, second application is written in C, something like: https://github.com/BitCoding/cctalk.

怀疑设备坏了,因为我尝试使用其他设备没有任何区别.此外,这些设备是全新的.

It's doubtful that the device is broken, because I tried to use other device with no difference. Also, the devices are brand new.

任何建议都会有所帮助.提前致谢.

Any suggestions will be helpful. Thank you in advance.

推荐答案

我会写这篇评论,但我没有足够的声誉:

I would have written this as a comment but I do not have enough reputation:

我还使用 Baldanos 的库作为让我的硬币接收器工作的起点.我先替换

I have also used Baldanos' library as a starting point to get my coin acceptor to work. I would first replace

ser.read(50) 

time.sleep(0.01)          #give it time for all bytes to be in ser.in_waiting   
ser.read(ser.in_waiting)

因为,正如评论中所说,您不知道消息是否有 50 个字节长.

Since, as said in the comments, you don't know if the message will be 50 bytes long.

也就是说,我设法让它在不改变太多东西的情况下工作.对我来说,硬币接受器已经设置为欧元.当您请求硬币 ID(发送184"和 1,16 的范围)时,您的硬币接受器返回什么?

That said, I managed to get it to work without changing too many things. For me, the coin acceptor was already set to Euros. What does your coin acceptor return when you request the coin id's (sending "184" and the range of 1,16)?

这篇关于ccTalk 硬币接收器插入硬币时没有反应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆