Django datalogger

Sample datalogger with Django
Django datalogger

Here is a datalogger I have built with an old PCB from a project. The PCB itself has different sensors such as NTC, flow sensors, resistors and leds. I have used the NTCs sensors to retrieve the values every minute and send to a Server.
For this I have used Django and Charisma django, a port from a html template I have made (for more information visit this post).

I placed a sensor outside my window, two inside the room and one inside the radiator. The microcontroller use ADC interrupts to poll the temperature and send it over serialport to a WiFi module. This WiFi module send the data to the server.

Check this project live here

PCB NTC
PCB with NTC

Free responsive django admin template

Free html admin template
Charisma django admin html template

I have ported charisma admin template from usman to django. Check the live version here.

To install use

pip install django-charisma

Collect static and add urls:

python manage.py collectstatic

You can modify the boxes and create/include in every page as follow:

{% extends 'charisma_django/base.html' %}
 {% block content %}
    {% include 'charisma_django/breadcrumb.html' %}
    {% include 'charisma_django/boxes/four_blocks.html' %}
  <div class="row">
   {% include 'charisma_django/boxes/introduccion.html' with colmdwidth='12' %}
  </div>
 
  <div class="row">
   {% include 'charisma_django/boxes/buttons1.html' with colmdid='buttons1' %}
   {% include 'charisma_django/boxes/buttons2.html' with colmdid='buttons2' %}
   {% include 'charisma_django/boxes/weekly_stats.html' with colmdid='weeklystats' %}
  </div>
 
  <div class="row">
   {% include 'charisma_django/boxes/member_activity.html' with colmdid='memberactivity' %}
   {% include 'charisma_django/boxes/tabs.html' with colmdid='tabs' %}
   {% include 'charisma_django/boxes/keep_in_touch.html' with colmdid='keepintouch' %}
  </div>
 {% endblock %}

I have created a datalogger with this template and old PCB from a project. Check it out here.

If you have some doubts do not hesitate to contact me at grrodre@gmail.com

How to set up proftpd in Linux

This post is a guideline that I use to set up proftpd in a linux server.

 I create a user group for FTP users and assign a specific home folder where the WEB is located.

 I am using Debian Jessy.
First step install package:


apt-get install proftpd-basic

Edit config file and add the following lines


nano /etc/proftpd/proftpd.conf


<Global>
    RequireValidShell off
</Global>

DefaultRoot ~ ftpuser

<Limit LOGIN>
    DenyGroup !ftpuser
</Limit>

This way we will handle ftp users by adding them to a group ftpuser without a valid shell. They will also be jailed in the user’s own home directory.

Create new group, user and asign him the home directory. I am using /var/www/wordpress_one as home directory.


addgroup ftpuser
adduser ftpuserone -shell /bin/false -home /var/www/wordpress_one
adduser ftpuserone ftpuser

Change the group permissions of the folder so apache or other web servers can work with it. Apply also the default group for new files created. This is usefull when wordpress or other program create new files.


chown ftpuserone:www-data wordpress_one/
chmod g+s wordpress_one/

Restart the service and test the user


service proftpd restart

ftp -nv yourftpdomain.com
220 ProFTPD 1.3.5b Server (Debian)
ftp> user ftpuserone
331 Password required for ftpuserone
Password: 
230 User ftpuserone logged in
Remote system type is UNIX.

Now web files can be uploaded over ftp directly.