mycontroller-org / mycontroller-v1-legacy

The Open Source Controller
http://www.MyController.org
Apache License 2.0
148 stars 90 forks source link

InfluxDB and Grafana #451

Closed Avamander closed 6 years ago

Avamander commented 6 years ago

Could you please add support for InfluxDB for storing sensor readings and the possibility of using Grafana inside mycontroller dashboards?

njbuch commented 6 years ago

I am forwarding all sensor readings to influxdb and have separate Grafana dashboards. But not in the mycontroller dashboards directly though.

jkandasa commented 6 years ago

@Avamander we have an option to select InfuxDB as metric engine. When we select influxDB as metric engine all the metric data will be moved to influxDB. Will not be stored in internal db.

You may add grafana dashboard as iframe in MyController Dashboard.

image

Avamander commented 6 years ago

Thank you for providing that information and I'm definitely going to use it but it would be really nice to have built-in integration.

Avamander commented 6 years ago

I tried switching to InfluxDB the way you described but MyController just froze, as I didn't care about the data (yet) I just created a new postgres database and switched with that. It seemed to work but I can't see any sensor readings in the influxdb database, do I have to do anything else?

jkandasa commented 6 years ago

@Avamander Can you post or email [jkandasa at gmail dot com] your influx db settings?

Avamander commented 6 years ago

@jkandasa InfluxDB config (removed every line that was commented out, it's basically the default except HTTP is enabled):

[meta]
  dir = "/var/lib/influxdb/meta"

[data]
  dir = "/var/lib/influxdb/data"
  wal-dir = "/var/lib/influxdb/wal"

[http]
  enabled = true
  bind-address = ":8086"

I googled around a bit and someone wrote that I have to add an external server, but that fails with the stacktrace below:

2018-05-25 04:04:20,188 ERROR [Acme.Utils.ThreadPool(1)-PooledThread: Acme.Serve.Serve$ServeConnection@81f92b] [org.mycontroller.standalone.db.dao.BaseAbstractDaoImpl:247] unable to add new item:[ExternalServerTable(id=null, type=INFLUXDB, enabled=true, name=InfluxDB, keyFormat=$nodeEui_$sensorId_$variableType, properties={database=mycontroller, password=mycontroller, alpCase=DEFAULT, trustHostType=Any, url=http://localhost:8086, username=mycontroller, tags=null})]
org.postgresql.util.PSQLException: ERROR: relation "externalserver_id_seq" does not exist
  Position: 16
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2458)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2158)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:171)
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:119)
    at com.j256.ormlite.jdbc.JdbcDatabaseConnection.queryForOne(JdbcDatabaseConnection.java:304)
    at com.j256.ormlite.jdbc.JdbcDatabaseConnection.queryForLong(JdbcDatabaseConnection.java:235)
    at com.j256.ormlite.jdbc.JdbcDatabaseConnection.queryForLong(JdbcDatabaseConnection.java:229)
    at com.j256.ormlite.stmt.mapped.MappedCreate.assignSequenceId(MappedCreate.java:239)
    at com.j256.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:52)
    at com.j256.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:458)
    at com.j256.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:328)
    at org.mycontroller.standalone.db.dao.BaseAbstractDaoImpl.create(BaseAbstractDaoImpl.java:244)
    at org.mycontroller.standalone.externalserver.ExternalServerFactory.add(ExternalServerFactory.java:159)
    at org.mycontroller.standalone.api.ExternalServerApi.add(ExternalServerApi.java:86)
    at org.mycontroller.standalone.api.jaxrs.ExternalServerHandler.addExternalServer(ExternalServerHandler.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236)
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395)
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)
    at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
    at org.jboss.resteasy.plugins.server.tjws.TJWSServletDispatcher.service(TJWSServletDispatcher.java:40)
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2328)
    at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2282)
    at Acme.Serve.Serve$ServeConnection.run(Serve.java:2054)
    at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1402)
    at java.lang.Thread.run(Thread.java:748)
jkandasa commented 6 years ago

@Avamander Sorry for the late response. If you still looking solution for this issue, looks like some table sequence creation missing in your database. Are you using H2DB or some other SQL database with MyController?

Avamander commented 6 years ago

@jkandasa I am using PostgreSQL.

jkandasa commented 6 years ago

@Avamander I have added a fix in the SNAPSHOT version. Kindly check it and report back. Thanks!

Avamander commented 6 years ago

