-
Notifications
You must be signed in to change notification settings - Fork 392
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
ISO15693 Sniffing #312
Comments
Hi @cacke-r, Does the red LED light up when the device seems dead? If so, then there is a problem with the ISR and the Chameleon does not recognize your ISR as the TCD0 OVF ISR and triggers BADISR_vect. If you can share the code I could take a look. |
Hi @fptrs , Then I'll go ahead and get the sniffing for card working (reader sniffing already works) - afterwards we may discuss how to get the whole package upstream ? Shall I start with raising PRs against @ceres-c repo first ? Or rather directly here ? Regards |
Hi, (From now on I'm taking for granted that you have knowledge about iso15 air interface, which is defined in ISO15693-2.) Our plan was to implement both high and low data rate with single and double subcarrier, thus we are looking for a generic solution. We don't know yet if this is feasible and we're assuming to reliably sample the pulses in VICC->VCD communication (strong assumption, one problem at a time, though).
Edit: No, the above wouldn't work. Did I tell you we are out of the loop? I can confirm. It took us way too much to spot the issue here: f_c/4 is a too fine measurement and it would be impossible to differentiate the two frequencies; there would be only one falling edge per f_c/4 period with both f_c/28 and f_c/32. We also recalled Xmega offers a frequency measurement feature via its event system, 8045A-AVR-02/08 § 6.3 suggests an algorithm to do so. We could then set up a:
Have you already laid out a plan to implement VICC-VCD sniffing? Would you like to expose it here so we can exchange ideas? We'd love some criticism on our idea, so we can figure out any pitfall before we start to write code. Given that we currently have some spare time, once we figure out a solid plan, we could start working together on this project. Would you mind firing me or @MrMoDDoM an email so we can maybe use a faster mean of communication? PS My |
great to hear that you are also still willing to continue the paused activity. For further discussions I'd raise an e-mail to both of you. One big question I still have, which I was not able to figure out now: |
You just reminded me that (luckily) we laid out our ideas from back then as comments in the sniff codec. Honestly, I did not remember this fact at all: turns out we almost reinvented the wheel today, since the ideas we tried to come up with were almost the same we had 2 years ago, and probably we fell into the same pitfall :) I'm not sure @MrMoDDoM has a public email somewhere so, once you write me I'll add him to the conversation. @fptrs I guess you're busy, so we could either keep you posted writing relevant updates here, or add you to the conversation as well. Yes, the MCU already sees demodulated output, but I'm pretty ignorant on the hardware details. I'll hook up my scope to the port one of these days (Unrelated: I still have to buy a tonie and fix my branch for that) --edit-- Just impulse bought a tonie. I guess that will be a good addition to the "stuff I hacked" box |
Hi all, I tried to create a PR on @ceres-c but failed tonight :-) will try again in the next days. Regards |
Hi guys, |
Yup, I've taken a lot of measurements in the last three weeks, and now have a fully working sniffer in my repo :) I have tested my code with both my demo board (ST m24lr-discovery) and different phones with success. Moving the reader or the tag in the field did not yield any issue, as long as the chameleon was between the two. I had to abandon dual subcarrier due to issues with SOF identification: I could not identify a threshold to reliably count pulses, so it was impossible to know when the first 27 pulses ended and the 24 pulses started. Pulses counting proved to be unreliable when different tags were used: the slight differences in the shape of subcarrier pulses generated by different products would result in erroneous counts. @cacke-r was having some issues with my code on a toniebox, so we're trying to debug it at this point. BTW one Chameleon died in the process, I hope Peta won't come for me. |
@ceres-c Looks really good. I just tested it with my phone. If I understand correctly you use the ADC to determine a suitable threshold. It might be also a good idea to take a look at the difference between DEMOD-READER and DEMOD during transmission. I suggest taking scope pictures including both signals as well as their difference, for the dual subcarrier case and also for a response from a tonie. If you can share the scope pics I am happy to take a look. |
Yes, I am using the ADC to both find a first suitable threshold and then increase the threshold once the chameleon starts to see pulses. I've seen the two signals on a scope and I am indeed using both of them on purpose: first threshold is calculated from DEMOD, further on DEMOD-READER is used because, albeit different, it's easier to sample since it's not returning to zero and will then more likely yield useful data. I don't have a toniebox to test, so I'm probably calling it a day right now. I'm going to play the "works on my machine" card and leave the fine tuning of the threshold to someone else. Getting to this point took already too many hours. |
My idea was to use the DEMOD-READER and DEMOD signal both as input to the AC, most of the time the signals are quite equal but since the DEMOD-READER signal passes an additional low pass filter it is slower and we might not need the DAC for a threshold. Anyway nice work @ceres-c and hopefully we get the tonies to work again. |
I'll be damned, this is smart: I'm going to try it right now. Wait to merge the PR |
Ok, it is indeed much more reliable when the signal is in a sensible range, but I'm not sure it'd help with smaller signals since it's still going to miss the first few pulses. Also, with a specific card (EM4233), the count is completely out of place: with high antenna coupling, the reading could vary from 21 to 40 pulses on first pause. With these results, it would be impossible to implement dual subcarrier anyway I could indeed do without the DAC threshold, though, and retain current "heuristic" to decode single subcarrier, albeit simply changing the ADC source results in wrong decoding, so I might have to fix something else as well --edit-- |
@cacke-r do you mind testing this branch with the toniebox? If it fixes your issues, we can work with @fptrs idea |
@ceres-c , @fptrs
This is not working for. In non of the cases, even the first IRQ isr_SNIFF_ISO15693_CODEC_TIMER_TIMESTAMPS_CCA_VECT doesn't be called. For me - the approach using the DACB is somehow better - because I can fix it by setting a constant value. So, I'd vote to go ahead merging the DACB based solution. And if we dont find another smart way for the Tonie box - i would still see the following as good path to go.
.. this would help for the TonieBox ... and for any other corner cases we are not aware of now. What do you think about this ? If you like it - I could go ahead implementing that approach. |
This sounds good to me. I'll follow this approach with an additional configurable fixed threshold. Maybe we can make the codec default to automatic threshold detection and add a forced threshold if configured in application |
Okay, that's sounds good - then I'll take this approach forward once your PR is merged. |
@cacke-r can you share a picture of your setup with the tonie box and scope pics as well. I was not able to get a good scope pic for a tonie, only thing I catch with the scope is the box itself, the figurines response however does not show up, for me there's only noise on DEMOD and DEMOD-READER pin @ceres-c after the final changes and resolving the conflicts with the master branch I'm going to merge your PR. I think we can keep this issue open for the improvements of the threshold detection |
@fptrs please find here a photo of my Setup. But it is quite unspectacular 😀 it is all boxed. Getting scope pics is rather complicated- I already told @ceres-c . I need to borrow one from work, and see how I can fix it to measure. It is still on my todo list - but I need some bigger calm timeslot- which is quite rare currently 🥲 But according to the adc values I recorded - I can imagine well that the signal is very noisy. I'll now go ahead with the Autocalibration, for my use case. |
I'm now done with the autocalibration command. Since it is my first contribution here, What is still on my todo before finally raising a PR is:
@ceres-c It would be great, if you could test with your cards, whether the auto-calibration works for you as well ah, and here is my branch Thanks for your feedback. |
Will check the code and test tomorrow :) |
Cool, thanks.
|
@ceres-c |
I have been testing it tonight and the threshold calculation seems to be working. I have not taken scope pictures to compare performance of the two systems with a given signal amplitude and I'll do it tomorrow in the morning, but this looks good to me. I have a couple of remarks, code wise. https://github.com/cacke-r/ChameleonMini/blob/4bb66408009f11bc83c3289a53fad5c717da1f96/Firmware/Chameleon-Mini/Application/Sniff15693.c#L136 https://github.com/cacke-r/ChameleonMini/blob/4bb66408009f11bc83c3289a53fad5c717da1f96/Firmware/Chameleon-Mini/Application/Sniff15693.c#L179 Also, I see you still have the See you tomorrow with some more empirical evidence :) |
Great, thanks for the feedback. I'll work on that. |
@ceres-c thanks a lot for these intensive tests. So, I'd conclude out of the results, that using a static calibration is (at least) not worse. (looks sligthly better - but still in the range of stochastical noise). |
BTW - the test procedure looks good to me. The only point, that I needed to check after a power cycle of the device is - if the new threshold was really stored. I had some tries where this was not the case - |
@ceres-c
No, thats not annoying - i like this command implementation :-) But as a first step - to keep the PR
Agree - will fix this.
Actually it is not reset in AppReset - but anyhow AppReset is called in the Command function for the Autocalib command
|
@ceres-c @fptrs Will do the testing tomorrow and then raise the PR. Is there any best-practice here on "Whom shall I add as reviewer ?" |
You can add me and @ceres-c. I'm going to test and merge it once you've raised the PR. Nice work so far 👍 |
Hello all,
I'm wondering if there is any update on the ISO15693 sniffing.
I'm currently working based on the iso15_sniff branch from the @ceres-c fork.
But it doesn't support card->reader sniff yet. I'm willing to add it - and currently digging
into the chameleon and Atmel details I'm not yet familiar with.
I'm wondering if there is already some further progress - that I've not yet found ?
Is there any reason, why the actual status is not yet merged to this repo here ?
Currently I'm fighting with activating the overflow-IRQ on the TCD0 channel.
Whenever I do so - it the device seems to be dead (no further log output - no reaction on the command interface) - is there any trick with the OVF-IRQ which needs to be considered ?
Thanks in advance for any support, cacke-r
The text was updated successfully, but these errors were encountered: