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

vmc never asks for min max price setup, keeps repeating setup step #28

Open
DragonHunter274 opened this issue May 18, 2024 · 13 comments
Open

Comments

@DragonHunter274
Copy link

The VMC never is stuck in a loop of poll and setup, I've tried a few different settings in setup already, but as the vmc ACKs it I'm not sure whats going on.
Screenshot of logic analyzer attached, I'm unable to get a proper export unfortunately

Screenshot from 2024-05-17 21-29-25
I hope someone can help me with this, I'm stuck

@Tchoum
Copy link

Tchoum commented May 18, 2024

Hello,

The 162 / 62 is the poll for the cashless device 2.
It seems like the VMC doesn't care about your response, or your response is incorrectly configured.

The VMC acknowledges and polls the next device (62 polls cashless device 2).
The VMC acknowledgment means the response is received and the checksum byte is correct; it doesn't indicate whether the configuration is correct or accepted.

The response should be within 5 ms, but I think it works because you received the config command.
Can you confirm if the reset command works fine?

Maybe the response is incorrect. You configured the country code for the euro. I think the scale factor should be something like 0x01 (for 1 cent €).
The MISC options are set to 9 (1001).
Test with the MISC options set to 0x01 or 0b00000001 and another test with the feature level set to 0x02.

@DragonHunter274
Copy link
Author

I tried with the misc options set to 0x01 and scale factor 0x01, haven't tried feature level 0x02 yet,
This is my reset:
Screenshot from 2024-05-18 17-16-35

I can upload the whole capture but it can only be opened by Digilent Waveforms and it is a pretty big file

@DragonHunter274
Copy link
Author

Here is the whole thing including installers for Waveforms for all major platforms and the code I'm currently running: https://hub.dh274.com/s/ToDrppzJjPWWaXL

@Tchoum
Copy link

Tchoum commented May 18, 2024

it appears you aren't reading the checksum byte from the reset. I think you need to read h110 and h010, and only after that, respond with an ACK (h100).
I can't install waveforms for now, but lets try this:

...(Corrected in EDIT)...

EDIT:
ok, I can read your waveforms, i see the same problem with de pool command for "justReset".
in the "void JustReset(void)" function, before the line "MDB_Send(CSH_JUST_RESET);"
add this :
uint16_t readCmd; while (1) if (MDB_DataCount() > 0) break; MDB_Read(&readCmd);

@Tchoum
Copy link

Tchoum commented May 18, 2024

With your WaveForms log, I noticed something:
you have an extra delay when responding to command h111, around 19 ms~, while the manual says the maximum response time is 5 ms.
Move, after all the MDB_send command, the Debug.println("reader config") line 780. is consuming time. At 9600 baud, 14*1.145ms = 16ms~.
increase speed of debug.begin if possible.
or disable debug with #define SOFTWARESERIAL_DEBUG_ENABLED 0

@DragonHunter274
Copy link
Author

DragonHunter274 commented May 20, 2024

adding uint16_t readCmd; while (1) if (MDB_DataCount() > 0) break; MDB_Read(&readCmd);doesnt change anything, it still sends just reset at the same time as before

EDIT: Reset() never calls JustReset(), it just ACKs the Reset message
Adding the above line fixes the reset sequence
It still doesn't work though

@mkrasselt1
Copy link
Collaborator

Could you please provide your complete code somehow?

@DragonHunter274
Copy link
Author

I just uploaded the current code to https://hub.dh274.com/s/ToDrppzJjPWWaXL (same link as above)

@mkrasselt1
Copy link
Collaborator

i noticed in the beginning you send feature level 1 - some machines wont support this, you better bump that to feature level two in setup config data (0x11) and it might help to increase Z7 - maximum response time - to maximum or a suitable middle value for now, to make shure its not the source

@tomeroto
Copy link

hi friend can you share schematic that you use in this work. Thanks before.

@DragonHunter274
Copy link
Author

DragonHunter274 commented May 23, 2024

Screenshot from 2024-05-23 20-30-57
I just noticed it responds to poll with CSH_ACK but I think it should respond with CSH_JUST_RESET
I don't know where the break before that is coming from either

@Tchoum
Copy link

Tchoum commented May 23, 2024

Hi, I see a little conflict in the Reset() function and the JustReset() function in response to a VMC reset command or VMC poll command.

Try this:

  • in JustReset() uncomment line 772 (uint16_t readCmd; while (1) if (MDB_DataCount() > 0) break; MDB_Read(&readCmd);)
  • in Reset() comment/delete line 763 uint16_t readCmd; while (1) if (MDB_DataCount() > 0) break; MDB_Read(&readCmd);.
  • add this line in MDB_ResetHandler(void) befor Reset(); line 538.

try that and update the file log in your nextcloud storage.

and yes, like mkrasselt1say, try featureLevel 2, but i think you schould wirte 0x02.

@DragonHunter274
Copy link
Author

DragonHunter274 commented May 23, 2024

Now it doesn't respond to reset at all

I will upload my code to github I think thats easier
https://github.com/DragonHunter274/mdb-cashless
Feature level is already at 0x02

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

4 participants