@jkandasa I tried getting MyController running again but it doesn't seem to like the mesh I've built in the time between (no clue what's that about) as I decided to use Home Assistant then OpenHab and then Domoticz to get this thing working. So I can't tell if your fix actually worked, but I didn't at least get that stacktrace any longer. Will try to investigate where the issue is.

Avamander commented 6 years ago

Here's the stacktrace(s):

2018-07-08 21:04:14,591 ERROR [mc-th-pool-0] [org.mycontroller.standalone.provider.EngineAbstract:261] Throws exception while processing!, [MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Log message, ack=0, payload=16679861 TSF:MSG:READ,5-5-0,s=11,c=1,t=0,pt=7,l=5,sg=0:21.81, isTxMessage=false, timestamp=1531073053613, properties=null)]
java.util.concurrent.RejectedExecutionException: Task org.mycontroller.standalone.provider.ResourcesLogger@16f39d3 rejected from java.util.concurrent.ThreadPoolExecutor@8bc436[Running, pool size = 70, active threads = 70, queued tasks = 100, completed tasks = 30952]
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
    at org.mycontroller.standalone.McThreadPoolFactory.execute(McThreadPoolFactory.java:52)
    at org.mycontroller.standalone.provider.ExecuterAbstract.execute(ExecuterAbstract.java:129)
    at org.mycontroller.standalone.provider.EngineAbstract.auditQueue(EngineAbstract.java:256)
    at org.mycontroller.standalone.provider.EngineAbstract.run(EngineAbstract.java:131)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-08 21:04:14,598 ERROR [mc-th-pool-0] [org.mycontroller.standalone.provider.EngineAbstract:261] Throws exception while processing!, [MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Log message, ack=0, payload=16679867 TSF:MSG:ACK REQ, isTxMessage=false, timestamp=1531073053617, properties=null)]
java.util.concurrent.RejectedExecutionException: Task org.mycontroller.standalone.provider.ResourcesLogger@150cf8d rejected from java.util.concurrent.ThreadPoolExecutor@8bc436[Running, pool size = 70, active threads = 70, queued tasks = 100, completed tasks = 30952]
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
    at org.mycontroller.standalone.McThreadPoolFactory.execute(McThreadPoolFactory.java:52)
    at org.mycontroller.standalone.provider.ExecuterAbstract.execute(ExecuterAbstract.java:129)
    at org.mycontroller.standalone.provider.EngineAbstract.auditQueue(EngineAbstract.java:256)
    at org.mycontroller.standalone.provider.EngineAbstract.run(EngineAbstract.java:131)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-08 21:04:14,605 ERROR [mc-th-pool-0] [org.mycontroller.standalone.provider.EngineAbstract:261] Throws exception while processing!, [MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Log message, ack=0, payload=16679899 !TSF:MSG:SEND,0-0-5-5,s=11,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=NACK:21.81, isTxMessage=false, timestamp=1531073053651, properties=null)]
java.util.concurrent.RejectedExecutionException: Task org.mycontroller.standalone.provider.ResourcesLogger@161b91a rejected from java.util.concurrent.ThreadPoolExecutor@8bc436[Running, pool size = 70, active threads = 70, queued tasks = 100, completed tasks = 30952]
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
    at org.mycontroller.standalone.McThreadPoolFactory.execute(McThreadPoolFactory.java:52)
    at org.mycontroller.standalone.provider.ExecuterAbstract.execute(ExecuterAbstract.java:129)
    at org.mycontroller.standalone.provider.EngineAbstract.auditQueue(EngineAbstract.java:256)
    at org.mycontroller.standalone.provider.EngineAbstract.run(EngineAbstract.java:131)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-08 21:04:14,621 ERROR [mc-th-pool-0] [org.mycontroller.standalone.provider.EngineAbstract:261] Throws exception while processing!, [MessageImpl(gatewayId=1, nodeEui=5, sensorId=11, type=Set, subType=Temperature, ack=0, payload=21.81, isTxMessage=false, timestamp=1531073053654, properties=null)]
java.util.concurrent.RejectedExecutionException: Task org.mycontroller.standalone.provider.ExecuteMessageDependentTask@34f77 rejected from java.util.concurrent.ThreadPoolExecutor@8bc436[Running, pool size = 70, active threads = 70, queued tasks = 100, completed tasks = 30952]
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
    at org.mycontroller.standalone.McThreadPoolFactory.execute(McThreadPoolFactory.java:52)
    at org.mycontroller.standalone.provider.ExecuterAbstract.executeDependentTask(ExecuterAbstract.java:630)
    at org.mycontroller.standalone.provider.ExecuterAbstract.executeSet(ExecuterAbstract.java:370)
    at org.mycontroller.standalone.provider.ExecuterAbstract.execute(ExecuterAbstract.java:101)
    at org.mycontroller.standalone.provider.EngineAbstract.auditQueue(EngineAbstract.java:256)
    at org.mycontroller.standalone.provider.EngineAbstract.run(EngineAbstract.java:131)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Avamander commented 6 years ago

But it seems certain values do end up in influxdb, I'm just not sure if all of them.

Avamander commented 6 years ago

Okay now I'm getting a new stacktrace and all nodes are offline.

2018-07-09 01:10:54,498 WARN [mc-th-pool-0] [org.mycontroller.standalone.offheap.MessageQueueImpl:72] There is no message in the queue, returning null
2018-07-09 01:10:54,498 ERROR [mc-th-pool-0] [org.mycontroller.standalone.provider.EngineAbstract:261] Throws exception while processing!, [null]
java.lang.NullPointerException: null
    at org.mycontroller.standalone.provider.EngineAbstract.auditQueue(EngineAbstract.java:199)
    at org.mycontroller.standalone.provider.EngineAbstract.run(EngineAbstract.java:131)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-09 01:10:54,500 WARN [mc-th-pool-0] [org.mycontroller.standalone.offheap.MessageQueueImpl:72] There is no message in the queue, returning null
