I have great problem with raspberry and domoticz and mysensors gateway !



  • hi guys.
    i have a great problem and i cannot found that reason!
    i use a raspberrypi 3
    domoticz v3.5877 ( i dont need to upgrade because i use special theme and icon )
    and use a mysensors gateway for raspberry pi .
    this is happen after 7 -8 month for me (twice) so twice my pi is failure.
    in hardware i use a 2.5A power for raspberry and use a LF33CV with a 100u capacitor for NRF+ radio (connect to 5v pinout on raspberry). and wiring is similar to mysensors guide.
    also use espeasy for relay modules....
    this is happen for second time . after 7-8 month that i use domoticz and mysensors and espeasy ... so i see some relay dont work or very bad work . so after reboot raspberry or turn off/on i see just red LED is on ( in raspberry) and LED in network cable is off, after some off/on/off/on/off/on power green LED is blink and start domoticz but relay again dont work... with reboot again just red led on......
    i think my PI is failure ( i have similar expramance 9 month ago) and i think the reason is just about domoticz or mysensors gateway or hardware about gateway... because i dont have any other apps or devices on RPI...


  • Hardware Contributor

    @Reza - so its not just a corrupt sd-card which is quite common if you have something writing alot.


  • Mod

    I had the same issue with my raspberry pi and OpenHAB.
    After a couple of weeks it would crash and ultimately corrupt my sd card.

    I solved that issue by:

    1. Reinstall Raspbian;
    2. Reinstall OpenHAB and pay very careful attention for both the application and Raspbian;
    3. Reboot the Raspberry Pi each saturday night at 12:00 (but you can use any day/time ;))

    #3 is a medicine obviously and not the cure.
    I am not even sure it is necessary but it give me confidence...

    Maybe the same procedure helps your case.



  • @sundberg84 said in I have great problem with raspberry and domoticz and mysensors gateway !:

    so its not just a corrupt sd-card which is quite common if you have something writing alot.

    thank you for answer . so you think this is related to sd card ?because i format sd card and again setup all levels. also i change sd card 7 month ago (and change Rpi). but ....
    i thing there is a problem in RPi hardeware !
    i setup domoticz and mysensors gateway. i use 5 multi sensors for mysensors and use 10 relay module with espeasy. and there is not any app or program on RPi...



  • @marceltrapman said in I have great problem with raspberry and domoticz and mysensors gateway !:

    I had the same issue with my raspberry pi and OpenHAB.
    After a couple of weeks it would crash and ultimately corrupt my sd card.
    I solved that issue by:

    Reinstall Raspbian;
    Reinstall OpenHAB and pay very careful attention for both the application and Raspbian;
    Reboot the Raspberry Pi each saturday night at 12:00 (but you can use any day/time )

    #3 is a medicine obviously and not the cure.
    I am not even sure it is necessary but it give me confidence...
    Maybe the same procedure helps your case.

    thank you for answer . i want found problem ! so this is related to 24-hour every day RPI is on?



  • @sundberg84 my friend if a sensor send many report to domoticz, so this is a "quite common if you have something writing alot." ?


  • Hardware Contributor

    You need to use a class 10 sd-card from a known manufacturer.
    Another idea is to disable logging so it does not use up the write cycles so quick.



  • @sundberg84 said in I have great problem with raspberry and domoticz and mysensors gateway !:

    You need to use a class 10 sd-card from a known manufacturer.
    Another idea is to disable logging so it does not use up the write cycles so quick.

    so you think this is related just sd card ? this is my sd card
    0_1504527788188_photo_2017-09-04_16-51-49.jpg

    "Another idea is to disable logging so it does not use up the write cycles so quick."
    how can i disable this ?
    thank you for help


  • Hardware Contributor

    @Reza - there are different ways to do this, and Im no expert.
    Please have a look and continue from there...

    https://domoticz.com/forum/viewtopic.php?f=28&t=8788



  • @sundberg84 said in I have great problem with raspberry and domoticz and mysensors gateway !:

    @Reza - there are different ways to do this, and Im no expert.
    Please have a look and continue from there...
    https://domoticz.com/forum/viewtopic.php?f=28&t=8788

    Make system read only http://blog.pi3g.com/2014/04/make-raspb ... read-only/
    Run system from external HD http://raspberrypihobbyist.blogspot.nl/ ... drive.html
    Boot from USB http://jonathanmh.com/boot-raspberry-pi ... usb-stick/

    thank you very much


  • Mod

    @Reza sai

    thank you for answer . i want found problem ! so this is related to 24-hour every day RPI is on?

    I don't think that is what I said, I wrote down how I solved it.
    Not saying that it will work for you but it could be worth the try.



  • @marceltrapman said in I have great problem with raspberry and domoticz and mysensors gateway !:

    I don't think that is what I said, I wrote down how I solved it.
    Not saying that it will work for you but it could be worth the try.

    thank you my friend



  • @sundberg84
    i buy a new sd card and write again os and domoticz and gateway...
    now LED is ok and i have a ip for raspberry. but i think my raspberry's hardware is failure because now my commands send with a lot delay or can not send. or save and send all commands together suddenly . Do you know why?

    but about read only. thank you . i read this. but i have question. with this work after power off/on my sd card will not fail , is this true ? but when i do to read only , there is not any problem in Performance domoticz and my sensors and gateway? for send and receive commands ?after setup domoticz and my sensors gate way i can change to read only ? thank you


  • Hardware Contributor

    @Reza -I dont use read only because I wish to log. Instead I backup my database every day... preparing for a SD-card failure.

    I have bought a class 10 8gb SanDisk and this has lasted me 2 years now with standard settings. First one was about 6-8 months with another brand.



  • Use Berryboot AND fast USB drive to solve most of the problems related to corruption on SD card due power failures and number of write cycles. I have been using it for 2+ yrs now...



  • @sundberg84 my new sd card is sandisk. setup again domoticz and mysensors gateway...
    now os is ok even with power off/on. but i think my raspberry is fail . i think cpu is fail. before i compile domoticz with -j4 without any problem . but now with -j4 after 10-20% rpi is freeze. even when i compile with just make, when i want use domoticz for send command for relay , this have a a lot delay , or command can not send , or save command and after 1 min send all command. i think cpu can not work correct and have a hardware problem ! but i dont know why happen this ! after 7 month rpi was on the table and power was ok and i dont install any new software on the rpi ! suddenly happen...



  • @vikasjee thank you . but my main problem is not sd card . after 8 month my Rpi is fail suddenly 😞 i want found why...


  • Admin

    @Reza

    Continuous writes to a SD card, will make it fail at some point in time, it's just a question of time!.. And thus it will make the rpi fail.
    Another thing can also be powering issues. (and even combined with a failing SD Card..)



  • thank you dear @tbowmo
    so this (fail cpu or rpi board) can related to write in cd card ? because i am confused .i can not found why suddenly... . i tested power and didn't have problem(if power of my house have problem so first power supply of raspberry should to fail). my rpi was working for 7-8 month without any access people to it and i dont any install new app or program. just power on rpi and put on my table !
    in rpi was just domoticz and mysensors gateway. i used this just for smart home.
    now i want just found reason of problem and solve this 😞
    do you think this problem (rpi fail) can related to sd card ? (According to the above description)
    if yes , so for resolve , what is your suggest ? use a usb memory ? or read only (i want use rpi just for domoticz and mysensors gateway and devices)?with read only i can not see any report in domoticz log ?
    thank you


  • Admin

    @Reza

    In it's default setup, domoticz writes log files and other data to the SD card all the time, and this can (over time) wear the SD card down, and eventually make it fail!

    F.ex. everytime my domoticz instance receives a message from the MySensors gateway, it writes a log entry, describing which node it received the data from. (I have my log file stored on a ram disk though, so not writing directly to the SD card)



  • @tbowmo
    now you use a external memory for log ? and have not any problem ?
    can you give me a Training link for setup step by step usb memory for write log ?


  • Admin

    No, I do not use external memory.. I have a ram disk (I take some of the RAM memory of the RPI and converts it into a "disk")

    See this link for more info http://bfy.tw/Dlkf



  • @tbowmo you was helper for me always . thank you for this .
    i found this :
    https://www.domoticz.com/wiki/Setting_up_a_RAM_drive_on_Raspberry_Pi
    this is help me for dont happen fail again ?
    again thank you for help


  • Admin

    @Reza

    It will not totally prevent these things of happening, but it might help reduce the risk of it happening again..



  • @tbowmo thank you again my dear friend.


  • Mod

    @tbowmo How big did you make the RAMdisk?


  • Admin

    @gohan

    63Mb. The sd card was made for my old 512Mb RPI B, now it runs on my 1024Mb RPI2, and have been working fine for more than a year.



  • @tbowmo do you know how i can stop domoticz.sh (after i compile source domoticz) for change log...
    i see this topic. (https://www.domoticz.com/wiki/Moving_Log_and_Temporary_Files_To_a_RAM_Drive)
    but this is for standard install. i use source and i can not how stop and change and start again....


  • Admin

    @Reza

    I think you can find information here http://bfy.tw/Dn2q



  • @tbowmo i search about this and i test this code before:
    Start Domoticz
    sudo service domoticz.sh start

    Stop Domoticz
    sudo service domoticz.sh stop

    Check if Domoticz is running
    sudo service domoticz.sh status

    but this is dont work for domoticz that compile from source.
    this is result:

    
    pi@raspberrypi:~ $ sudo service domoticz.sh stop
    Failed to stop domoticz.service: Unit domoticz.service not loaded.
    pi@raspberrypi:~ $ sudo service domoticz.sh status
    ● domoticz.service
       Loaded: not-found (Reason: No such file or directory)
       Active: inactive (dead)
    pi@raspberrypi:~ $
    

    for this i had to question from you 😞


  • Hardware Contributor

    @Reza you can run ps to see current services running. Maybe its named something else when compiled from source - or its not just running? Did you try to start it before stopping it?


  • Mod

    @Reza why are you running it from source and not from standard install?



  • @sundberg84
    thank you friend. domoticz now is working for me.but when run ps i dont see domoticz:

    
    pi@raspberrypi:~ $ ps
      PID TTY          TIME CMD
     1000 pts/0    00:00:00 bash
     1026 pts/0    00:00:00 Xtightvnc
     1031 pts/0    00:00:00 xstartup
     1034 pts/0    00:00:00 lxsession
     1066 pts/0    00:00:00 dbus-launch
     1084 pts/0    00:00:00 openbox
     1086 pts/0    00:00:00 lxpolkit
     1088 pts/0    00:00:00 lxpanel
     1090 pts/0    00:00:01 pcmanfm
     1134 pts/0    00:00:00 start-pulseaudi
     1135 pts/0    00:00:00 xprop
     1585 pts/0    00:00:01 Xtightvnc
     1589 pts/0    00:00:00 xstartup
     1592 pts/0    00:00:00 lxsession
     1624 pts/0    00:00:00 dbus-launch
     1643 pts/0    00:00:00 openbox
     1645 pts/0    00:00:00 lxpolkit
     1647 pts/0    00:00:00 lxpanel
     1649 pts/0    00:00:02 pcmanfm
     1693 pts/0    00:00:00 start-pulseaudi
     1694 pts/0    00:00:00 xprop
     2546 pts/0    00:00:00 ps
    

    this is files after compile . and i put "/home/pi/rayan/domoticz" to "rc.local" for up after startup.
    0_1504776551528_0000000.jpg



  • @gohan because i wanted change some things. for example font , theme , icons and etc...


  • Admin

    @Reza

    Once again, try this link http://bfy.tw/DnCc

    (Hint.. try looking for answers by using google!)



  • @tbowmo thank you . i will search about this issue



  • @tbowmo thanks for all guide. i could do it. thank you
    My friend just one question . i want know if i choose for example 20mb for ram driver (tmpfs). after full this memory (if i dont clear this), so what happen ? raspberry will be crash ? or not happen and I dont have any new log and report ? or again write on ago log ? thank you for all help


  • Admin

    I restart domoticz every night, and delete the log file. If you don't do this regularly, the disk will fill up, and domoticz will not be able to write any logs. I don't know what will happen with domoticz in that case



  • @tbowmo
    every night !! 😮 you do with hand or auto with a program? if you have a program for this can you share this ?
    i test with 1mb memory, i see after full , domoticz dont work and have some problem. so we must clear ...
    can you help me for build a program for this ? for example when this is 90% memory (tmpfs) so clear this...



  • @tbowmo i found this script.but becuase i am beginner in script i can not know this.
    can we use this for clean tmpfs after 2day each week ? can you edit this for our use exactly ? i build a tmpfs in /var/log . and i move domoticz.log to this folder... now what change i need in this script for clean /var/log every 2 days and how to use this automatic for always when power off/on , reboot and...
    thank you for help

    #!/bin/bash
    # Diskclean-Linux.sh - Remove unused files from /tmp directories
    # @author: Crunchify.com
     
    # ------------- Here are Default Configuration --------------------
    # CRUNCHIFY_TMP_DIRS - List of directories to search
    # DEFAULT_FILE_AGE - # days ago (rounded up) that file was last accessed
    # DEFAULT_LINK_AGE - # days ago (rounded up) that symlink was last accessed
    # DEFAULT_SOCK_AGE - # days ago (rounded up) that socket was last accessed
     
    CRUNCHIFY_TMP_DIRS="/tmp /var/tmp /usr/src/tmp /mnt/tmp"
    DEFAULT_FILE_AGE=+2
    DEFAULT_LINK_AGE=+2
    DEFAULT_SOCK_AGE=+2
     
    # Make EMPTYFILES true to delete zero-length files
    EMPTYFILES=false
    #EMPTYFILES=true
     
    cd
    /tmp/log "cleantmp.sh[$$] - Begin cleaning tmp directories"
     
    echo ""
    echo "delete any tmp files that are more than 2 days old"
    /usr/bin/find $CRUNCHIFY_TMP_DIRS                               \
         -depth                                                     \
         -type f -a -ctime $DEFAULT_FILE_AGE                        \
         -print -delete
    echo ""
     
    echo "delete any old tmp symlinks"
    /usr/bin/find $CRUNCHIFY_TMP_DIRS                               \
         -depth                                                     \
         -type l -a -ctime $DEFAULT_LINK_AGE                        \
         -print -delete
    echo ""
     
    if /usr/bin/$EMPTYFILES ;
    then
    echo "delete any empty files"
    /usr/bin/find $CRUNCHIFY_TMP_DIRS                               \
         -depth                                                     \
         -type f -a -empty                                          \
         -print -delete
    fi
     
    echo "Delete any old Unix sockets"
    /usr/bin/find $CRUNCHIFY_TMP_DIRS                               \
         -depth                                                     \
         -type s -a -ctime $DEFAULT_SOCK_AGE -a -size 0             \
         -print -delete
    echo""
     
    echo "delete any empty directories (other than lost+found)"
    /usr/bin/find $CRUNCHIFY_TMP_DIRS                               \
         -depth -mindepth 1                                         \
         -type d -a -empty -a ! -name 'lost+found'                  \
         -print -delete
    echo ""
     
    /usr/bin/logger "cleantmp.sh[$$] - Done cleaning tmp directories"
     
    # send out an email about diskcleanup action
    mail -s "Disk cleanup has been performed successfully." you@email.com
     
    echo ""
    echo "Diskcleanup Script Successfully Executed"
    exit 0
    

  • Admin

    @Reza

    One quick fix would be to delete the /var/log/domoticz.log file whenever domoticz is restarting. Then you just need to implement a periodically restart of domoticz.



  • ok thank you. but i have a new problem...
    i think just move domoticz.log to ram driver. but report of sensors in mysensors... where these is save?:/
    i think report of mysensors can not write... now in domoticz log i can not see report.. also i chack var/log memory after 1 day.when i send command for turn on light (alot command) memory of var/log increase.but 1 day i dont send any command and i wait for increase memory with report sensors but dont increase.what is problem? when i change your setting to defult work and i see report of sensors.
    0_1505027201982_lklklklk.jpg
    and this is memory of log after one day. sensors was sending report to controller for 1 deys but before memory was 1304 and now is 1304...
    0_1505027249721_jkjkj.jpg


Log in to reply
 

Suggested Topics

  • 3
  • 10
  • 3
  • 15
  • 2
  • 4

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts