Page 1 of 1
Rfid pn532
Posted: 21 Jan 2021, 18:47
by marktn
Hi,
I have update my node mcu v3 to the latest version.
In my log i do see my rifd tags. Only not under devices? Any solution for that?
It worked with the old version.
Code: Select all
[58283: PN532: New Tag: 2898276914 3
58285: Domoticz: Sensortype: 20 idx: 4746 values: 2898276914
58583: PN532: Old Tag: 2898276914 4
58883: PN532: Old Tag: 2898276914 5
59183: PN532: Old Tag: 2898276914 6
59483: PN532: Old Tag: 2898276914 7
59784: PN532: Old Tag: 2898276914 8
60284: RFID : Removed Tag
60286: Domoticz: Sensortype: 20 idx: 4746 values: 0
62180: WD : Uptime 1 ConnectFailures 0 FreeMem 20448 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
/code]
Re: Rfid pn532
Posted: 21 Jan 2021, 21:59
by TD-er
Does it show if you refresh the devices page?
Re: Rfid pn532
Posted: 21 Jan 2021, 22:10
by marktn
TD-er wrote: ↑21 Jan 2021, 21:59
Does it show if you refresh the devices page?
No, the value stays 0.
Reboot, refresh, and add the pn532 new without result.
And in the log it works, i see the rifd tags.
It also sends 0 to domoticz.
Re: Rfid pn532
Posted: 21 Jan 2021, 22:28
by TD-er
How do you send it to Domoticz? Via a connected controller, or via rules?
Re: Rfid pn532
Posted: 21 Jan 2021, 22:30
by marktn
TD-er wrote: ↑21 Jan 2021, 22:28
How do you send it to Domoticz? Via a connected controller, or via rules?
With the controller, same setting as the old version esp easy. (ESPEasy_v2.0.0-dev12_normal_4096.bin old version number)
I have also a switch, that works fine. Value goes to 1, and communication with domoticz works.
Normaly the value is changing in the number of the rfid. But stays 0
Re: Rfid pn532
Posted: 22 Jan 2021, 08:51
by Ath
It looks like the tag is reset (to 0) after 500 msec, meaning you're not able to refresh the Devices screen fast enough to actually read the tag's value
See the log:
Code: Select all
59784: PN532: Old Tag: 2898276914 8
60284: RFID : Removed Tag
There is a recently merged PR
#3449 for the Wiegand RFID reader that now has extra settings to control the reset tag behavior. These could also be applied to this plugin, if desired.
A possible issue with both of these plugins (and maybe with some other plugins) is that the scanned tag id is split into 2 variables for storage, because of inaccuracy with higher values of the float type that is used there, and only the 1st value (lowest part) is displayed. (Sending to Controllers is handled correctly, AFAICS)
I'm trying to think of ways how to correctly display the combined values there. But then I'd also want to be able to format other types of data correctly, like # seconds of today (%syssec_d% and friends) converted into HH:MM:SS display. Hmm, something is g(r/l)owing here (in my mind)

Re: Rfid pn532
Posted: 22 Jan 2021, 10:39
by TD-er
Ath wrote: ↑22 Jan 2021, 08:51
[...] like # seconds of today (%syssec_d% and friends) converted into HH:MM:SS display.
We already have those.
Re: Rfid pn532
Posted: 22 Jan 2021, 11:43
by Ath
TD-er wrote: ↑22 Jan 2021, 10:39
Ath wrote: ↑22 Jan 2021, 08:51
[...] like # seconds of today (%syssec_d% and friends) converted into HH:MM:SS display.
We already have those.
But not in the Devices page (for Dummy Devices), AFAICS...
Re: Rfid pn532
Posted: 22 Jan 2021, 12:14
by TD-er
System variable should be usable anywhere.
For example in display plugins, controller publish path etc.
Or do you mean a new output type?
If you're thinking about those, please take a quick step back and have a look at the Domoticz controllers to realize what a potential mess it may become when adding new output types.
That's something we should discuss first or else a lot of Domoticz users will be very unhappy.
Re: Rfid pn532
Posted: 22 Jan 2021, 12:24
by marktn
So acutualy it is working, but not the way i want