2018-07-09 01:10:54,500 ERROR [mc-th-pool-0] [org.mycontroller.standalone.provider.EngineAbstract:261] Throws exception while processing!, [null]
java.lang.NullPointerException: null
    at org.mycontroller.standalone.provider.EngineAbstract.auditQueue(EngineAbstract.java:199)
    at org.mycontroller.standalone.provider.EngineAbstract.run(EngineAbstract.java:131)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-09 01:10:54,501 WARN [mc-th-pool-0] [org.mycontroller.standalone.offheap.MessageQueueImpl:72] There is no message in the queue, returning null
2018-07-09 01:10:54,502 ERROR [mc-th-pool-0] [org.mycontroller.standalone.provider.EngineAbstract:261] Throws exception while processing!, [null]
java.lang.NullPointerException: null
    at org.mycontroller.standalone.provider.EngineAbstract.auditQueue(EngineAbstract.java:199)
    at org.mycontroller.standalone.provider.EngineAbstract.run(EngineAbstract.java:131)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-09 01:10:54,503 WARN [mc-th-pool-0] [org.mycontroller.standalone.offheap.MessageQueueImpl:72] There is no message in the queue, returning null

And this stacktrace repeats in the logs all the time.

jkandasa commented 6 years ago

@Avamander can you send complete mycontroller/logs/mycontroller.log to my email address? jkandasa at gmail dot com. can you list hardware configuration of the server? If it is a Linux, have you enabled desktop?

Avamander commented 6 years ago

@jkandasa Done, sent you the logs. The controller is a standard rPI 3B. The installation does not contain an X server.

jkandasa commented 6 years ago

@Avamander I have added some update to avoid null exception. However, I do not put any change for

java.util.concurrent.RejectedExecutionException: Task org.mycontroller.standalone.provider.ResourcesLogger@16f39d3 rejected from java.util.concurrent.ThreadPoolExecutor@8bc436[Running, pool size = 70, active threads = 70, queued tasks = 100, completed tasks = 30952]

I believe due to some influxdb write latency it takes time to complete existing thread.

Kindly check it in SNAPSHOT version and report me the status. Thank you for your patience!

Avamander commented 6 years ago

@jkandasa Thank you for your work!

How many messages will be sent to MyController from your network/hardware per second or minute?

About 80 per minute. I tested the same setup with OpenHAB2 so InfluxDB most certainly can handle it (OpenHAB2 had other issues though, that's why I'm not using it).

How many messages will be sent to influxdb from MyController per second or minute?

As far as I know, all of them should be sent?

Will test the new version out now.

Avamander commented 6 years ago

It would be nice if mycontroller allowed setting log file location that's displayed in the webui, currently it's hardcoded in McServerFileUtils.java to ../logs/. But it's not urgent, it doesn't break logging.

    private static final String LOG_FILE_LOCATION = "../logs/";
    private static File appLogFile = FileUtils.getFile("../logs/mycontroller.log");
Avamander commented 6 years ago

When the serial gateway is disabled I'm getting no errors in the log, but if it's enabled the entire log fills with:

2018-07-11 14:26:32,917 WARN [mc-th-pool-1] [org.mycontroller.standalone.offheap.MessageQueueImpl:73] There is no message in the queue, but counter value:1, returning null
2018-07-11 14:26:33,015 WARN [mc-th-pool-1] [org.mycontroller.standalone.offheap.MessageQueueImpl:73] There is no message in the queue, but counter value:1, returning null
2018-07-11 14:26:33,019 WARN [mc-th-pool-1] [org.mycontroller.standalone.offheap.MessageQueueImpl:73] There is no message in the queue, but counter value:1, returning null
2018-07-11 14:26:33,027 WARN [mc-th-pool-1] [org.mycontroller.standalone.offheap.MessageQueueImpl:73] There is no message in the queue, but counter value:1, returning null
2018-07-11 14:26:33,031 WARN [mc-th-pool-1] [org.mycontroller.standalone.offheap.MessageQueueImpl:73] There is no message in the queue, but counter value:1, returning null
Avamander commented 6 years ago

I switched everything to DEBUG level of logging and sent you the generated log file, hope that helps a bit.

jkandasa commented 6 years ago

@Avamander Thank you! Can you perform the following action and send me the server log?

Avamander commented 6 years ago

I sent you the logs. It seems that it worked, the nodes now connected. Thanks a lot!

jkandasa commented 6 years ago

@Avamander That's great! Do you see entries in influxdb properly?

jkandasa commented 6 years ago

@Avamander Added fix for dynamic log location and reset mycontroller/conf/persistent_stores/mc, if the following lines are true in mycontroller.properties,

mcc.clear.message.queue.on.start=true
mcc.clear.smart.sleep.msg.queue.on.start=true

All the changes are available in the SNAPSHOT version

Avamander commented 6 years ago

@jkandasa It stores a bit of data and then it starts to time out:

