Monday, July 31, 2017

kernel: [ 1636.320383] w1_master_driver w1_bus_master1: Family 0 for 00.f80000000000.b6 is not registered.

Spent nearly a day trying to figure out that why my temperature sensor is not working and giving the below message in /var/log/syslog

kernel: [ 1636.320383] w1_master_driver w1_bus_master1: Family 0 for 00.f80000000000.b6 is not registered.

My config.txt settings are as below:

pi@raspberrypi:~ $ grep -i 'dtoverlay' /boot/config.txt
#dtoverlay=lirc-rpi
dtoverlay=w1-gpio
pi@raspberrypi:~ $ 

Nothing special in /etc/module

pi@raspberrypi:~ $ cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
snd-bcm2835
#w1-gpio pullup=1
#w1-therm
pi@raspberrypi:~ $ 

but I was still getting the error in the logs.

Now I am getting the link of 28.XXXXXXX but before I was getting 00.XXXXXXXX . So I was not sure that what is happening and what is causing the temp sensor not to work.

Current output is

pi@raspberrypi:/sys/bus/w1/devices $ ls -l
total 0
lrwxrwxrwx 1 root root 0 Jul 31 20:53 28-041600c817ff -> ../../../devices/w1_bus_master1/28-041600c817ff
lrwxrwxrwx 1 root root 0 Jul 31 20:56 w1_bus_master1 -> ../../../devices/w1_bus_master1
pi@raspberrypi:/sys/bus/w1/devices $ 


pi@raspberrypi:~ $ dmesg | grep w1
[    5.663840] w1-gpio onewire@0: gpio pin 4, external pullup pin -1, parasitic power 0
[    5.663887] w1_add_master_device: set_pullup requires write_byte or touch_bit, disabling
pi@raspberrypi:~ $ 


I have spent time reading device tree, checking different gpio pins, updating and upgrading os anything and everything.

In the end I thought of having a closer look then found that the resistor 4.7K Ohm is not connected to one side of the sensor properly, which was causing the abnormal behaviour.

After ensuring the proper connection things have started working okay and now I can see the temp again.

pi@raspberrypi:/sys/bus/w1/devices/28-041600c817ff $ cat w1_slave
9b 00 4b 46 7f ff 0c 10 e1 : crc=e1 YES
9b 00 4b 46 7f ff 0c 10 e1 t=9687
pi@raspberrypi:/sys/bus/w1/devices/28-041600c817ff $ 

Tuesday, July 18, 2017

ORA-03297: file contains used data beyond requested RESIZE value

SQL> alter database tempfile '+DATA/testp/tempfile/temp.276.799247671' resize 5000M;
alter database tempfile '+DATA/testp/tempfile/temp.276.799247671' resize 5000M
*
ERROR at line 1:
ORA-03297: file contains used data beyond requested RESIZE value


SQL>

SQL> col file_name format a70
SQL> select file_name, tablespace_name, status, BYTES/1024/1024 "F Size MB", maxbytes/1024/1024 "Max Size MB", INCREMENT_BY, AUTOEXTENSIBLE from dba_temp_files;

FILE_NAME                                                              TABLESPACE_NAME                STATUS   F Size MB Max Size MB INCREMENT_BY AUT
---------------------------------------------------------------------- ------------------------------ ------- ---------- ----------- ------------ ---
+DATA/testp/tempfile/temp.276.799247671                              TEMP                           ONLINE       11000       11000           80 YES

SQL>

SQL> ALTER TABLESPACE temp SHRINK SPACE KEEP 5000M;

Tablespace altered.

SQL> col file_name format a70
SQL> select file_name, tablespace_name, status, BYTES/1024/1024 "F Size MB", maxbytes/1024/1024 "Max Size MB", INCREMENT_BY, AUTOEXTENSIBLE from dba_temp_files;

FILE_NAME                                                              TABLESPACE_NAME                STATUS   F Size MB Max Size MB INCREMENT_BY AUT
---------------------------------------------------------------------- ------------------------------ ------- ---------- ----------- ------------ ---
+DATA/testp/tempfile/temp.276.799247671                              TEMP                           ONLINE  10999.9922       11000           80 YES

SQL>


SQL> ALTER TABLESPACE temp SHRINK SPACE KEEP 5000M;

Tablespace altered.

SQL> select file_name, tablespace_name, status, BYTES/1024/1024 "F Size MB", maxbytes/1024/1024 "Max Size MB", INCREMENT_BY, AUTOEXTENSIBLE from dba_temp_files;

FILE_NAME                                                              TABLESPACE_NAME                STATUS   F Size MB Max Size MB INCREMENT_BY AUT
---------------------------------------------------------------------- ------------------------------ ------- ---------- ----------- ------------ ---
+DATA/testp/tempfile/temp.276.799247671                              TEMP                           ONLINE  6231.99219       11000           80 YES

SQL>
SQL>
SQL>
SQL> alter database tempfile '+DATA/testp/tempfile/temp.276.799247671' AUTOEXTEND on maxsize 5000M;

Database altered.

SQL> select file_name, tablespace_name, status, BYTES/1024/1024 "F Size MB", maxbytes/1024/1024 "Max Size MB", INCREMENT_BY, AUTOEXTENSIBLE from dba_temp_files;

FILE_NAME                                                              TABLESPACE_NAME                STATUS   F Size MB Max Size MB INCREMENT_BY AUT
---------------------------------------------------------------------- ------------------------------ ------- ---------- ----------- ------------ ---
+DATA/testp/tempfile/temp.276.799247671                              TEMP                           ONLINE  6231.99219  6231.99219           80 YES

SQL>

Monday, July 10, 2017

getting python webpage to be displayed

I am using Server version: Apache/2.4.10 (Raspbian) and Python 2.7.9

the issue I was getting that when trying to open my webpage

http://dhillon.duckdns.org:17581/cgi-bin/webgui.py

It was displaying the python code rather than the webpage.

I had to do below thing to get it fixed.
sudo a2enmod cgi
sudo a2disconf serve-cgi-bin
then modified the conf file under
/etc/apache2/apache2.conf
and included
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
        AddHandler cgi-script .py
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Require all granted
</Directory>
after that restarted the apache and that's it .
sudo service apache2 reload

Make sure that the python files are under /usr/lib/cgi-bin/ and have correct permissions

Done !!!