[vz-users] Probleme mit MySQL bei der Einrichtung von volkszaehler auf meinem Raspi
Christian Schieb
christian.schieb at speed.at
Tue Sep 29 19:20:59 CEST 2015
Hallo,
habe Probleme vokszaehler zum Laufen zu bringen. Bekomme im vzlogger.log
beim Start die Fehlermeldung:
Sep 29 16:42:23][chn4] CURL Error from middleware: 'ConnectionException':
'An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
[Sep 29 16:42:23][chn0] CURL Error from middleware: 'ConnectionException':
'An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
[Sep 29 16:42:23][chn1] CURL Error from middleware: 'ConnectionException':
'An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
[Sep 29 16:42:23][chn2] CURL Error from middleware: 'ConnectionException':
'An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
[Sep 29 16:42:23][chn3] CURL Error from middleware: 'ConnectionException':
'An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
[Sep 29 16:42:23][chn5] CURL Error from middleware: 'ConnectionException':
'An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Bin nach Anleitung vorgegangen (mittlerweile bereits 2x durchgeführt):
- Image geladen und auf SD Card gespielt (32 GB SanDisk Class 10)
- Filesystem mit raspi-config expandiert
- Kanäle über UI angelegt, UUID notiert
- /etc/vzlogger.conf adaptiert (UUID eingetragen, nicht benötigte
Einträge gelöscht)
- /etc/rc.local adaptiert (GPIOs Kommentar wo benötigt entfernt)
- Shutdown mit reboot
Meine vzlogger.conf:
{
"retry": 0,
"daemon": true,
"verbosity": 0,
"log": "/var/log/vzlogger.log",
// "push": [],
"local": {
"enabled": false,
"port": 8080,
"index": false,
"timeout": 0,
"buffer": 0
},
"meters": [
{
"enabled": true,
"allowskip": false,
"interval": -1,
"aggtime": -1,
"aggfixedinterval": false,
"channels": [
{
"uuid": "15194330-66b6-11e5-975d-dfc6de45c7fb",
"identifier": "Impulse",
"api": "volkszaehler",
"middleware": "http://127.0.0.1/middleware.php",
"secretKey": "",
"type": "device",
"scaler": 1,
"aggmode": "none",
"duplicates": 0
}
],
"protocol": "s0",
"gpio": 4,
"resolution": 1000,
"configureGPIO": true,
"debounce_delay": 0
},
{
"enabled": true,
"allowskip": false,
"interval": -1,
"aggtime": -1,
"aggfixedinterval": false,
"channels": [
{
"uuid": "21a0a7f0-66b6-11e5-a026-c91b80914b21",
"identifier": "Impulse",
"api": "volkszaehler",
"middleware": "http://127.0.0.1/middleware.php",
"secretKey": "",
"type": "device",
"scaler": 1,
"aggmode": "none",
"duplicates": 0
}
],
"protocol": "s0",
"gpio": 18,
"resolution": 1000,
"configureGPIO": true,
"debounce_delay": 0
},
{
"enabled": true,
"allowskip": false,
"interval": -1,
"aggtime": -1,
"aggfixedinterval": false,
"channels": [
{
"uuid": "2ccae720-66b6-11e5-a425-8fecc2651c8d",
"identifier": "Impulse",
"api": "volkszaehler",
"middleware": "http://127.0.0.1/middleware.php",
"secretKey": "",
"type": "device",
"scaler": 1,
"aggmode": "none",
"duplicates": 0
}
],
"protocol": "s0",
"gpio": 17,
"resolution": 1000,
"configureGPIO": true,
"debounce_delay": 0
},
{
"enabled": true,
"allowskip": false,
"interval": -1,
"aggtime": -1,
"aggfixedinterval": false,
"channels": [
{
"uuid": "3c7f82e0-66b6-11e5-9e4d-fd87d2c035a3",
"identifier": "Impulse",
"api": "volkszaehler",
"middleware": "http://127.0.0.1/middleware.php",
"secretKey": "",
"type": "device",
"scaler": 1,
"aggmode": "none",
"duplicates": 0
}
],
"protocol": "s0",
"gpio": 23,
"resolution": 1000,
"configureGPIO": true,
"debounce_delay": 0
},
{
"enabled": true,
"allowskip": false,
"interval": -1,
"aggtime": -1,
"aggfixedinterval": false,
"channels": [
{
"uuid": "4ef1a2a0-66b6-11e5-a688-8d3650e43788",
"identifier": "Impulse",
"api": "volkszaehler",
"middleware": "http://localhost/middleware.php",
"secretKey": "",
"type": "device",
"scaler": 1,
"aggmode": "none",
"duplicates": 0
}
],
"protocol": "s0",
"gpio": 27,
"resolution": 1000,
"configureGPIO": true,
"debounce_delay": 0
},
{
"enabled": true,
"allowskip": false,
"interval": -1,
"aggtime": -1,
"aggfixedinterval": false,
"channels": [
{
"uuid": "58532640-66b6-11e5-bf9a-43de6275ba5f",
"identifier": "Impulse",
"api": "volkszaehler",
"middleware": "http://127.0.0.1/middleware.php",
"secretKey": "",
"type": "device",
"scaler": 1,
"aggmode": "none",
"duplicates": 0
}
],
"protocol": "s0",
"gpio": 22,
"resolution": 1000,
"configureGPIO": true,
"debounce_delay": 0
}
]
}
============================================================================
==================
Meine rc.local:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
# Part of DS2482 I2C 1-Wire Master to Volkszaehler 'RaspberryPI deamon'.
echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device
# echo ds2482 0x19 > /sys/bus/i2c/devices/i2c-1/new_device
# echo ds2482 0x1a > /sys/bus/i2c/devices/i2c-1/new_device
# Register I2C RTC, nur bei großer Erweiterung
echo ds1307 0x68 > /sys/bus/i2c/devices/i2c-1/new_device
# Part of S0/Impulse to Volkszaehler 'RaspberryPI deamon','s0vz', nur bei
alter große Erweiterung
#echo 17 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio17/edge
#echo 18 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio18/edge
# echo 22 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio22/edge
# echo 23 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio23/edge
# echo 24 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio24/edge
# echo 27 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio27/edge
# Part of S0/Impulse to Volkszaehler 'RaspberryPI deamon','s0vz_new', nur
bei neuer große Erweiterung
echo 4 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio4/edge
echo 18 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio18/edge
echo 17 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio17/edge
echo 23 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio23/edge
echo 27 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio27/edge
echo 22 > /sys/class/gpio/export && echo "rising" >
/sys/class/gpio/gpio22/edge
# GPIOs exportieren und Datenrichtung einstellen, 'Schaltausgang_new'
echo 24 > /sys/class/gpio/export
echo 25 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio24/direction
echo out > /sys/class/gpio/gpio25/direction
# GPIOs exportieren und Datenrichtung einstellen, 'Schaltausgang'
# echo 9 > /sys/class/gpio/export
# echo 11 > /sys/class/gpio/export
# echo out > /sys/class/gpio/gpio9/direction
# echo out > /sys/class/gpio/gpio11/direction
# 1wirevz starten
#/etc/init.d/1wirevz restart
#s0vz starten
#sudo s0vz
sudo s0vz_new
#vzlogger starten
sudo vzlogger -d
#Set Systemtime from RTC
sudo hwclock -s
exit 0
Hat jemand eine Idee woran es liegen könnte?
Ich vermute das es ein Berechtigungsproblem mit der DB gibt weiß aber
nicht welche Rechte wo und wie benötigt werden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://demo.volkszaehler.org/pipermail/volkszaehler-users/attachments/20150929/e3718f9c/attachment-0001.html>
More information about the volkszaehler-users
mailing list