Skip to content

Diagnostics and debug

autopower_developer edited this page Nov 20, 2018 · 5 revisions

How to debug?

thermeq3 code produce these files:

  • <PATH>/csv/<device_name>.csv, simple comma separated value file with valve positions and temperature readings
  • <PATH>/<device_name>.log, log file, huge on log_debug
  • <PATH>/<device_name>_error.log, python stderr redirected, use in case of crash, or send me this file.
  • <PATH>/<device_name>.bridge saved bridge client values
  • <WWW_PATH>/bridge.json bridge values for dashboard

For Yún, path is /mnt/sd<x1> where x1 stands for a1 or b1, so full path will be /mnt/sda1 or /mnt/sdb1. For RPi path is /home/pi/thermeq3.

How to collect diag infos?

If something goes wrong, please do some diagnostics and paste results to the issues. For Yún run:

wget --no-check-certificate --quiet -O /root/diag.sh https://raw.githubusercontent.com/autopower/thermeq3/master/install/diag.sh;chmod +x /root/diag.sh

For RPi run:

wget --no-check-certificate --quiet -O /home/pi/diag.sh https://raw.githubusercontent.com/autopower/thermeq3/master/install/diag.sh;chmod +x /home/pi/diag.sh

If everything goes ok, run ./diag.sh <max!cube ip address>, e.g. ./diag.sh 192.168.0.222. And send diag.txt to [email protected]

Common problems

Yun

Always upgrade to latest yun firmware. Perhaps update bridge library Check storage mount points cd /mnt|ls -al, is there any storage mounted (USB or SD card?). Is your card/USB key readable in your PC/Mac? Is FAT32/exfat formatted?

RPi

Please send output of install script.

Network issues

From shell please check if you have connection to MAX!Cube:

  • ping your MAX!Cube: ping <maxcube_ip_address> -c 4
  • telnet to MAX!Cube: telnet <maxcube_ip_address> 62910, 62910 is default port
  • save results from ifconfig > ~/ifconfig.txt

Version

Please check log file for version you are using. Find line like this:

thermeq3 - INFO - --> V139 started with PID=1851 <--

It tells you, that you are using version 139. You can always check latest version for:

First 3 chars denote version.

config.py file

Did you edit config.py or thermeq3.json (depends on version) file correctly? Check for common mistakes such:

  • all values must be string,
  • no API key for openweather
  • wrong woeid

Log file, error log

Please check your error log (located in directory mentioned above, depends on version and file). If you see information like this:

thermeq3 - ERROR - Traceback: Traceback (most recent call last):
  File "/root/nsm.py", line 796, in openMAX
    var.client_socket.connect((stp.max_ip, 62910))
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 148] No route to host

Probably you have problem with MAX!Cube connection.

If you see error like this:

thermeq3 - ERROR - Traceback: Traceback (most recent call last):
  File "/root/nsm.py", line 382, in sendEmail
    server = smtplib.SMTP(stp.mailserver, stp.mailport)
  File "/usr/lib/python2.7/smtplib.py", line 249, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python2.7/smtplib.py", line 309, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib/python2.7/smtplib.py", line 284, in _get_socket
    return socket.create_connection((port, host), timeout)
  File "/usr/lib/python2.7/socket.py", line 553, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):

Probably you didn't edit config.py/thermeq3.json file with correct mail server information/credentials.

Everything installed correctly, but nothing happens

  • yún users:
    • did you upload sketch file (.ino)?
    • if arduino starts blink 4x, then LED is on, blinks 4x again?
    • if you login to linux part, /root/psg reports fully functional bridge (python -d bridge)?
    • did you insert SD crad or USB key?
    • is this storage correctly formated (fat32, extfs2/3/4)?
    • is debugging on? Please check sketch file for line // #define DEBUG_PRG, if no // on line start, then debugging is on and yún is waiting for serial connection. Please disable debugging and upload sketch again.
  • RPi users:
    • did you check relay with test_relay.py?

Any problem or question

Keep asking! If you have any problem or issue, just ask on facebook or via email.