2018-07-11 17:42:12,916 INFO [main] [org.mycontroller.standalone.db.DataBaseUtils:117] Checking migration...
2018-07-11 17:42:18,237 INFO [main] [org.mycontroller.standalone.db.DataBaseUtils:168] Application information: [Version:1.3.0-SNAPSHOT, Database(type:PostgreSQL, version:PostgreSQL 9.6.7 on armv7l-unknown-linux-gnueabihf, compiled by gcc (Raspbian 6.3.0-18+rpi1) 6.3.0 20170516, 32-bit, schema version:1.04.03 - 2018 Jul 01), Built on:2018-07-11T14:56:46+0530, Git commit:070315a5e73329747808ce8333f72c89dd8486a3:development]
2018-07-11 17:42:23,966 WARN [main] [io.moquette.persistence.mapdb.MapDBPersistentStore:78] Using fresh MapDB store file. Path=../conf/persistent_stores/moquette/moquette_store.mapdb
2018-07-11 17:42:25,064 WARN [main] [io.moquette.server.Server:186] Using default SSL context creator
2018-07-11 17:42:25,939 WARN [main] [io.netty.bootstrap.ServerBootstrap:146] Unknown channel option 'TCP_NODELAY' for channel '[id: 0x6c22376a]'
2018-07-11 17:42:26,125 WARN [main] [io.netty.bootstrap.ServerBootstrap:146] Unknown channel option 'TCP_NODELAY' for channel '[id: 0xf00ac322]'
2018-07-11 17:42:26,132 INFO [main] [org.mycontroller.standalone.mqttbroker.MoquetteMqttBroker:54] MQTT Broker started successfully. MqttBrokerSettings(enabled=true, sslEnabled=false, bindAddress=0.0.0.0, mqttPort=1883, mqttsPort=8883, websocketPort=7080, allowAnonymous=false, enabledOnBackend=true, sslKeystoreFile=null)
2018-07-11 17:42:31,666 ERROR [Thread-4] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:176] Exception, 
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[AD,3-3-0,s=7,c=1,t=37,pt=3,l=2,sg=0:147], gatewayId:1
    at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)
    at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)
    at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)
    at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)
    at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
    at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
    at java.lang.Thread.run(Thread.java:748)
2018-07-11 17:42:31,710 ERROR [Thread-4] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:181] Exception, 
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[AD,3-3-0,s=7,c=1,t=37,pt=3,l=2,sg=0:147], gatewayId:1
    at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)
    at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)
    at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)
    at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)
    at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
    at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
    at java.lang.Thread.run(Thread.java:748)
2018-07-11 17:42:34,748 INFO [main] [org.mycontroller.standalone.StartApp:217] TJWS server started successfully, HTTPS Enabled?:true, HTTP(S) Port: [8443]
2018-07-11 17:42:35,304 INFO [main] [org.mycontroller.standalone.StartApp:114] MyController.org server started in [22631] ms
2018-07-11 17:45:01,484 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=0, isTxMessage=false, timestamp=1531320163630, properties=null)
2018-07-11 17:45:01,587 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=1, isTxMessage=false, timestamp=1531320163631, properties=null)
2018-07-11 17:47:51,650 ERROR [mc-th-pool-7] [org.mycontroller.restclient.core.RestHttpClient:252] Exception when calling url:[http://localhost:8086/write], headers:[{Authorization=Basic bXljb250cm9sbGVyOm15Y29udHJvbGxlcg==, User-Agent=Mozilla/5.0, Content-Type=application/json}], queryParameters:[{db=mycontroller}]
java.lang.RuntimeException: Did not match with expected response code[204], RestHttpResponse(uri=http://localhost:8086/write?db=mycontroller, entity={"error":"timeout"}
, responseCode=500, headers=[Content-Type: application/json, Request-Id: 5d0a3c4a-8519-11e8-8ae8-000000000000, X-Influxdb-Build: OSS, X-Influxdb-Error: timeout, X-Influxdb-Version: 1.5.2, X-Request-Id: 5d0a3c4a-8519-11e8-8ae8-000000000000, Date: Wed, 11 Jul 2018 14:47:51 GMT, Content-Length: 20], exception=null)
    at org.mycontroller.restclient.core.RestHttpClient.validateResponse(RestHttpClient.java:339)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:249)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:271)
    at org.mycontroller.restclient.influxdb.InfluxDBClient.write(InfluxDBClient.java:117)
    at org.mycontroller.standalone.metrics.engine.MetricEngineInfluxDB.post(MetricEngineInfluxDB.java:124)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.executeDependentTask(ExecuteMessageDependentTask.java:59)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.run(ExecuteMessageDependentTask.java:78)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-11 17:47:51,657 ERROR [mc-th-pool-7] [org.mycontroller.standalone.provider.ExecuteMessageDependentTask:80] Exception on executing SensorVariable(id=22, sensor=Sensor(id=21, sensorId=2, type=null, name=null, lastSeen=1531320411319, node=Node(id=3, eui=5, gatewayTable=GatewayTable(id=1, enabled=true, name=MySensors, networkType=MY_SENSORS, timestamp=1531073965452, state=UP, statusMessage=Connected Successfully, statusSince=1531320152475, type=SERIAL, properties={br=115200, ackEnabled=true, txDelay=0, ackWaitTime=0, failedRetryCount=5, reconnectDelay=120, dr=Auto, pn=/dev/ttyUSB0}), name=Roduuks, version=0.0, type=S_ARDUINO_NODE, libVersion=2.2.0, batteryLevel=null, eraseConfig=null, firmware=null, state=UP, lastSeen=1531320454395, rssi=null, properties={hbTx=1531318462573}, parentNodeEui=null, registrationState=REGISTERED, smartSleepEnabled=false), room=Room(id=2, name=Rõdu, description=null, parentId=null, icon=null, fullPath=Rõdu), variableTypes=[Level]), variableType=V_LEVEL, metricType=DOUBLE, timestamp=1531320196161, value=29, previousValue=29, unitType=U_NONE, readOnly=false, offset=0.0, priority=100, properties={marginRight=20, color=#ff7f0e, interpolate=linear, subType=line, marginBottom=60, useGlobal=true, type=lineChart, marginTop=5, marginLeft=65})
java.lang.RuntimeException: Failed to execute, url:http://localhost:8086/write, error:Did not match with expected response code[204], RestHttpResponse(uri=http://localhost:8086/write?db=mycontroller, entity={"error":"timeout"}
, responseCode=500, headers=[Content-Type: application/json, Request-Id: 5d0a3c4a-8519-11e8-8ae8-000000000000, X-Influxdb-Build: OSS, X-Influxdb-Error: timeout, X-Influxdb-Version: 1.5.2, X-Request-Id: 5d0a3c4a-8519-11e8-8ae8-000000000000, Date: Wed, 11 Jul 2018 14:47:51 GMT, Content-Length: 20], exception=null)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:255)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:271)
    at org.mycontroller.restclient.influxdb.InfluxDBClient.write(InfluxDBClient.java:117)
    at org.mycontroller.standalone.metrics.engine.MetricEngineInfluxDB.post(MetricEngineInfluxDB.java:124)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.executeDependentTask(ExecuteMessageDependentTask.java:59)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.run(ExecuteMessageDependentTask.java:78)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-11 17:49:39,062 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=0, isTxMessage=false, timestamp=1531320197063, properties=null)
