Blynk server-0.38.1-java8.jar error with Postgresql

Hi guys !
I tried to upgrade to the new version and I got this error :

Not able connect to reporting DB. Skipping. Reason : Failed to initialize pool: FATAL: database “blynk_reporting” does not exist

The name of data base is blynk and that is also default one created with the create_schema.sql script, but the new version is requesting a different name : blynk_reporting.

Can you please fix that ?
Would it be better to set the database name in the server.properties file like other parameters ?

Thanks !

You need to extend your db.properties file with deaults (if you didn’t change them):

reporting.jdbc.url=jdbc:postgresql://localhost:5432/blynk_reporting?tcpKeepAlive=true&socketTimeout=150
reporting.user=test
reporting.password=test
reporting.connection.timeout.millis=30000

We recently split DB on 2 logical instance for further scaling.

Same problem for me but I cant find the db.properties file?

Updated installation instruction - https://github.com/blynkkk/blynk-server#enabling-raw-data-storage

Briefly: you need to create blynk_reporting DB in the same way you did to blynk DB.

Ok, updated installation instructions works perfect for me.

A little work on the Grafana side then its works perfect again. Thanks…

1 Like

Many Thanks indeed guys !
I have created the blynk_reporting database as per create_schema script and now it works with no errors :slight_smile:

I didn’t know anything about db.properties and it looks this is a new thing referring to my old version of local blynk server.
What I noticed is that server works even without it, but it looks that db.properties file open possibilities to configure manually database connection ports, ip addresses or java database connection drivers (I don’t know if I could use others apart Postgresql).

Another thing that I noticed is that in the new version (or maybe earlier than 0.38.1) the hardware plain port is merged with web socket port. I noticed that after upgrade where my arduino was searching default 8442, but new server doesn’t listen to that port even you have hardware.default.port=8442 in your server.properties file. That is merged with web socket port which should be specified with parameter http.port=xxxx (8080 default).
Maybe this is going to help other people in case they face the same problem as mine.

Thanks again for your great support !

Keep going Blynk !!!

1 Like

I installed grafana as well ,but I don’t know in which table I have to build the query to build a dashboard for sensors.
I would appreciate it too much if you could share your experience.
Thanks !

reporting raw data is which you search for. You can find it in blynk_reporting database.

Here is the result…

This is the query i used…

SELECT reporting_raw_data.doublevalue FROM public.reporting_raw_data WHERE device_id =(0) and pin=(7) ORDER BY ts DESC LIMIT 1

Many many thanks for your quick answer and clear ,straight on the subject answer ! !
I run successfully the first query on my reporting_raw_data as you suggested and it works great !!

I modified the query in a general form to be used from other people as well:

SELECT $__time(ts),reporting_raw_data.doublevalue FROM public.reporting_raw_data WHERE device_id = (put here the id of your device)0 and pin=(put here the pin number device from which you are reading the data from your device) ORDER BY ts DESC
example (credits to tsavasci) :smile:
SELECT $__time(ts),reporting_raw_data.doublevalue FROM public.reporting_raw_data WHERE device_id =0 and pin=7 ORDER BY ts DESC

1 Like

Hi, im running a Blynk Server 0.41.6 on a Raspberry Pi and it works awesome. For my application it is needed to have the raw data from the sensors.

I’ve followed the installation for Postgresql and I’ve created both DB and DB reporting and I get the same outputs as the guide shows. I’ve also added “db.properties” file as suggested.

When starting the server, “postgre.log” file gives this outputs:

I’ve tried many variations but no succes, thanks for any help.