body, html {font-family: 'Open Sans', sans-serif;} #nav a, #nav span.in{font-family: 'Open Sans', sans-serif;} #title #tagline {font-family: 'Open Sans', sans-serif;} #main .gridItem h3 {font-family: 'Open Sans', sans-serif;}

Raspberry Pi

1/25/2017

Today isn’t the 34th birthday of my son only but additional the day I’m entering a complete new world: Raspberry Pi...

While working on the „Nursery Project“ based on an Arduino Mega, it became obvious that my colleagues might are right saying:

  • This isn’t a project to be done with a mirco contoller but with a „real“ PC.
  • The target to upload a file from the SD card of the Arduino to my DropBox directly to the internet (not via a PC) won’t be feasible (only with a Arduino Yun, which lacks of memory and is very expensive).
  • There’s a time keeping project for Raspberry Pi already existing and I only need to do some modifications (Hahaha!!! Today I’m knowing, that I totally had to do it by myself… Yes, ok, some parts as reading or writing RFIDs or sending a file to DropBox are „adoptions“ from things I found in the internet…)

So I ordered today a starter kit

Schnappschuss (2017-01-25 19.27.24)


and a 5“ touch TFT

Schnappschuss (2017-01-25 19.27.53)



and some other stuff. More is on my wish list, because my birthday isn’t so far away. Last not least I downloaded some eBooks, so I’ll step into this new world quite soon.


Update 1/28/2017 Frustration & a very small step ahead

The stuff arrived on Wednesday. A first check brought up a grey screen with moving lines. Not more.. On Thursday I have been quite busy, so I wasn’t able to work on it neither on Thursday nor on Friday. Today I started with the Raspberry and the small monitor. I didn’t brought it up to life. In addition I wasn’t happy with the starter kit, because it’s not containing any documentation.

Meanwhile I’ve ordered some other stuff and connected the R-Pi (from now on my short cut) via a HDMI-DVI adapter to the monitor, which is usually connected to my MacMiniServer. It worked. I downloaded the operating system, Libre Office and did my first entries on comand line level (sudo raspi-config) and made a lot of changes to the configuration. 

Because working with the monitor of my server isn’t so handy (it’s placed on a cupboard 6 feet high) I just ordered this one (click on the picture to go to Amazon): I’ve just retuned it, because the quality was as the price and much worse, the RPi didn’t realized it when starting. I just connected another old but high quality 1600 x 1200 monitor to the RPi.


A quite small keyboard was a must-have also:


Schnappschuss (2017-01-28 18.52.36)

I hope, I’ll find a place on my desk, which is already quite overloaded. It will all arrive on Tuesday. Let’s see, what my colleagues will teach me on Monday…


Update 1/30/2017

My colleague made the 5“ display working. Here’s a picture of some stuff. Tomorrow more will arrive.

IMG 4864


Bottom left the future „development“ R-Pi, right the „production“ R-Pi and above the running 5“ color touch TFT, which might be build into the „Nursery project“.


Update 2/3/2017

Some days passed bye, most offering a lot of frustration: 

  • My colleague discovered that my RPis didn’t worked correctly. Bluetooth and WLAN (WiFi) not running and clock speed of the processor not changeable. Also he discovered that my RPIs were branded „Made in the PRC“ which means China. They have been manufactured by elements14 in China. This is quite surprising, because first element14 is stated as an official distributor not a manufacturer. And usually RPis sold in Europe are „Made in the UK“, not in China. I’m not sure whether mine are clones or not. But I’m sure, both are faulty. The first one I returned to Amazon yesterday, the other one I’ll return on Saturday. I’ve ordered new ones from a different shop, which delivered UK ones in the past (and is quite cheaper than Amazon).
Pi 1
Schnappschuss (2017-02-03 10.18.20)


  • The next problem was with my 10“ monitor. I didn’t got it working with my RPi. I tried it with an old (but high quality) 4:3 screen using a HDMI-DVI converter. It worked perfectly, so I rearranged my desk and also returned the 10“ monitor to Amazon.
  • I’m totally confused about all the new things I need to put into my brain:
    • LINUX (an UNIX derivate) as operating system
    • Rasberian as the main platform with it’s scripting language
    • Python as programming language
    • and a lot of other topics as e.g. hardware

