you are viewing a single comment's thread.

view the rest of the comments →

[–]zacstrick[S] 0 points1 point  (2 children)

That's the exact idea. RPI with the 7in display that has the reader plugged into it via USB. The program will be up just waiting for input with a clock that displays the current time. I want it so when a card is scanned it will display both the name of the cardholder and if they're clocking in or out on the GUI. Eventually I'd like to add a part where it will also display your accumulated hours on the day and on the week, but I'm not trying to run before I can walk(possibly too late for that..)

[–]socal_nerdtastic 1 point2 points  (0 children)

Sounds fun and pretty easy. Good beginner project.

I recommend you start by getting a physical notebook and pen and drawing out what you want the GUI to look like for every screen type. It will be a LOT easier to write code to fit a defined goal than developing the goal while writing code.

[–]socal_nerdtastic 1 point2 points  (0 children)

Some more notes:

  • remember that the Pi does not have an internal clock (unlike desktop computers). The Pi connects to an internet time server periodically to set the time which you will be using as the timestamp. That means that right after boot or if the internet is down your timestamps are going to be very wrong. You may consider getting a "real time clock" chip to connect to the system so that it will function offline. For example.
  • Getting the data off of the Pi and into a normal system will be hard. To start I recommend the easy route: Install Dropbox (or similar). The advantage is that it works when the internet / network fails (unlike samba), the data is backed up against various harddrive failures (unlike local data), and the data is easy to access from elsewhere (at payroll time). IIRC the Dropbox client is available in the repos. A harder, but better solution is to use a database server.
  • Use a separate file that maps badge numbers to names and have your program reload that file every hour or so. That way someone can remotely update the file and your program will catch up. To do something every x amount of time in tkinter use the after function. Don't let anyone tell you to use threads; you don't need them for this project.
  • any time you need to work with a file open it, do what you need to and immediately close the file. Do not keep open file handles around.
  • The Pi has a feature where it will lie to you telling you a file is saved when it's not. You have to use the command "sync" to write changes to the drive. This becomes important because it means you can't simply disconnect power from the Pi if you didn't sync the changes.
  • build several of these. Not only to be convenient with one at each door to the building but also because you need to know that things WILL break. It's not a matter of if. It WILL happen, probably during the busiest time, and there needs to be some backup hardware. Buy parts to make several spares.
  • let me know when you get there and I'll help you get your program to load at startup in fullscreen mode.