简体   繁体   English

ccTalk 硬币接收器插入硬币时没有反应

[英]ccTalk coin acceptor no reaction when coin inserted

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).我编写了应该处理硬币插入的 Linux 应用程序(假设现在我需要在应用程序中识别已插入的硬币)。 I use SCA1 Coin Acceptor (ICT).我使用 SCA1 硬币接收器 (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 和 Coin Acceptor 之间的通信正常工作,但我遇到了一些问题。

Quick description of my setup:我的设置的快速描述:

  • PC connected to Coin Acceptor via RS232 (+USB converter) over the ccTalk protocol. PC 通过 ccTalk 协议通过 RS232(+USB 转换器)连接到硬币接收器。
  • Switch Block 1: All OFF, but for the 10th switch, which is set to ON (according to documentation)开关块 1:全部关闭,但第 10 个开关设置为 ON(根据文档)
  • Switch Block 2: All OFF开关组 2:全部关闭
  • I set inhibit status to allow all (from manual docs)我将禁止状态设置为允许所有(来自手动文档)
  • I set master inhibit status to enable device (from manual docs)我设置主禁止状态以启用设备(来自手动文档)

I'm able to pull data from Coin Acceptor regarding serial number, software revision etc. Simple poll works as well.我可以从 Coin Acceptor 中提取关于序列号、软件版本等的数据。简单的轮询也能工作。 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.我发送“读取缓冲信用或错误代码”(标题 229)命令 - 根据文档 - 每 500 毫秒左右,每次我得到结果 0(字节等于 0x00)时,结果正确返回,看起来就像我没有插入任何硬币一样,当我插入时。 I tried to use polish coins as well as 10 cent coin.我尝试使用波兰硬币和 10 美分硬币。 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.所有硬币都被“拒绝”,而拒绝我的意思是硬币接受器似乎没有处理这些硬币(只是返回它们),另一方面,当我发送命令以获取被拒绝硬币的数量时,我再次得到 0。

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 ?此外,默认情况下(假设硬币接收器未连接到 PC,但已通电)硬币接收器应如何对插入的硬币做出反应? 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.我创建了两个不同的应用程序,问题是相同的。

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 .一个在 python 中,我利用了https://github.com/Baldanos/ccTools ,第二个应用程序是用 C 编写的,类似于: 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:我会写这个作为评论,但我没有足够的声誉:

I have also used Baldanos' library as a starting point to get my coin acceptor to work.我还使用 Baldanos 的库作为让我的硬币接收器工作的起点。 I would first replace我会先更换

ser.read(50) 

with

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

Since, as said in the comments, you don't know if the message will be 50 bytes long.因为,正如评论中所说,您不知道该消息是否有 50 个字节长。

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)?当您请求硬币 ID(发送“184”和 1,16 的范围)时,您的硬币接受器返回什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM