donderdag 15 december 2016

nextcloud 10, centos 7 and rh-php56

nextcloud is a great alternative for dropbox.
It 's easy to run, manage and use.
It got great apps on android and linux.

I'v been running owncloud on debian but recently decided to change to centos 7.
Moving nextcloud was easy, but centos 7 comes with PHP54.
So Ive tried to upgrade PHP to 56, but that was not as easy as I tought.

In the end I got it running with these.

sudo yum install rh-php56-php-mbstring rh-php56-php-gd rh-php56-php-pdo rh-php56-php-xml rh-php56-php-pear wget bzip2 curl rh-php56-php rh-php56-php-mysqlnd

cd /etc/httpd/conf.d
sudo mv 10-php54-php.conf 10-php54-php.old

cd /etc/httpd/conf.modules.d
sudo mv 10-php54-php.conf 10-php54-php.old  
sudo mv 10-php.conf 10-php.old

cd /etc/httpd/modules
sudo ln -s /opt/rh/httpd24/root/usr/lib64/httpd/modules/librh-php56-php5.so .

sudo apacheclt restart

I got the site running, then I got these errors
Can't write into config directory!
This can usually be fixed by giving the webserver write access to the config directory.

but these too saved my day.

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud(/.*)?'; restorecon -RF /var/www/html/nextcloud/

semanage fcontext -a -t httpd_sys_rw_content_t '/data(/.*)?'; restorecon -RF /data/


zondag 27 november 2016

weekender project: build a clock out of a plastic jar.

Make a clock with a white plastic jar, 2 adafruits neopixel rings and an arduino.

you need
1 arduino uno
1 adafruit neopixel ring 24 color leds (link)
1 adafruit neopixel ring 12 color leds (link)
1 plastic jar with lid, big enough to hold the 24 leds ring.
1 rtc module (real time clock) like this one (link)


The small ring is the small hand of a clock. 12 led's for 12 hours.
the bigger ring show's the seconds an minutes. well 2.5 minutes (seconds). Because 60 minutes diveded by 24 leds is 2.5 minutes interval. This makes the clock less accurate to read. Adafruit sels 60 led ring but it's huge, too huge.
The seconds go round in smooth way. They start to fade in and fade back out, one after another to create a fluid motion.
The minute and hour "hand" don't have this motion (yet).
The color of the hour and minute leds change during the day. At midnight till about 4 they are blue, then they start to fade to red at dusk continue to yellow at noon, in the late afternoon they fade back to orange, red, purple and blue to emulate the dawn.

The code.

You can find the code on github (link).

puzzling the pieces together

The neopixel rings are easy to put together. The rings need only 3 wires: 5v, ground and a data line. Run a wire from pin 6 on the arduino to the data in of the 24 led pin and a wire from de data out of the 24 led ring to the data in of the 12 led ring. Connect the 5 volt and ground.

The rtc module needs 5 wires: 5 volt, ground, mosi, miso and ss. They are connect to pins 10-13.

The jar.

you need a white plastic jar. The neopixels are bright. A white jar kind of smooth out the bright light.


the neo pixel ring front
neopixel rings atached to a small piece of wood

in the jar



the arduino and the rtc mounted in the lid of the jar

 

what's still missing

Button's to adjust the time. I had no right size switches of button's left, so adjusting the time can't be done without connecting the arduino to the computer and recompile the code.

zaterdag 12 maart 2016

using Wipy, Sim800 GRPS GMS modem, DHT11 temp sensor and micropython

Using an wipy (http://www.wipy.io), micropython to read temperature with DHT11 and sending the data to a (local) blynk server
using a SIM800 GSM board to send a warning when temperature drops below zero degreesor when a button gets pushed on the blynk
blynk by blynk (http://www.blynk.cc)
blynklib by danicampora ( https://github.com/wipy/wipy/blob/master/lib/blynk/BlynkLib.py )
untplib by andrewmk ( https://github.com/andrewmk/untplib )
DHT decoder by RinusW (http://forum.micropython.org/viewtopic.php?t=1392)
(inexpensive) SIM800L GPRS GSM Module SIM Board QUAD BAND Antenna for MCU Arduino (and wipy, ...)
mashup by me andre@andrehtemac.be
todo sim800 communication needs more work
2016/03/12 : version 0.1

see the code on:
https://github.com/andrethemac/wipyDHTSIM800.git