PN532 with NodeMCU 3 not working
Moderators: grovkillen, Stuntteam, TD-er
Re: PN532 with NodeMCU 3 not working
sounds great.
at the moment, i have no idea about "clock streching". i googled a bit, and looked here:
https://github.com/esp8266/Arduino/blob ... 266_si2c.c
so, i want to replicate you good results, i would have to wait for an update of the core (when the devs put your patch in?),
or i would have to patch my core 2.0 sources myself in my local installation. right? i would give it a try, too.
(but at least, a dont have your equipment to see bus-error. or are they logged?)
at the moment, i have no idea about "clock streching". i googled a bit, and looked here:
https://github.com/esp8266/Arduino/blob ... 266_si2c.c
so, i want to replicate you good results, i would have to wait for an update of the core (when the devs put your patch in?),
or i would have to patch my core 2.0 sources myself in my local installation. right? i would give it a try, too.
(but at least, a dont have your equipment to see bus-error. or are they logged?)
Re: PN532 with NodeMCU 3 not working
it this is true, its maybe worth to put in the wiki for the i2c...
is all about bugs with clock streching on esp with the soft-i2c (with picture from oszi)
length of i2c cable: max usual 1-2m, depends on capacity of the wire and components
http://www.esacademy.com/en/library/tec ... c-faq.html
found here:http://www.digole.com/forum.php?topicID=275If you using strong pullup resistor, please consider the on board MCU is working on 3.3V voltage.
The I2C wires can't longer than 15cm, otherwise, the port will not working properly.
is all about bugs with clock streching on esp with the soft-i2c (with picture from oszi)
length of i2c cable: max usual 1-2m, depends on capacity of the wire and components
http://www.esacademy.com/en/library/tec ... c-faq.html
Re: PN532 with NodeMCU 3 not working
...a great thank to the tag robot for its' unvaluable work....and, yeah, also to Martinus' patience...
Regards
Paolo

Regards
Paolo
Re: PN532 with NodeMCU 3 not working
pppp33 wrote:...a great thank to the tag robot for its' unvaluable work....and, yeah, also to Martinus' patience...![]()
yeahhhhh, me too!!
how does the robot looks like? i am interested in an photo...

Re: PN532 with NodeMCU 3 not working
Yep, the "tag robot" makes testing a less boring job. I won't publish pictures though, because I've used quite some "scotch tape" to hold everything together.
About the clock stretching thing, I wanted to try something more to get rid of the excessive stretching if possible. It may have something to do with wake-up from standby or power down modes. So this morning I started another plugin version with the unpatched ESP core library and may be we can solve (or at least improve) this without hacking the core library.
So the first goal is to keep the reset count as low as possible without patching the library. Have to check when I get home...