Good news is there is a good support
What is the best solution for me?
It looks like this?
There is a recently merged PR #3449 for the Wiegand RFID reader that now has extra settings to control the reset tag behavior. These could also be applied to this plugin, if desired.
I need the RIFD number in domoticz for a event.
This is no problem?
62180: WD : Uptime 1 ConnectFailures 0 FreeMem 20448 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
/code]
Re: Rfid pn532
Posted: 22 Jan 2021, 12:26
by TD-er
It will also send an event which you can use in the rules to act on it.
Re: Rfid pn532
Posted: 22 Jan 2021, 12:28
by TD-er
marktn wrote: ↑22 Jan 2021, 12:24
This is no problem?
62180: WD : Uptime 1 ConnectFailures 0 FreeMem 20448 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
[/code]
That's a log entry appearing every minute, and looking good. (unless it was an unintentional reboot, given the uptime of 1 minute)
Re: Rfid pn532
Posted: 22 Jan 2021, 12:52
by marktn
TD-er wrote: ↑22 Jan 2021, 12:26
It will also send an event which you can use in the rules to act on it.
Okay. Should i do anything? Or will there be an udpate of the espeasy?
Re: Rfid pn532
Posted: 22 Jan 2021, 13:28
by Ath
The event should be generated like taskname#valuename, for example if your Task is named 'RFID' and the (single) value 'Tag', the event RFID#Tag is generated, and can be used in the rules like this:
Code: Select all
on RFID#Tag do // the tag will be the first argument provided, %eventvalue1%
// Send to an external system or whatever
SendToHTTP,website.server.com,80,"/lastseen_tag.php?tag=%eventvalue1%"
endon
Re: Rfid pn532
Posted: 22 Jan 2021, 13:31
by Ath
TD-er wrote: ↑22 Jan 2021, 12:14
Or do you mean a new output type?
If you're thinking about those, please take a quick step back and have a look at the Domoticz controllers to realize what a potential mess it may become when adding new output types.
That's something we should discuss first or else a lot of Domoticz users will be very unhappy.
I'll start a new thread, later today

Re: Rfid pn532
Posted: 22 Jan 2021, 14:04
by marktn
Ath wrote: ↑22 Jan 2021, 13:28
The event should be generated like taskname#valuename, for example if your Task is named 'RFID' and the (single) value 'Tag', the event RFID#Tag is generated, and can be used in the rules like this:
Code: Select all
on RFID#Tag do // the tag will be the first argument provided, %eventvalue1%
// Send to an external system or whatever
SendToHTTP,website.server.com,80,"/lastseen_tag.php?tag=%eventvalue1%"
endon
I will do that, and wait for the new thread.
It's new for me, i will use this example.
Re: Rfid pn532
Posted: 22 Jan 2021, 20:32
by Ath
Ath wrote: ↑22 Jan 2021, 13:31
I'll start a new thread, later today
I've opened the discussion
here
Re: Rfid pn532
Posted: 22 Jan 2021, 21:23
by marktn
I have done some testing.
When i read the RFID it sends the tag to domoticz, but it also send immediately a 0. (visible in the log of the text sensor)
I made a blocky, but that isn't fast enough to read the Rifd code.
Under rules i have made this rule, on RFID#Tag do SendToHTTP,192.168.1.5,8080,"/lastseen_tag.php?tag=%eventvalue1%"
endon
Is there a way te prevent 0, or with a delay. Domoticzs needs some time to read.
Maybe i am doing something completely wrong.... rules under esp is new for me.

Re: Rfid pn532
Posted: 22 Jan 2021, 21:32
by Ath
marktn wrote: ↑22 Jan 2021, 21:23
Is there a way te prevent 0, or with a delay. Domoticzs needs some time to read.
I'll try to add the extra settings I did for P008 also to P017, so you'll be able to configure it more flexible.
Re: Rfid pn532
Posted: 22 Jan 2021, 21:51
by marktn
Ath wrote: ↑22 Jan 2021, 21:32
marktn wrote: ↑22 Jan 2021, 21:23
Is there a way te prevent 0, or with a delay. Domoticzs needs some time to read.
I'll try to add the extra settings I did for P008 also to P017, so you'll be able to configure it more flexible.
Thanks! Can you give a notification here when it's done.
Re: Rfid pn532
Posted: 22 Jan 2021, 22:15
by Ath
The PR is
here
A few things to do, most notably documentation, that's currently unavailable, but it'll describe the settings only, I guess.
Looking at my test unit:
Screenshot - 22_01_2021 , 22_13_19.png
If desired I can provide a test build, what build type are you using? (name of the current bin file)?
Re: Rfid pn532
Posted: 22 Jan 2021, 22:45
by marktn
Ath wrote: ↑22 Jan 2021, 22:15
The PR is
here
A few things to do, most notably documentation, that's currently unavailable, but it'll describe the settings only, I guess.
Looking at my test unit:
Screenshot - 22_01_2021 , 22_13_19.png
If desired I can provide a test build, what build type are you using? (name of the current bin file)?
version, ESP_Easy_mega_20210114_normal_ESP8266_4M1M
Re: Rfid pn532
Posted: 23 Jan 2021, 10:42
by Ath
Test build attached, please report your findings here.
Re: Rfid pn532
Posted: 23 Jan 2021, 17:20
by marktn
Ath wrote: ↑23 Jan 2021, 10:42
Test build attached, please report your findings here.
It works!! I have disabled Automatic Tag removal, and it works again.
I will do some testing with tag removal time.
Thanks for support!
Re: Rfid pn532
Posted: 23 Jan 2021, 17:37
by Ath
marktn wrote: ↑23 Jan 2021, 17:20
I will do some testing with tag removal time.
Valid range is 250 to 60000 msec, so from 0.25 to 60 seconds.
marktn wrote: ↑23 Jan 2021, 17:20
Thanks for support!
You're welcome