2018-07-11 17:49:39,145 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=1, isTxMessage=false, timestamp=1531320197065, properties=null)
2018-07-11 17:52:34,924 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=0, isTxMessage=false, timestamp=1531320222717, properties=null)
2018-07-11 17:52:35,050 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=1, isTxMessage=false, timestamp=1531320222719, properties=null)
2018-07-11 17:52:51,827 ERROR [mc-th-pool-1] [org.mycontroller.restclient.core.RestHttpClient:252] Exception when calling url:[http://localhost:8086/write], headers:[{Authorization=Basic bXljb250cm9sbGVyOm15Y29udHJvbGxlcg==, User-Agent=Mozilla/5.0, Content-Type=application/json}], queryParameters:[{db=mycontroller}]
java.lang.RuntimeException: Did not match with expected response code[204], RestHttpResponse(uri=http://localhost:8086/write?db=mycontroller, entity={"error":"timeout"}
, responseCode=500, headers=[Content-Type: application/json, Request-Id: 0ff64878-851a-11e8-8c32-000000000000, X-Influxdb-Build: OSS, X-Influxdb-Error: timeout, X-Influxdb-Version: 1.5.2, X-Request-Id: 0ff64878-851a-11e8-8c32-000000000000, Date: Wed, 11 Jul 2018 14:52:51 GMT, Content-Length: 20], exception=null)
    at org.mycontroller.restclient.core.RestHttpClient.validateResponse(RestHttpClient.java:339)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:249)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:271)
    at org.mycontroller.restclient.influxdb.InfluxDBClient.write(InfluxDBClient.java:117)
    at org.mycontroller.standalone.metrics.engine.MetricEngineInfluxDB.post(MetricEngineInfluxDB.java:124)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.executeDependentTask(ExecuteMessageDependentTask.java:59)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.run(ExecuteMessageDependentTask.java:78)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-11 17:52:51,828 ERROR [mc-th-pool-1] [org.mycontroller.standalone.provider.ExecuteMessageDependentTask:80] Exception on executing SensorVariable(id=1, sensor=Sensor(id=1, sensorId=0, type=S_AIR_QUALITY, name=Gas sensor, lastSeen=1531320750287, node=Node(id=2, eui=3, gatewayTable=GatewayTable(id=1, enabled=true, name=MySensors, networkType=MY_SENSORS, timestamp=1531073965452, state=UP, statusMessage=Connected Successfully, statusSince=1531320152475, type=SERIAL, properties={br=115200, ackEnabled=true, txDelay=0, ackWaitTime=0, failedRetryCount=5, reconnectDelay=120, dr=Auto, pn=/dev/ttyUSB0}), name=Gassensor, version=0.0, type=S_ARDUINO_REPEATER_NODE, libVersion=2.2.0, batteryLevel=null, eraseConfig=null, firmware=null, state=UP, lastSeen=1531320757543, rssi=null, properties={hbTx=1531320461208}, parentNodeEui=null, registrationState=REGISTERED, smartSleepEnabled=false), room=Room(id=1, name=Magamistuba, description=null, parentId=null, icon=null, fullPath=Magamistuba), variableTypes=[Level]), variableType=V_LEVEL, metricType=DOUBLE, timestamp=1531320224416, value=19, previousValue=19, unitType=U_NONE, readOnly=false, offset=0.0, priority=100, properties={marginRight=20, color=#ff7f0e, interpolate=linear, subType=line, marginBottom=60, useGlobal=true, type=lineChart, marginTop=5, marginLeft=65})
java.lang.RuntimeException: Failed to execute, url:http://localhost:8086/write, error:Did not match with expected response code[204], RestHttpResponse(uri=http://localhost:8086/write?db=mycontroller, entity={"error":"timeout"}
, responseCode=500, headers=[Content-Type: application/json, Request-Id: 0ff64878-851a-11e8-8c32-000000000000, X-Influxdb-Build: OSS, X-Influxdb-Error: timeout, X-Influxdb-Version: 1.5.2, X-Request-Id: 0ff64878-851a-11e8-8c32-000000000000, Date: Wed, 11 Jul 2018 14:52:51 GMT, Content-Length: 20], exception=null)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:255)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:271)
    at org.mycontroller.restclient.influxdb.InfluxDBClient.write(InfluxDBClient.java:117)
    at org.mycontroller.standalone.metrics.engine.MetricEngineInfluxDB.post(MetricEngineInfluxDB.java:124)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.executeDependentTask(ExecuteMessageDependentTask.java:59)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.run(ExecuteMessageDependentTask.java:78)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-11 17:56:04,914 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=0, isTxMessage=false, timestamp=1531320252683, properties=null)
