Shop OBEX P1 Docs P2 Docs Learn Events
Time clock for RFID entry system. — Parallax Forums

Time clock for RFID entry system.

BurnsBurns Posts: 2
edited 2008-12-05 03:25 in BASIC Stamp
The project is an entry and exit Log for a shop in a college. We are using the Parallax serial RFID reader, along with a parallax LCD display, and a parallax internet burner kit, (PINK). the student use there RFID cards to enter the classroom and the netburner logs there time of entry on the network for the teachers to monitor.· Is it possible to use the networks clock to send the time·from the computer through the netburner to·the serial display? If so what would be the best way to go about doing this?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-12-01 20:15
    The PINK has no built-in provisions for using the network's clock. What are you doing now to notify the networked PC that an RFID card has been used? If the PC periodically reads PINK variables to get the RFID code, it could just as easily set another variable to the correct time and do this at least once a minute. The Stamp program could similarly copy the time received from the PC to the serial display each time through its action loop.

    Alternatively, you could add a real time clock to the Stamp setup. SparkFun has a nice DS1307 "breakout board" complete with a backup battery and there are examples on the Parallax website of the use of a DS1307.
  • BurnsBurns Posts: 2
    edited 2008-12-03 14:54
    Thank you for the insight into the RTC Mike.· Much appreciated.· This issue I have with the PINK vars is that, is there a syntax or command that I can use to·set one of the flash mem vars, of the PINK,·so that it·will be the correct, the computers, time always and then we just have to use a serout/in command to read the PINK var, setting an EEPROM var to the value once a minute.· That would mean that, although we would only have time current to the minute, that would me fine.

    Secondly, I understand that the DS1307 uses the SCL and SDA pins to interface with the BS2, what I am confused about is how, or more directly, what the syntax is used by the BS2, with PBASIC 2.5, to read and/or set the time.· We have this IC, using it is another story.


    Thanks in advance
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-12-03 16:08
    Burns,

    A couple of suggestions…regarding the current time and getting it from the network to the LCD…if you really want to send the server time to the PINK module it must be sent as a UDP message to the PINK Module’s IP address at the correct port. The BASIC Stamp can detect the flag indicating a UDP message has been received and update the display accordingly.

    My own personal preference is the DS1302, which has a simple SPI interface to the BASIC Stamp module. It also has a battery backup for both the RTC and the 30+ bytes of RAM on board in case of power failure. Unfortunately there is no way to serially update the flash memory on the PINK. That can only be done through the modify variables page. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • awesomeduckawesomeduck Posts: 87
    edited 2008-12-03 23:12
    I think its been pointed out that PINK will not allow you to send arbitrary packets on the net. While the PINK could be setup to receive the time in a variable via a UDP packet, there is absolutely no security to this design. Since you are building an access control system, you might want to not have a system that is so easily hackable.
    Google for Network Time Protocol, this is a method of obtaining the time from a time server over the internet. However, you can use PINK, you have to use something like the X-port which is much more complicated.

    Another angle is to use the WWVB radio signal. I just ordered the parts for this yesterday and will be writing code to support this on BS2.
    http://www.c-max-time.com/products/showProduct.php?id=31

    This chip and antenna receive a time signal for the US atomic clock (similar versions available for other countries) and you could use that to set the DS1302 or DS1307 RTC in a reliable fashion that would be really hard to hack.

    If this is just a learning project, and not being used to really secure assets, then use the PINK. Its a great way to learn how http, html and basic internet packet processing works without getting bogged down into the details of IP and Ethernet networks.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-12-03 23:43
    I’m not sure how sending the time over UDP is any sort of security risk…I guess if you’re sending tag data maybe, but I got the impression this was being done on an internal network. I would have absolutely no problem telling my PC to periodically send the time over UDP to the PINK Module.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • awesomeduckawesomeduck Posts: 87
    edited 2008-12-04 11:44
    My point about the security only applies if you are making a real product to sell. For a learning project there is no problem with using unauthenticated UDP packets to get the time. If however, you are making an entry/exit system, and access is granted based on the time of day, then you need to consider that an intruder could spoof the time data on the network and make the access system think it was a time of day that the door should be open.

    Also, I just re-read my original comment and I mistakenly put a "not" in my first sentence...in fact it should say that the PINK *will allow* you to send arbitrary packets....at least UDP packets.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-12-04 16:03
    Perhaps Burns could clarify…I got the impression he just wanted to display/store the current time. The access would normally be strictly based on the RFID Access number. In any event, any hacker who could spoof the time on your internal network is already in the door. =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • edited 2008-12-04 20:13
    Yeah, Chris is right. We are using this as a "punch clock" for students in another class. This means that it is on our school network and not accessible by anyone other than us and the instructors for that room. This means that security is not a large issue, or even one at all. Also we have discovered our solution in the form or the DS1307 and a 32kHz (approx) crystal osillo. Using PBASIC variables and active low pbs we are able to set the clock and send that time to the PINK ram variables. The time is sent to the variable corresponding "the number", not the actual HEX id of the card but a relationship to a basic DEC number of our choice, to be accessed by the instructor for an industry like situation. The only thing that Burns and I, Spicer, are left with is to configure the email aspect of the PINK to send the punch data to the instructor. If this requires us addressing the email content variable each time and sending multiple emails so be it, but a list of morning punches would be best. However it works is already better than expected.


    I sincerely appreciate the help thus far!

    Thanks all,
    Spicer
  • awesomeduckawesomeduck Posts: 87
    edited 2008-12-04 22:12
    Spicer, this seems like a really cool project. You are integrating a number of cool peripherals. Maybe you could post some pictures when done.

    I am sure what I am about to say will be controversial, but having been in the internet security business for many years, I have to point out that any assumption that a network is not accessible is very hard to substantiate.

    There is no network that is not accessible. Take for example the Pentagon...
    http://www.govexec.com/story_page.cfm?articleid=39456
    or TJMaxx, which was hacked from the comfort of a car in the parking lot...
    http://www.eetimes.com/news/latest/showArticle.jhtml?articleID=199500574
    "It's likely that the cyber attacker or attackers who stole millions of customer records from TJX stumbled across a vulnerable store location while staking out a strip mall or shopping center from their car using a laptop, a telescope antenna, and an 802.11 wireless LAN adapter."

    Granted, your school may not be tops on the list of places to hack...but other people reading this forum may be in situations where they should be considering the security implications. The Internet is a dangerous place.
  • edited 2008-12-05 03:25
    Very true awesome, because I know how fun wardriving can be, lol. But for our project there will be no sensitive information at all. No one is getting paid based on these times, nor punished for being late, etc. so while I know that the security of our project is full of holes we're not operating the Large Hadron Collider, or I suppose it wouldn't matter lol2.
Sign In or Register to comment.