Yesterday was the first day I did some very small steps ahead:

  • I got WiFi working on the RPi, I’ve got from my colleague
  • I installed a skript allowing to move files to and from DropBox. Unfortunately not as I would like to have it. So I need to look for an alternative solution.
  • I’ve wrote roughly 10 lines of a Python sketch, wich
    • included a library
    • changed the numeric values of date and time to strings and
    • wrote this into a file

It seems, the start is done. But my feeling is, I did the first few inches of a trip around the world.


Update 2/10/2017

A quite big step ahead done meanwhile: I’ve sent back my 2 China RPis and bought UK ones from another shop. No problem anymore. 

  • I’ve tried a lot to get an RFID sketch running, but failed. A colleague of mine made a kernel update (basic operating system) by moving BACK to a March 2016 version. Now the RPi isn’t running in 64bit mode but 32bit. Nobody will care about, when the system will run.
  • I also solved the DropBox issue. I’m able to send a file from the RPi to any folder of my DropBox, I want. (I made a silly mistake, when creating the API in DropBox.)
  • Python and its GUI Tkinter aren’t any longer black holes to me. Dark grey, I would say today. More and more I’m able to program.
  • Today from the former k.o.-topics, which would cause to stop this project, noone is still existing. Now it’s only up to me to go ahead…


Update 2/12/2017

And this weekend I did another one… But I don’t want to hide that there have been hours of frustration again. But when it came already close to evening, I did it. A working prototype is running. Only the part which will upload the file into DropBox I didn’t tested already. Hope, I’ll take a video clip quite soon… 


Update 2/13/2017

Does this mean, this project will be finished soon? For sure not. There’re a lot of things to add. Here’re only some few examples just coming to my mind:

  • If an RFID was read, the sketch is waiting for a selection between the 3 different time stamping options (2 different times coming or just leaving). If nothing would be chosen, the sketch will wait up to infinity. This must work differently. If, e.g. after 3 seconds nothing was chosen, the sketch must turn back to wait for an RFID.
  • There must be an „administrator option“ to read several RFIDs into a file for later usage.
  • Today any RFID being read will force a time stamping into the file. I need to limit that to approved ones only
  • There must be a message on the screen when a data record was added to the file.
    • Great would be, if the name, not the RFID code would be shown. (This idea I’ve skipped already because of the very tough German data privacy laws)
  • and much, much more just not coming uo to my mid...


Update 2/14/2017

Just making progress. A lot learnd… The basic functionality is working. I’m now working on all the „cosmetics“ and additional functionality. In other words: It’s like the progress bar in Windows: 95% done already, but the remaining 5% will take 10 times the time...


Update 2/19/2017

A lot progress again. 

What is running already?

  1. running on the development system and on the production system with the later 7“ touch tft monitor
  2. time keeping
  3. ignoring RFID cards, not being authorized
  4. writing in file
  5. uploading the file to DropBox at 11:00 pm every night, but only when needed
  6. automatically deleting the file of the month before when a new month is starting (done at 01:00 am at night)
  7. switching on and off the mouse (touch functionality)
  8. converting Stings to Hex and numbers to ASCII
  9. some administrator functions included:
    1. reading multiple RFID tags and writing them into a file
    2. forcing an upload to DropBox just now
    3. write something into sector 8 of the RFID to declare it as valid
    4. as above, but to declare it as invalid

Want to see some Python and Tkinter lines? Here the are:

Schnappschuss (2017-02-19 18.13.28)



Update 3/3/2017

Roughly 2 weeks passed bye. They’ve offered only some few hours to work on my project, but when I found some time, it has been ups and downs. I don’t want to report on all. 

  • I had trouble to show a message on the same window. So I tried to work with two windows, putting all the time the actual one on top. After hours of trying and googling I gave up and found a solution to to integrate the message to the same window as I initially wanted..
  • Very well went my approach to discover whether an RFID chip is authorized for time keeping or not. First idea was, to create a file, where all the authorized ones are listed. But when I discovered, that it's possible to write data to the chip (this is why chips with different memory size are existing!), I realized a much smarter approach. Each chip can be authorized by this device by writing an encrypted key to it. So the device is offering the possibility to authorize or to deauthorize a chip.
  • All that in „administrator“ mode. A special chip is declared as administrator. Showing that chip to the system, it’s moving into „administrator mode“.
  • Also I discovered a way to make the display of the buttons much more stable and to define a quite good „time over“ mode.
  • The file being uploaded will change its name every month. The one shown in the video is for February 2017. Every day at 1:00 am the system is checking, if the month has changed. If so, the old file will be deleted and a new one crated.