About the clock stretching thing, I wanted to try something more to get rid of the excessive stretching if possible. It may have something to do with wake-up from standby or power down modes. So this morning I started another plugin version with the unpatched ESP core library and may be we can solve (or at least improve) this without hacking the core library.
So the first goal is to keep the reset count as low as possible without patching the library. Have to check when I get home...
Re: PN532 with NodeMCU 3 not working
i discovered a new situation in R076 with my esp12.
it lying around at my desk now for longterm testing. i noticed 2 or 3 reboots over the day, but there are a lot wires sticking in the breadboard. maybe i touched one, i thought. but some minutes ago, the ESP disapered from the wifi.
i looked into the serial monitor and captured the following log.
fiddling with off/on of the pn532 did not help, no reset. the esp didn not come to wifi again. i had to do a cold reset...
it lying around at my desk now for longterm testing. i noticed 2 or 3 reboots over the day, but there are a lot wires sticking in the breadboard. maybe i touched one, i thought. but some minutes ago, the ESP disapered from the wifi.
i looked into the serial monitor and captured the following log.
fiddling with off/on of the pn532 did not help, no reset. the esp didn not come to wifi again. i had to do a cold reset...
Code: Select all
Reset Pin high...
PN532: poll count: 0 sda: 0 scl: 1
Reset Pin low...
Reset Pin high...
PN532: Read errors: 202
Reset Pin low...
Reset Pin high...
PN532: poll count: 0 sda: 0 scl: 1
Reset Pin low...
Reset Pin high...
PN532: Read errors: 203
Reset Pin low...
Reset Pin high...
DS : Temperature: 23.50 (28-ff-dd-f0-4c-4-0-3a)
HTTP : connecting to 192.168.14.253
HTTP : connection failed
Delayed Reset 60
Delayed Reset 59
Delayed Reset 58
Delayed Reset 57
Delayed Reset 56
Delayed Reset 55
Delayed Reset 54
Delayed Reset 53
Delayed Reset 52
Delayed Reset 51
Delayed Reset 50
Delayed Reset 49
Delayed Reset 48
Delayed Reset 47
Delayed Reset 46
Delayed Reset 45
Delayed Reset 44
Delayed Reset 43
Delayed Reset 42
Delayed Reset 41
Delayed Reset 40
Delayed Reset 39
Delayed Reset 38
Delayed Reset 37
Delayed Reset 36
Delayed Reset 35
Delayed Reset 34
Delayed Reset 33
Delayed Reset 32
Delayed Reset 31
Delayed Reset 30
Delayed Reset 29
Delayed Reset 28
Delayed Reset 27
Delayed Reset 26
Delayed Reset 25
Delayed Reset 24
Delayed Reset 23
Delayed Reset 22
Delayed Reset 21
Delayed Reset 20
Delayed Reset 19
Delayed Reset 18
Delayed Reset 17
Delayed Reset 16
Delayed Reset 15
Delayed Reset 14
Delayed Reset 13
Delayed Reset 12
Delayed Reset 11
Delayed Reset 10
Delayed Reset 9
Delayed Reset 8
Delayed Reset 7
Delayed Reset 6
Delayed Reset 5
Delayed Reset 4
Delayed Reset 3
Delayed Reset 2
Delayed Reset 1
ets Jan 8 2013,rst cause:4, boot mode:(3,2)
wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld
ªU
INIT : Booting Build nr:76
bcn 0
del if1
mode : sta(18:fe:34:a6:9c:81)
WIFI : Connecting... 1
f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
pm open phy_2,type:2 0 0
cnt
connected with wifi, channel 11
dhcp client start...
state: 5 -> 2 (2c0)
rm 0
pm close 7 0 0/6168860
reconnect
state: 2 -> 0 (0)
f 0, scandone
state: 0 -> 2 (b0)
WIFI : Disconnecting!
state: 2 -> 0 (0)
WIFI : Connecting... 2
f -180, scandone
state: 0 -> 2 (b0)
reconnect
state: 2 -> 0 (0)
f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
pm open phy_2,type:2 0 0
cnt
connected with fo46egre, channel 11
dhcp client start...
WIFI : Disconnecting!
state: 5 -> 0 (0)
rm 0
pm close 7 0 0/3978428
WIFI : Connecting... 3
f -180, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
pm open phy_2,type:2 0 0
cnt
chg_B:-120
state: 5 -> 2 (7a0)
rm 0
pm close 7 0 0/241755
state: 2 -> 2 (2a0)
reconnect
state: 2 -> 0 (0)
f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 2 (4a0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
pm open phy_2,type:2 0 0
cnt
state: 5 -> 2 (7a0)
rm 0
pm close 7 0 0/242829
state: 2 -> 2 (2a0)
reconnect
state: 2 -> 0 (0)
f -180, scandone
state: 0 -> 2 (b0)
state: 2 -> 2 (4a0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
pm open phy_2,type:2 0 0
cnt
chg_B:-120
chg_B:-60
state: 5 -> 2 (2c0)
rm 0
pm close 7 0 0/4012030
WIFI : Disconnecting!
state: 2 -> 0 (0)
INIT : I2C
Reset Pin low...
Reset Pin high...
Reset Pin low...
Reset Pin high...
Reset Pin low...
Reset Pin high...
INIT : Output -1
UDP : Send Sysinfo message
INIT : Boot OK
INIT : Normal boot
NTP : NTP sync requested
NTP : NTP send to 0.0.0.0
NTP : No reply
PN532: poll count: 0 sda: 0 scl: 1
Reset Pin low...
Reset Pin high...
PN532: Read errors: 1
PN532: poll count: 1 sda: 0 scl: 1
Reset Pin low...
Reset Pin high...
PN532: Read errors: 2
PN532: poll count: 1 sda: 0 scl: 1
Re: PN532 with NodeMCU 3 not working
I had problems like that with my esp07. Like when connecting a wire to GND or VCC the esp on the breadboard would reset.tozett wrote:i discovered a new situation in R076 with my esp12.
it lying around at my desk now for longterm testing. i noticed 2 or 3 reboots over the day, but there are a lot wires sticking in the breadboard. maybe i touched one, i thought. but some minutes ago, the ESP disapered from the wifi.
Then I soldered a 4.7 nF ceramic SMD capacitor direct over the reset pin to the metal case and also a 2.2 uF tantalium SMD capacitor between Vcc and the case. After this modification I never experienced spontaneous resets with my esp07 again when I touched the circuit or connected a wire.
picture of the modification:
[img=100,75]http://static.tweakers.net/ext/f/3TE1pp ... /thumb.jpg[/img]
Re: PN532 with NodeMCU 3 not working
After some more evenings of fun with the PN532, it looks like there's no other solution than to patch the ESP core library to avoid the serious bus errors that needs a device reset.
So I went into the process of forking / patching / testing / pull request, and it's now up to the Arduino ESP core developers to approve this patch.
It's a bit of a bummer, because I had hoped to get a new stable ESP Easy out with Core 2.0.0. and that will be impossible.
So I went into the process of forking / patching / testing / pull request, and it's now up to the Arduino ESP core developers to approve this patch.
It's a bit of a bummer, because I had hoped to get a new stable ESP Easy out with Core 2.0.0. and that will be impossible.
Re: PN532 with NodeMCU 3 not working
i am not the experienced in discrete electronics, but i think i can solder two capacitors. Must one be "tantalium", or could i take 4.7nF and 2.2uF in ceramic? than i will search a ceramic-collection of alibaba, two single capacitors could cost in germany more than one ESP ...costo wrote: ...I soldered a 4.7 nF ceramic SMD capacitor direct over the reset pin to the metal case and also a 2.2 uF tantalium SMD capacitor between Vcc and the case. After this modification I never experienced spontaneous resets with my esp07 again when I touched the circuit or connected a wire.

thanks for the hint.
edit: i dont find cheap collections in the uF-dimension for ceramic. so thats why tantalium?
but i dont find cheap tantalium-collection in china, only aluminim-electrolytic. they have +/- sides, dont they? do they do instead of tantalium?
edit2: i found them for 0.04 EUR and 0.07EUR with 5.60 EUR shipping. hurrahhh

http://www.reichelt.de/Bauelemente/X7R- ... 603+4%2C7N
http://www.reichelt.de/Bauelemente/SMD- ... 2%2C2%2F20
Re: PN532 with NodeMCU 3 not working
The SMD capacitor for on the reset can be any ceramic SMD capacitor in the range between 1nF and 10nFtozett wrote: i am not the experienced in discrete electronics, but i think i can solder two capacitors. Must one be "tantalium", or could i take 4.7nF and 2.2uF in ceramic? than i will search a ceramic-collection of alibaba, two single capacitors could cost in germany more than one ESP ...![]()
The capacitor over the Vcc must be soldered with the shortest wires as possible, therefor SMD is recommended as they have zero wirelength.
It does not have to be tantalium, any electrolytic capacitor in the range of 1 to 10 uF will also be good.
For the reset pin this 5n6 seems a good choice http://www.aliexpress.com/item/100pcs-l ... 8aa0f379bd
For the Vcc this 2u2 seems a good choice: http://www.aliexpress.com/item/Free-shi ... 71c14a2195
Re: PN532 with NodeMCU 3 not working
thanks for helping with links to the smd-parts.
i have actually three of them, and i must power them.
i found this, looked like a good solution to the ESP12, but its no longer sold
https://www.tindie.com/products/Ba0sh1/ ... d-adapter/
i have actually three of them, and i must power them.
i found this, looked like a good solution to the ESP12, but its no longer sold

https://www.tindie.com/products/Ba0sh1/ ... d-adapter/
Re: PN532 with NodeMCU 3 not working
from the ws2812 thread "https://github.com/deennoo/ESP8266-ws2812b" i catched, that there is 2.1.rc.. around? maybe a help?Martinus wrote:After some more evenings of fun with the PN532, it looks like there's no other solution than to patch the ESP core library...
So I went into the process of forking / patching / testing / pull request, and it's now up to the Arduino ESP core developers to approve this patch.
It's a bit of a bummer, because I had hoped to get a new stable ESP Easy out with Core 2.0.0. and that will be impossible.
edit: found it here: http://esp8266.github.io/Arduino/versions/2.1.0-rc2/
dont think so, but i am glad you tracked down the problem up to here..

Re: PN532 with NodeMCU 3 not working
Yes there is 2.1.0rc but that's unstable stuff. We should stay far away...tozett wrote:from the ws2812 thread "https://github.com/deennoo/ESP8266-ws2812b" i catched, that there is 2.1.rc.. around? maybe a help?
edit: found it here: http://esp8266.github.io/Arduino/versions/2.1.0-rc2/
As with most of these projects (including our own) there's no separated track for stable and unstable development. So stable 2.0.0. will not be patched for bugfixes. If you need a fix, you have to wait for the next stable and hope that it's actually stable.
Re: PN532 with NodeMCU 3 not working
I test every of your patches,
the last ones all helped a lot!
Thanks here ahain
the last ones all helped a lot!
Thanks here ahain
Re: PN532 with NodeMCU 3 not working
to get the module (more) stable....
helpful for me (and other newbees) maybe some hints for stability in the wiki?
if they use esp12 modules, and not nodemcu or other boards.
i found this now in the core, better to put it also in a prominent place on the wiki?
it took me some time now to find it (by accident..)
https://github.com/esp8266/Arduino/blob ... bility.png
http://www.esp8266.nu/forum/viewtopic.p ... t=50#p3749costo wrote: I had problems like that with my esp07. Like when connecting a wire to GND or VCC the esp on the breadboard would reset.
Then I soldered a 4.7 nF ceramic SMD capacitor direct over the reset pin to the metal case and also a 2.2 uF tantalium SMD capacitor between Vcc and the case. ...
helpful for me (and other newbees) maybe some hints for stability in the wiki?
if they use esp12 modules, and not nodemcu or other boards.
i found this now in the core, better to put it also in a prominent place on the wiki?
it took me some time now to find it (by accident..)
https://github.com/esp8266/Arduino/blob ... bility.png
Re: PN532 with NodeMCU 3 not working
Martinus wrote: And it seems that there's I2C clock stretching going on with more than the usual delay, approx. 250 uSecs
And I also found out that the Arduino ESP core does not seem to support clock stretching for more than 100 uSec. (mentioned as a comment inside the library). So we seem to have found the root cause for these bus resets...
...
just to prove this theory, I decided to patch the ESP core I2C library to allow for up to 1 mSec clock stretching,...This morning results after approx. 14 hours run: 817 tag movements ...0 bus errors (!)
i am now on r101, platform 2.1, changed for stability to the wemos boards (more easy!), and found in the advanced/experimental a clock strech-setting. i still need the reset-wire to the pn532 board to work properly over i2c.
does r101 and the clock-strech-setting now needs to be somehow configured to get rid of the reset-wire?
Re: PN532 with NodeMCU 3 not working
as plattfrom version went up from 2.0 to 2.3 now and espeasy improved up to v109,
and there is a i2c streching option (how to use?), i dont know if the reset-function is still needed to have nfc proper working.

meanwhile i also ordered a new version of nfc-boards from aliexpress and got the elechouse v3 boards (by incident). i will try these now, but do i still need the reset? was there any changing in the code that made the reset overcome?

and there is a i2c streching option (how to use?), i dont know if the reset-function is still needed to have nfc proper working.



meanwhile i also ordered a new version of nfc-boards from aliexpress and got the elechouse v3 boards (by incident). i will try these now, but do i still need the reset? was there any changing in the code that made the reset overcome?

- Attachments
-
- PN532-7.jpg (43.05 KiB) Viewed 18130 times
Re: PN532 with NodeMCU 3 not working
i build a new nfc-reader with espeasy on a gizwit module.
it lacks 3.3V, but i found it on a pin of the LDR.
it seems that both pcb's run alone from usb-power.
did not test if i still need the reset-line, so left it in at first.
it lacks 3.3V, but i found it on a pin of the LDR.
it seems that both pcb's run alone from usb-power.
did not test if i still need the reset-line, so left it in at first.
- Attachments
-
- pn532.png (147.43 KiB) Viewed 18090 times
Re: PN532 with NodeMCU 3 not working
Hey tozett,
I know it's an old post, but did you ever try to use PN532 module over SPI ?
Kind regards,
Viktor
Who is online
Users browsing this forum: Ahrefs [Bot] and 14 guests