2018-07-11 17:56:04,981 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=1, isTxMessage=false, timestamp=1531320252684, properties=null)
2018-07-11 17:58:03,940 ERROR [mc-th-pool-6] [org.mycontroller.restclient.core.RestHttpClient:252] Exception when calling url:[http://localhost:8086/write], headers:[{Authorization=Basic bXljb250cm9sbGVyOm15Y29udHJvbGxlcg==, User-Agent=Mozilla/5.0, Content-Type=application/json}], queryParameters:[{db=mycontroller}]
java.lang.RuntimeException: Did not match with expected response code[204], RestHttpResponse(uri=http://localhost:8086/write?db=mycontroller, entity={"error":"timeout"}
, responseCode=500, headers=[Content-Type: application/json, Request-Id: c9fe9342-851a-11e8-8d6a-000000000000, X-Influxdb-Build: OSS, X-Influxdb-Error: timeout, X-Influxdb-Version: 1.5.2, X-Request-Id: c9fe9342-851a-11e8-8d6a-000000000000, Date: Wed, 11 Jul 2018 14:58:03 GMT, Content-Length: 20], exception=null)
    at org.mycontroller.restclient.core.RestHttpClient.validateResponse(RestHttpClient.java:339)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:249)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:271)
    at org.mycontroller.restclient.influxdb.InfluxDBClient.write(InfluxDBClient.java:117)
    at org.mycontroller.standalone.metrics.engine.MetricEngineInfluxDB.post(MetricEngineInfluxDB.java:124)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.executeDependentTask(ExecuteMessageDependentTask.java:59)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.run(ExecuteMessageDependentTask.java:78)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-11 17:58:03,943 ERROR [mc-th-pool-6] [org.mycontroller.standalone.provider.ExecuteMessageDependentTask:80] Exception on executing SensorVariable(id=10, sensor=Sensor(id=10, sensorId=9, type=S_AIR_QUALITY, name=Gas sensor, lastSeen=1531321036867, node=Node(id=2, eui=3, gatewayTable=GatewayTable(id=1, enabled=true, name=MySensors, networkType=MY_SENSORS, timestamp=1531073965452, state=UP, statusMessage=Connected Successfully, statusSince=1531320152475, type=SERIAL, properties={br=115200, ackEnabled=true, txDelay=0, ackWaitTime=0, failedRetryCount=5, reconnectDelay=120, dr=Auto, pn=/dev/ttyUSB0}), name=Gassensor, version=0.0, type=S_ARDUINO_REPEATER_NODE, libVersion=2.2.0, batteryLevel=null, eraseConfig=null, firmware=null, state=UP, lastSeen=1531321060124, rssi=null, properties={hbTx=1531320461208}, parentNodeEui=null, registrationState=REGISTERED, smartSleepEnabled=false), room=Room(id=1, name=Magamistuba, description=null, parentId=null, icon=null, fullPath=Magamistuba), variableTypes=[Level]), variableType=V_LEVEL, metricType=DOUBLE, timestamp=1531320268992, value=140, previousValue=140, unitType=U_NONE, readOnly=false, offset=0.0, priority=100, properties={marginRight=20, color=#ff7f0e, interpolate=linear, subType=line, marginBottom=60, useGlobal=true, type=lineChart, marginTop=5, marginLeft=65})
java.lang.RuntimeException: Failed to execute, url:http://localhost:8086/write, error:Did not match with expected response code[204], RestHttpResponse(uri=http://localhost:8086/write?db=mycontroller, entity={"error":"timeout"}
, responseCode=500, headers=[Content-Type: application/json, Request-Id: c9fe9342-851a-11e8-8d6a-000000000000, X-Influxdb-Build: OSS, X-Influxdb-Error: timeout, X-Influxdb-Version: 1.5.2, X-Request-Id: c9fe9342-851a-11e8-8d6a-000000000000, Date: Wed, 11 Jul 2018 14:58:03 GMT, Content-Length: 20], exception=null)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:255)
    at org.mycontroller.restclient.core.RestHttpClient.doPost(RestHttpClient.java:271)
    at org.mycontroller.restclient.influxdb.InfluxDBClient.write(InfluxDBClient.java:117)
    at org.mycontroller.standalone.metrics.engine.MetricEngineInfluxDB.post(MetricEngineInfluxDB.java:124)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.executeDependentTask(ExecuteMessageDependentTask.java:59)
    at org.mycontroller.standalone.provider.ExecuteMessageDependentTask.run(ExecuteMessageDependentTask.java:78)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2018-07-11 17:59:08,560 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=0, isTxMessage=false, timestamp=1531320282648, properties=null)
