google-code-export / measureit

Automatically exported from code.google.com/p/measureit
1 stars 0 forks source link

Mysql connection dropouts #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
My data logger is connecting to a remote MySQL database.. Every few days the 
data logger crashes with the error message "MySQL gone away".

Any chance of putting some connection error handling so that it cleanly retries 
to connect to MySQL?

Cheers

Original issue reported on code.google.com by sloth...@gmail.com on 25 Jul 2012 at 5:26

GoogleCodeExporter commented 9 years ago
Me too ....  :)

I am working on it. Meanwhile you can try to increase the wait timeout setting 
from mysql in your my.cnf
wait_timeout= xxx

Try the ideal setting for your installation. Here you will found more 
informations:
https://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait
_timeout

The next version from the grabber will handle this and other problems and if 
possible it will send emails to warn if this is for a longer time.

Original comment by lalelu...@gmail.com on 27 Jul 2012 at 4:31

GoogleCodeExporter commented 9 years ago
You can try out this new version from the grabber script that reconnect to the 
database and send you emails if the database is a longer time away

https://code.google.com/p/measureit/source/browse/trunk/measureit_system_files/p
ython/data-input.py

new folder
https://code.google.com/p/measureit/source/browse/trunk/measureit_system_files/p
ython/simplemail
https://code.google.com/p/measureit/source/browse/trunk/measureit_system_files/p
ython/simplemail/__init__.py

Please give me some feedback if this will help

Original comment by lalelu...@gmail.com on 30 Jul 2012 at 3:44

GoogleCodeExporter commented 9 years ago
Doesn't work for me.

TypeError: 'reconnect' is an invalid keyword argument for this function

Original comment by sloth...@gmail.com on 3 Aug 2012 at 12:44

GoogleCodeExporter commented 9 years ago
sorry, but after 30min of tests.. the new data-input.py do not recieve any 
datas :'( (i tested with debug=True)
i switched several time from the original script (112) to the trunk ... 

with the 112 :

<msg><src>CC128-v1.29</src><dsb>00534</dsb><time>01:51:28</time><tmpr>20.1</tmpr
><sensor>0</sensor><id>00077</id><type>1</type><ch1><watts>02473</watts></ch1></
msg>

<msg><src>CC128-v1.29</src><dsb>00534</dsb><time>01:51:35</time><tmpr>20.1</tmpr
><sensor>0</sensor><id>00077</id><type>1</type><ch1><watts>02535</watts></ch1></
msg>

<msg><src>CC128-v1.29</src><dsb>00534</dsb><time>01:51:41</time><tmpr>20.1</tmpr
><sensor>0</sensor><id>00077</id><type>1</type><ch1><watts>03846</watts></ch1></
msg>

<msg><src>CC128-v1.29</src><dsb>00534</dsb><time>01:52:07</time><tmpr>20.1</tmpr
><sensor>0</sensor><id>00077</id><type>1</type><ch1><watts>02453</watts></ch1></
msg>

with trunk:

nothing is displayed

Original comment by smaucourt on 29 Dec 2012 at 1:31

GoogleCodeExporter commented 9 years ago
i tried this script because after several hours (36hours last time), the datas 
are not updated. So I watch if the script is allready launched (the first time 
no, the last time yes). after a kill and a launch, everything is going good.
my mysql server is hosted on localhost.

Original comment by smaucourt on 29 Dec 2012 at 1:36

GoogleCodeExporter commented 9 years ago
Oops my mistake ttyUSB1 for me 

Original comment by smaucourt on 29 Dec 2012 at 9:24

GoogleCodeExporter commented 9 years ago
Mysql connection problems are solved in version 113 you will found in the 
downloads

Original comment by lalelu...@gmail.com on 17 Feb 2013 at 12:50