531188 AB 00 FB.EPS


Update 3/4/2017 - DONE!!! Version 1 finished

Today I’ve finished the first version. Everything is running stable. Now I have to ask my colleague to update the existing Excel time sheet, what I’ve modified for this, to import the data from the file, the system will upload to DropBox every night. When this is done, I’ll buy the housing (see above) and some more RFID chips. 

Some questions are still open:

  • Will the housing have a network plug or will the network cable directly plug into the Raspberry? (Second will be much easier, but ugly)
  • Will I have a power supply inside the housing or is it better to power it with 5V? (I think the second would be better, especially when the power supply will break some day.)
  • Do I need to cut out the all in front of the RFID sensor and put it behind plexiglass to have a better read-write? (I fear, the answer is „yes“)

I’ve planned to introduce the system on 1.1.2018, but maybe, I’ll do earlier… But in that case I have to modify the current Excel sheets of roughly 40 people. (I think, I won’t do but already use the system for controlling them.)


Update 3/9/2017 - 2nd video

After I solved some problems on stability cause by the screensaver (Thanks to Günter, who discovered the root cause) I took a second video (and skipped the first one) today:

As ever: By clicking onto the YouTube icon, you can watch in 1080p


Now I’ll keep the system running from today (Thursday) up to Tuesday evening next week, when coming back from a trip with a quite sad background. Nosy, if the system will still be running…


Update 3/18/2017 - GREAT SUCCESS!!!

Forget it! Just after some hours the sketch stopped again on 3/9/2017. But with the help of my colleagues Günter and Frank it’s running now since more than 24 hours. I think, it’s done! The main difference is that the sketch isn’t running any longer inside the development environment. Günter managed a kind of „autostart“. After booting the Raspberry will start the graphic environment (startx) immedeately. When startx is performed, the sketch is automatically executed.

I’ll keep the device running for all of the next week. When no problem is occurring, I’ll order the housing and additional RFID chips. 

Next big effort will be the VBA programming of the time keeping Excel sheets. Most will be done by someone of my staff at Airbus (I hope not everything during the working hours…).


Update 3/22/2017 - Stable running!

Since Friday, 3/17 the R-Pi is running permanently. If I’m doing some time keepings, the file is uploaded to DropBox at 1am. Next topic, which I’ll never tested yet will happen during the night to April, 1st: The March time keeping file will be removed and a new one for April will be created. Ok Ok… „Will be“ is a little bit optimistic. „Should be“ would be more precise...


Update 4/8/2017 - Version 1 ready but version 2 started