2018-07-11 17:59:08,728 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=1, isTxMessage=false, timestamp=1531320282650, properties=null)
2018-07-11 18:02:04,080 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=0, isTxMessage=false, timestamp=1531320317893, properties=null)
2018-07-11 18:02:04,210 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=1, isTxMessage=false, timestamp=1531320317894, properties=null)
2018-07-11 18:04:52,738 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=0, isTxMessage=false, timestamp=1531320342579, properties=null)
2018-07-11 18:04:52,839 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=1, isTxMessage=false, timestamp=1531320342580, properties=null)
2018-07-11 18:14:29,594 WARN [mc-th-pool-0] [org.mycontroller.standalone.provider.ExecuterAbstract:175] Inclusion mode not supported by this controller! Message:MessageImpl(gatewayId=1, nodeEui=0, sensorId=SENSOR_BC, type=Internal, subType=Inclusion mode, ack=0, payload=1, isTxMessage=false, timestamp=1531320439571, properties=null)                                                                                                                                                                    
2018-07-11 18:16:33,351 ERROR [Thread-5] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:176] Exception,                                    
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[0;2D,5-5-0,s=14,c=1,t=11,pt=7,l=5,sg=0:635.00], gatewayId:1                    
        at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)                                                
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)                                                 
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)                                                 
        at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)                                     
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)                                                        
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)                                                                     
        at java.lang.Thread.run(Thread.java:748)                                                                                                                      
2018-07-11 18:16:35,605 ERROR [Thread-5] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:181] Exception, 
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[0;2D,5-5-0,s=14,c=1,t=11,pt=7,l=5,sg=0:635.00], gatewayId:1
        at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)
        at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
        at java.lang.Thread.run(Thread.java:748)
2018-07-11 18:16:35,618 ERROR [Thread-5] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:176] Exception, 
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[END,0-0-3-3,s=9,c=1,t=37,pt=3,l=2,sg=0,ft=0,st=OK:140], gatewayId:1
        at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)
        at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
        at java.lang.Thread.run(Thread.java:748)
2018-07-11 18:16:35,631 ERROR [Thread-5] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:176] Exception, 
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[ TSF:MSG:READ,3-3-0,s=2,c=1,t=37,pt=3,l=2,sg=0:16], gatewayId:1
        at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)
        at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
        at java.lang.Thread.run(Thread.java:748)
2018-07-11 18:16:35,643 ERROR [Thread-5] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:176] Exception, 
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[9;266121392 TSF:MSG:SEND,0-0-3-3,s=7,c=1,t=37,pt=3,l=2,sg=0,ft=0,st=OK:261], gatewayId:1
        at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)
        at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
        at java.lang.Thread.run(Thread.java:748)
2018-07-11 18:16:40,318 ERROR [Thread-17] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:176] Exception, 
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[6124081 TSF:MSG:ACK REQ], gatewayId:1
        at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)
        at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
        at java.lang.Thread.run(Thread.java:748)
2018-07-11 18:16:40,332 ERROR [Thread-17] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:181] Exception, 
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[6124081 TSF:MSG:ACK REQ], gatewayId:1
        at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)
        at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
        at java.lang.Thread.run(Thread.java:748)
2018-07-11 18:18:38,161 ERROR [Thread-18] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:176] Exception, 
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[AD,3-3-0,s=0,c=1,t=37,pt=3,l=2,sg=0:19], gatewayId:1
        at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)
        at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
        at java.lang.Thread.run(Thread.java:748)
