Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Monday, 30 November 2020

Raspberry Pi Camera Images - I made a mistake!

When I set-up the Raspberry Pi camera to take pictures every 2 minutes (see my previous post), I did not check up on the files to see if they were saving properly. My goal was to leave the Pi running for at-least 10 days to get a large amount of images to work on some image processing and convolutional neural networks.

When I did my initial test for 1 days I calculated my image file size to be very small (max of about 200kB). So, if there a photo every 2 minutes, that's about 720 photos a day and 7200 photos in 10 days. Which is only 1.4-1.5GB of space - not a problem. Since my Raspberry Pi zero was did not come with WiFi I didn't bother looking at the progress as I didn't want to disturb the camera.

So where did I go wrong? When I did my first test I had a small Python script which took a photo every 5 minutes, but since the python script tends to leave the camera on as long as it is running, I decided to write a small shell script which can also do the same thing and I scheduled the script from Crontab to run every 2 minutes, but I did not check on the new file size. Apparently running the camera this way actually saves an Image of roughly 2.5MB instead of 200kB - Oops. The rest is simple, my Raspberry Pi exceeded by initial estimates by the end of Day 1 and the file system crashed at the end of Day 2. However, I did manage to extract the files from the SD card.

But turns out this is not the reason why my file system crashed. At the end of day 2 I only had about 2.5GB of space on an 8GB SD card. I knew there was no way my files could have exceeded this limit. So why then? When I did some reading I realized that this was to do with the block size. The block size on my Raspbian OS is about 4096 bytes, which means that any file is saved on fixed blocks of 4MB. Whether my image was 200kB or 2.5MB it would have taken up 4MB to save the file. So, looking at it this way it can be easily seen that to save my 2 days worth of images it had actually taken close to 5GB of disk space.

So technically, this attempt would have been a bust either way. Time to look in to a new method of saving files.

Wednesday, 4 November 2020

Raspberry Pi Camera Time-lapse

 Previous Post: Setting up your Raspberry Pi Camera

Once I set-up my Raspberry Pi camera, I wrote a simple script to take a picture from my camera every 2 minutes.


Sunday, 1 November 2020

Setting up a Raspberry Pi Camera

I had a small generic Raspberry Pi Camera Rev 1.3 lying around in my parts box for some time and I have always put aside working on it. So I decided to finally take it out and one of my Raspberry Pi zeros to test out the Raspberry Pi Camera.

Friday, 30 October 2020

Setting up WiFi communication between Raspberry Pi and ESP8266 with MQTT

One of the fundamental components in setting up your DIY smart home or IoT project is to set-up the communication method between your devices and the server.

Given the most accessible wireless network to most of us is our home WiFi, I will be using the MQTT protocol to send messages over WiFi. The main server for this will be a Raspberry Pi and the devices (or clients) are ESP8266, ESP32 or similar devices

Home-made Raspberry Pi Media Center

When you have a number of laptops, phones PCs, TVs and tabs in your house in which you listen to music or watch movies and TV shows, it can be frustrating to sync all your media between each of the devices. I have set-up a Raspberry-Pi based media server in my house to be able to access my music, photos and other media from any device connected to my WiFi.

Powered by:




Monday, 13 April 2020

Kivy based Project Dashboard


This is a custom dashboard that I designed for my Raspberry Pi attached to my Tabletop display which you can see here -> https://johnsamarasinghe.blogspot.com/2020/03/tabletop-screen.html. The dashboard design in Kivy with Python, allows you to view up to six projects at once, along with an about section and link to view all other projects.



Sunday, 29 March 2020

Tabletop Screen

This is a project that I wanted to do for a quite a while.
I had a very old laptop where the screen had come off and I wasn't able to use the laptop any more. So I decided to embed the screen to my electronics table so that I can use the screen to display some information that I want to look up while working.


Wednesday, 12 February 2020

NFC Enabled Invitations Cards (+ Analytics for a Sri Lankan Wedding)

Invitation cards are one of the key components of a big event. It provides a description of the event, time, venue, dress code and other important information the invitee needs to know. These are generally a one way mode of communication. The organizer hands out the invitation card to the invitees, the invitees make a note of the details and that's the end of that.

For my wedding I wanted to push the limits of wedding invitation cards in order to provide some ease for the invitees. In order to achieve this I pasted a cheap NFC tags to the back of each invitation card with a simple message to describe what it is. As some people do not prefer this, the NFC can also be embedded within the invitation card for a premium feel.

The purpose of using an NFC tag was so that I can allocate a unique identification code to each invitation and link it to a table number or any other information that is needed. Generally table numbers are not known when handing out the invitation cards. These are usually assigned closer to the day of the event and the guests can scan their invitation cards at the entrance on the day of the event and be presented with their table number(s). However, as I was working on this project as a hobby, a number uses for this presented itself.

Benefits of using the NFC tag.
  • Added security - Officials at the event location can scan the invitation card to verify the identity of the invitee
  • Avoid congestion & crowding - Invitee can avoid the queue to check the table numbers at the entrance
  • Custom messages - Invitees can be displayed with a custom message on arrival
  • Photo booth - Scanning the invitation can launch a photo-booth that can take the picture of the invitee and automatically email it to them.

Saturday, 8 February 2020

Remotely Updatable Raspberry Pi based Dashboard

This article consists of instructions on how you run your python code on a stand-alone Raspberry pi connected to a screen while updating your code from your own personal computer.

For this project, my main intention is to have a dashboard that will be displayed on a large screen connected to a Raspberry Pi while all the codes can be updated using a computer that is not connected to the Raspberry Pi. My dashboard will be a Kivy app running on python. I will be using a Raspberry Pi 3 B to display the dashboard and I will use a Basic Onedr
ive account to synchronize the folder structure and the python code between my computer and the raspberry pi.


Tuesday, 23 April 2019

Hand Activity Recognition: Literature Review

I am planning on starting my own project in Hand Activity Recognition. However before starting on this project I have conducted a literature review that is shown below.

Please note that most of the information given below are not mine. The source of the information is linked with the respective title.