First of April I found the program crashed… What happened? I’ve programmed like this:

        Path = "/home/pi/Projekte/ReBo_Zeit/“
        File_name = "R_2017.csv“
        File_name = Path + File_name
        file = open(Path + File_name, "w“)

So the file=open would be like this:
        file = open("/home/pi/Projekte/ReBo_Zeit//home/pi/Projekte/ReBo_Zeit/R_2017.csv", "w“)

Yes, the path was two times mentioned. Skipping the 3rd (red) line above made this part of the sketch working.

Meanwhile I talked with my colleague, who’ll help me to import the stamped times from the file into the Excek sheets. My approach to create every month a file would create some additional effort and he asked, if it would be possible to work with only on file per year. We made a rough (very pestimistic) estimation of the size of the file: 40 employees, stamping 4 times a day, 5 days the week and during 52 weeks - 6 weeks of vacation: 40 x 4 x 5 x 46 = 37,000 data records at the end of the year. I crated a file with 50,000 data records and used that for stamping. The size of the file doesn’t have any impact when adding a new data record to the end of it. When the employee is asking the device for the last stamping he did, this is working like this:

  • open the file and go to the top
  • read a line
  • if the stamping is from the employee, store values in variables
  • read next record

Reading more than 50,000 records took much less than a second. Based on that I modified the sketch working with one file per year.

And why now working on version 2?

There’re two main reasons for that: First I wasn’t satisfied with the way I did it. My program became more and more „Spaghetti code“. Sometimes I didn’t returned from a sub-routine but jumped to another one. That’s ugly programming. Second I had a lot of trouble with my buttons on the monitor. So I looked for someone in my company for help. I found him and it was like this:

  • Another colleague told me his name and I visited him in his office.
  • I was very surprised, when he said he heard about Python, but never coded one single line with it.
  • But he just explained a lot about how to deal with a graphical user interface (GUI) and his first guess about my problem was right.
  • At the end he asked me for my code to have a look on it.
  • Two days later I received an eMail from him. He precisely described where my problems are.
  • Another two days later I received his first version of my sketch. Looking to it, I understood nothing. But it looked so professional.
  • In the meantime a week passed bye and today I just received his forth (or fifth???) version. More and more I’m understanding his approach. Again, it’s a professional one. But it’s hard for me, because he’s using words, most of them I heard, but I have no idea about the meaning: modules, classes, threads…

It will need some visits of his office next weeks to understand his way of setting up the program prior starting to include all the „non graphic“ parts. 


Update 4/15/2017

And here’s a first view of the housing:

IMG 2368

This is an old version. New version shown below...


Update 4/17/2017

No progress on the sketch because I need to wait, up to my colleague eliminated all my bugs inside. So I designed the RFID cards, which will be printed by the company, where I’ll buy them:

Schnappschuss (2017-04-17 17.41.30)


Left is the front and right the back of the card. The red line is showing where the cards will be cut. I’m quite happy with the color gradient (white on the top, the bottom and the right of the front. On the back the RFID number and the name of the holder will be printed by hand into the white fields. 


Update 7/15/2017

A lot of time passed bye. But the project is still progressing.

The program is still under construction, because my colleague wants to make it perfect. The upload of the data every night won’t be any longer a part of the main programm. It will be a „cron job“ which will be executed every night in parallel to the main program. On the other side he didn’t had so much time during the last months. The import of the data into the time keeping Excel files is done by my other colleague. We only need to test (again). And my third colleague prepared the housing. Here’re some pictures:

a IMG 2781

Left the Raspberry Pi, right the internal power supply

a IMG 2783


Front panel from rear: Left the RFID sensor, right the touch screen

a IMG 2786


Connectors at the bottom: left power, right LAN


IMG 2832

The front


IMG 2836

Program (new version) running


IMG 5691

normal screen for time keeping


IMG 2220

Administrator screen

Unfortunately my colleague has again to work on the front. He made a hole into the housing as I asked him. But unfortunately the antenna of the RFID sensor is at the borders of the breakout. At this moment the complete antenna is covered by the aluminium housing and no RFID chips are detected. He’ll have to rework it.


Update 8/6/2017:

A lot of time passed bye and only little progress. Why? The colleague „supporting“ me with the software was on vacation. He wrote an eMail telling me, he worked on the software and except some tiny special topics it’s ready. Tomorrow (on Monday) he’ll deliver the current version. My other colleague rworked the front panel. Now the antenna of the RFID sensor is completely uncovered by the aluminium housing and it’s working great. 

I hope, I’ll have all ready by end of August or September latest.


Update 9/10/2017:

Meanwhile a lot of things happened. But today I’m able do say „done!“ But it was a hard way. Main steps to be reached:

  • A lot of work done with the Excel files. 
  • The programming of the Raspberry was modified a lot by my colleague:
    • The nightly upload of the file to DropBox isn’t any longer a part of the program itself but a chron-job
    • There will be a cutover day to start with a new file (most probably 12/31). But we have to take care that „old“ values are still available just after the cutover day. We decided to keep the last 3 months when setting up a new file.
  • A big problem was when I discovered that the RFID cards are much less sensible as the keychain chips. Fortunately I’m owning a 3D printer since less than 2 weeks. (more about here). I’ve built a separate housing for the RFID sensor, which is now located less than 1 mm behind the front:
IMG 2834


Next steps:

  • The holder of the housing is already placed at the nursery and all the staff is asking, for what it is.
  • 9/13: electricans will place the power and network cables.
  • 9/14: I’ll inform all the staff during a full staff meeting about.
  • 9/15: Introduction to 3 - 5 test users.
  • 9/18: Start of testing.




******************************************************************

Hier gibt es das Vilros-Handbuch zum Download


Stay tuned! 

Blog will be continued… 



©  Olaf Goette 2008 - 2018