2018-07-11 18:18:38,185 ERROR [Thread-18] [org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm:181] Exception, 
org.mycontroller.standalone.exceptions.MessageParserException: Unknown message format:[AD,3-3-0,s=0,c=1,t=37,pt=3,l=2,sg=0:19], gatewayId:1
        at org.mycontroller.standalone.provider.mysensors.MessageParserAbstract.update(MessageParserAbstract.java:118)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:32)
        at org.mycontroller.standalone.provider.mysensors.MessageParserSerial.getMessage(MessageParserSerial.java:28)
        at org.mycontroller.standalone.gateway.serial.SerialDataListenerjSerialComm.serialEvent(SerialDriverJSerialComm.java:146)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener.waitForSerialEvent(SerialPort.java:937)
        at com.fazecast.jSerialComm.SerialPort$SerialPortEventListener$1.run(SerialPort.java:885)
        at java.lang.Thread.run(Thread.java:748)

It's so weird that it times out because manually inserting with curl works fine but mycontroller times out (doesn't store) at the same time.

Avamander commented 6 years ago

I reset what you asked again and I'm waiting for the logs to collect for a bit.

jkandasa commented 6 years ago

@Avamander what is the command used to insert manually with curl?

jkandasa commented 6 years ago

@Avamander

Added fix for dynamic log location and reset mycontroller/conf/persistent_stores/mc, if the following lines are true in mycontroller.properties,

Here I mentioned reset will happen automatically. No need to do manual reset. I try to say that, from now every time this directory will be removed on MyController restart(if both mcc.clear.* are enabled).

Sorry for the confusion :(

jkandasa commented 6 years ago

@Avamander Can you test influxdb as mentioned on this issue? https://github.com/influxdata/influxdb/issues/3349

Avamander commented 6 years ago

@jkandasa I used: curl -i -XPOST 'http://localhost:8086/write?db=mycontroller&u=mycontroller&p=mycontroller' --data-binary 'mc_resource_double,internal_id=2 value=1337' and I nicely see the value(s) in Grafana.

EDIT: Will stress test it shortly.

Avamander commented 6 years ago

Okay, so, I launched in parallel 8 of while :; do curl -i -XPOST 'http://localhost:8086/write?db=mydb&precision=ms' --data-binary "mc_resource_double,internal_id=2 value=$(date +%s)"; done with average request time of ~0,25s meaning at minimum a throughput of 32 readings/s which confirms how OpenHAB2 worked. Though a tiny amount of these requests take a bit longer and an ever tinier amount times out (one in a few hundred), those should be retried after a bit of time? I have a feeling this is caused by increased disk activity. But still, it doesn't explain why nothing ends up in the database.

Also, I have logged what was going on in mycontroller during the stress test you suggested. Will e-mail you the logs.

Avamander commented 6 years ago

After restarting it for the n-th time and checking the results it seems to me that indeed, high disk (meaning sd-card) activity causes influxdb and postgresql both have longer response times which causes workers to hang which causes no further readings end up in the database.

Maybe a forced, configurable, timeout to workers could help with that?

jkandasa commented 6 years ago

@Avamander

Maybe a forced, configurable, timeout to workers could help with that?

I will see possible options for this workers.

Meantime, Can you change the following settings will remove some of the performance hits,

Avamander commented 6 years ago

@jkandasa

I did all what you asked. Situation is still as it was before, after restart only a few readings (a bit more than before though) end up in the database and then nothing else gets added, manual insertion still works (and is fast).

jkandasa commented 6 years ago

@Avamander Thank you for the update. I make this setup locally and test it tonight.

Avamander commented 6 years ago

@jkandasa Did you succeed in reproducing or can I do something more to help diagnose the reason why values do not end up in the database after a while.

jkandasa commented 6 years ago

@Avamander I tested this with my laptop. I do not have Raspberry PI with me at this time. I tried to insert 10000 data into influxdb via MyController. Everything works great without any issue. In MyController side it takes around 60 seconds to insert everything.

Looks like you have some performance issue with your Raspberry PI.

If I get my Raspberry PI back by tomorrow, I will test this on my raspberry PI.

Avamander commented 6 years ago

@jkandasa That is for sure that it sometimes struggles. I kept mycontroller running for these few last days and it seems some values do end up in the database in addition to the initial ones after startup. About 10-20min worth of data ends up in the database and then there are no insertions for 40-120min.

But is there a way to list all the database workers and their status? Or a way to increase their count? I could probably compile it myself if needed.

jkandasa commented 6 years ago

@Avamander Yes you can change MAXIMUM_POOL_SIZE to any number that you want. Keep in mind when we increase this count, you may endup with out of memory issue. For now, MAXIMUM_POOL_SIZE = 70, https://github.com/mycontroller-org/mycontroller/blob/development/modules/core/src/main/java/org/mycontroller/standalone/McThreadPoolFactory.java#L36

I can propose another solution for you.

Avamander commented 6 years ago

@jkandasa Thank you again for spending time on this issue, it is very much appreciated. Will test out the alternative solution you proposed and report back.

Avamander commented 6 years ago

@jkandasa I am pretty sure I figured out the difference, please do correct me if I'm wrong, but mycontroller doesn't batch sensor readings while OpenHAB2 does, correct?

Also, here's a screenshot of sensor readings (graph just shows if any values are inserted) after applying what you suggested. Pretty big gaps.