Notifications
Clear all

ESP32 for IoT for Automobiles

42 Posts
3 Users
5 Likes
4,133 Views
(@jfabernathy)
Member
Joined: 3 years ago
Posts: 141
Topic starter  

Not completely sure of your questions. If you double click on a nodered node like MQTT in you will see my setup to get to Mosquitto.  If you double click on the influxdb out you'll see how it's connected to the database software.

 

If your code won't compile, have another glass of bourbon. Eventual the problem will be solved.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@jfabernathy

Making progress! Now I've got a Flow that writes True or False to the Home database via Node-Red.  And I'm seeing the "time" and the boolean value from the command line of InfluxDB.  Now I need to try to get something back from InfluxDB to Node-Red and to Grafana.

Slightly longer strides.

And this comment about the mosquitto version that was mentioned in the "IOTstack/issues/265" link in your cheat sheet.  I may have messed up because I went back to version 1.6.12, but mosquitto seems to be OK.  Should I be worried about going back to whatever version was there before I 'downgraded?'

SteveG


   
ReplyQuote
(@jfabernathy)
Member
Joined: 3 years ago
Posts: 141
Topic starter  

Grafana talks directly to influxdb and doesn't need nodered at all.

However, one of my flows has a web http get that executes a select query on influxdb to pull the most recent reading and formats it in json and returns that json string to the browser that calls it.  That's what I use for my Magtag display.

 

If your code won't compile, have another glass of bourbon. Eventual the problem will be solved.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@jfabernathy

Well making some progress!  Now have temp and humid coming into the mqtt broker from an esp8266 that is publishing to a topic.  Then node-red is subscribed to that topic and sending the data to a influxdb measurement!

Now I need to get that data displayed in Grafana!

I really appreciate all the help and pointers you have provided.

SteveG


   
jfabernathy reacted
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

Any Grafana gurus in our midst?  I can't seem to get Grafana to graph anything.  But the query part of the dashboard seems to see the measurement in my database as I can select the three measurements that exist in my database.  And each measurement does contain data as I can see it from the Influx command line with the SHOW * FROM <one of the measurements in the database>

Any help appreciated.

SteveG


   
ReplyQuote
(@jfabernathy)
Member
Joined: 3 years ago
Posts: 141
Topic starter  

@codecage Did you see the screen shot I posted with my temperature and humidity query?  That's about all I know.

If your code won't compile, have another glass of bourbon. Eventual the problem will be solved.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@jfabernathy

Are you referring to the one that produced the dashboard for your 5th wheel?  If so yes, but that doesn't seem to be helping me much.  Obviously the names I'm using other than the database name (home) are different, but almost identical.

SteveG


   
ReplyQuote
(@jfabernathy)
Member
Joined: 3 years ago
Posts: 141
Topic starter  

i just googled 'grafana tutuorial' and found a number of helpful sites including Youtube videos

 

If your code won't compile, have another glass of bourbon. Eventual the problem will be solved.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@jfabernathy

I must be real dense as I been trying those, but to me they don't dig deep enough to make it really understand able.  I guess I have found some of the same ones you have and have waded through a half dozen or so, but they really are not any help at all.  They all seem to look different or act differently than what I have does.

From looking at the things from your GitHub site it looks to me that your database name is "home" and the measurement you are using is "environment".  Is there any way you could share a bit of the data you have i that measurement by doing a <SHOW * FROM environment> and then copying a few lines into a text file and attaching to a post so I can see the layout of your data.  From what I've discovered it looks like you have JSON formatted data from the sensors being fed into NODE-RED and then maybe some conversion going on before it gets to the database and Grafana.

And trying to understand the Grafana way of doing a query is driving me batty it say the least.

SteveG


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@jfabernathy

I now have data from InfluxDB being displayed on a dashboard I made in Grafana!  👍 

Thanks for sticking with me and all your support!!  I finished the bourbon and things got solved!  🍷 🍷 🍷 🍷 

😀 😎 

SteveG


   
jfabernathy reacted
ReplyQuote
(@jfabernathy)
Member
Joined: 3 years ago
Posts: 141
Topic starter  
Posted by: @jfabernathy

Now that I've been running my ESP32 Temperature and Humidity monitoring board for a few weeks, I'm really glad I have the WDT implemented. It can run for 4-5 days and then reset and start over. I added a loop counter that gets incremented and stored in NVM that gets powered in Deep Sleep on the ESP32. I post the counter along with the environmental data via MQTT.  So when that counter goes back to zero I know there has been a triggering of the WDT. 

Everything keeps going and I, at most, miss one minute of posted data.

If anyone wants to see the final code it's on my github for this project:

https://github.com/jfabernathy/MQTT-humidity-and-temperature

 

UPDATE:  My longest run without a WDT reset has been 13.75 days. Not bad, but I'm really glad I used a WDT to protect from the unknown.  It can't be a power glitch because the project is Solar powered. Always 10+days reserve according to the BMS. So why it resets is a mystery; possibly some weird atmospherics issue with WiFi causing something more than a error. 

Anyway, the WDI has always saved the day. I have not been out to the RV where the environment monitor board is for months and that's a working system in my mind. 

If your code won't compile, have another glass of bourbon. Eventual the problem will be solved.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@jfabernathy

I've been running mine now, using your code, for a couple of weeks but I get the 'resets' quite a bit more often.  But it doesn't seem to cause me any real issues as it just starts over and keeps on sending data.  Sort of like the Energizer Bunny beating on it's drum!

SteveG


   
ReplyQuote
Page 3 / 3