Author Topic: WifiLogger to InfluxDB  (Read 1874 times)

0 Members and 1 Guest are viewing this topic.

Offline fjordey37

  • Member
  • *
  • Posts: 23
WifiLogger to InfluxDB
« on: March 29, 2022, 06:11:34 PM »
Has anyone had any experience in getting data from WifiLogger into an InfluxDB database...

I'm not coder, so writing any code is out of my league, with that said I'm good at following directions...

I do see the options for custom export, so my guess is there should be a way to have WifiLogger send that information to InfluxDB.

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5519
    • KomokaWeather
Re: WifiLogger to InfluxDB
« Reply #1 on: March 29, 2022, 07:35:03 PM »
Hi,
I have been updating the WiFiLogger realtime.txt and wflexp.json to my remote site once a minute.
http://www.komokaweather.com/wifi-console/realtime.txt
http://www.komokaweather.com/wifi-console/wflexp.json


I am not familiar with InfluxDB but I did have a script from another forum member that then imported the realtime.txt data into my GoDaddy MySQL DB every minute and that did work until I updated my GoDaddy hosting to cPanel and I haven't learned how to fix the script ](*,)






Enjoy,
Paul

Offline fjordey37

  • Member
  • *
  • Posts: 23
Re: WifiLogger to InfluxDB
« Reply #2 on: March 30, 2022, 10:33:36 AM »
I feel you Paul... I'm trying to watch videos on the and trying to craft something that will work... It just seems I'm going in circles... and kinda getting dizzy now...

my case is local NAS using docker containers, so in theory it should be simple. I'm sure I'm over thinking the process.

My thought is to have WifiLogger POST (json) to a database -  in theory  WifiLogger >>> Telegraf >>>> InfluxDB  >>> and Grafana (or similar to graph data)...
anyone with thoughts on this process please share...

Mark

Offline fjordey37

  • Member
  • *
  • Posts: 23
Re: WifiLogger to InfluxDB
« Reply #3 on: March 31, 2022, 04:26:11 PM »
Status update:  the direction I seem to be heading now it to send data to a MQTT broker and using telegraf send to InfluxDB...

I have the MQTT broker setup and receiving data from WifiLogger - and I can see telegraf connecting with the MQTT broker...
Yet I can not get any data into InfluxDB...

WifiLogger >>> mosquito (mqtt broker) >>> telegraf >>>> InfluxDB 

This is all running on an Unpaid NAS server - using docker containers for each piece of this... this needs to be kept this local...
I was able to get the raw output of the WifiLogger json file by reading through a thread from back in Jan 2020 "how to setup custom HTTP export"

I'm not sure if "only" the json can be sent, currently WL sends both the realtime.txt and json files together... I also not sure how the PHP&MySQL file structure is (binary/txt)... not sure if there is a way to view that in raw format like the json file...

-Mark

Offline WiFiLogger

  • Forecaster
  • *****
  • Posts: 733
Re: WifiLogger to InfluxDB
« Reply #4 on: April 01, 2022, 09:06:38 AM »
Has anyone had any experience in getting data from WifiLogger into an InfluxDB database...

I'm not coder, so writing any code is out of my league, with that said I'm good at following directions...

I do see the options for custom export, so my guess is there should be a way to have WifiLogger send that information to InfluxDB.

As a first step please check my solution PHP&MySQL.
http://wifilogger.net/wflsql/

Please try it. You can have all of those PHPs for free.

 [ You are not allowed to view attachments ]
 [ You are not allowed to view attachments ]

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5519
    • KomokaWeather
Re: WifiLogger to InfluxDB
« Reply #5 on: April 01, 2022, 10:41:48 AM »
Thanks Wojtek,
I often check that wflsql site, but learned a few new tricks you've pointed out \:D/


I am on v2.34 and downloaded v2.41.  Is it as simple as selecting Setup > System > Internet Firmware Update and [Update]?


Enjoy,
Paul

Offline WiFiLogger

  • Forecaster
  • *****
  • Posts: 733
Re: WifiLogger to InfluxDB
« Reply #6 on: April 01, 2022, 10:50:01 AM »
I am on v2.34 and downloaded v2.41.  Is it as simple as selecting Setup > System > Internet Firmware Update and [Update]?

Yes, but please make it twice.
1. Download 8 HTMLs and new firmware
2. New firmware will ask server for additional AirLink HTML. (old firmware did not know about AirLink)

Offline fjordey37

  • Member
  • *
  • Posts: 23
Re: WifiLogger to InfluxDB
« Reply #7 on: April 01, 2022, 12:51:58 PM »
Thanks Wojtek,

I like and tested for a bit - and really like - can that be done locally?
My purpose is to not rely on internet connectivity to do this (I need to keep this on my local network)...

I know some will say I can run windows and just use the Davis software, yet not an option since I use a MAC.
So the goal is to run a database on my NAS so it is accessible to me locally.

Mark

Offline WiFiLogger

  • Forecaster
  • *****
  • Posts: 733
Re: WifiLogger to InfluxDB
« Reply #8 on: April 01, 2022, 06:22:47 PM »
I like and tested for a bit - and really like - can that be done locally?

Today one person has foound issue with my custom export.
I  am always using port 80 for my exports functions.
Now it is known problem, so I will try to fix it with the next firmware.
If you will use standard port 80, then it should work locally.

My PHP&MySQL is perfect to export data from station to the server. Much better than FTP.
But the same you can have using WeatherLink.com.
When you generate free DID on WL.COM, then WiFiLogger will send data to WL.COM and you can use WeatherLink PC software to download archive data.

My solution PHP&MySQL is more powerfull if you need to sort and choose specific data from last months, or years. It is easy when you have data in your SQL database.  :grin:
It is very hard to operate on data from WL.COM, because you have no access to the server. You have to download all data from WL.COM, then you can sort it as you like.  :?
« Last Edit: April 01, 2022, 06:24:47 PM by WiFiLogger »

Offline fjordey37

  • Member
  • *
  • Posts: 23
Re: WifiLogger to InfluxDB
« Reply #9 on: November 27, 2022, 03:38:27 PM »
Just an update -
I gave up for a few months - and finally started back on this project -
My basic setup for sending to MQTT - is using PHP&MTSQL - (was trying Wflexp.json) as Wojtek had mentioned above - maybe the new FW 2.40 will work now with Wflexp.json now...

The part that was throwing me after figuring that out is telegraf was not working - what I had to do under "Inputs" section of the config is add this:
---
  [[inputs.mqtt_consumer.json_v2]]
    [[inputs.mqtt_consumer.json_v2.object]]
        path = "[@this]"
        timestamp_key = "tutc"
        timestamp_format = "unix"
---
and then almost like magic the data was flowing into InfluxDB
---
Maybe someone else has a different setup with telegraf please share...

I'm using Grafana to display the data -
Note this is all being done locally on my internal network - the ultimate goal is to rid of windows weatherlink software for data collection. I'm on a MAC so I'm limited to what I can do. -

Currently using unraid, docker and virtual machine to run this setup - eventually I will move everything to virtual machine. (it was just easier doing in parts while troubleshooting the process).



Mark