Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


mlew980

8 posts

Wannabe Geek


#229048 5-Feb-2018 10:58
Send private message

So I'm attempting on creating an irrigation system at home using an Arduino with Wireless + Solenoid valve and a few sensors. I wanted to create a small db to stores sensor data. The data would record at 1 min intervals so it wouldn't need to be a grunty server. My main question is, what would be the most cost effective, low power, small factor database server. I was thinking of using a Raspberry PI running Raspbian connected to a 1TB external HDD which would be under < $200, alternatively I could go for something more scale-able and get a small Celeron/i3 Intel NUC. Has anyone had a similar project/dilemma?


Filter this topic showing only the reply marked as answer Create new topic
jnimmo
1073 posts

Uber Geek


  #1951881 5-Feb-2018 11:12
Send private message

How long a history do you want to keep?

 

You could look at using Home Assistant on a Raspberry Pi, log to it using MQTT

 

Alternatively, various ways of getting the Arduino to log directly to a cloud based MQTT broker  (or something like ThingSpeak)


 
 
 
 

Protect your online activity with NordVPN (affiliate link).
mlew980

8 posts

Wannabe Geek


  #1951887 5-Feb-2018 11:20
Send private message

I was actually thinking of connecting my Arduino to my wireless network (same with the db server) then using this library to connect to the MySQL server.

 

https://www.arduinolibraries.info/libraries/my-sql-connector-arduino


  #1951889 5-Feb-2018 11:25
Send private message

+1 for MQTT. Probably not the simplest solution, but would be the most flexible IMHO. Your Arduinos can easily publish to a local MQTT broker (there are plenty of guides/tutorials about how to do this). Then once you have the data coming into your broker, which can happily run on a RPi, you have all sorts of options.

 

Personally I would run mqttwarn (https://github.com/jpmens/mqttwarn) which is a simple python script which will monitor MQTT topics and forward the messages onto different services. There are loads of options including multiple database options, even Google Docs Spreadsheet. 

 

Using this sort of architecture you can easily change the way you log your data without having to touch your Arduinos. 

 

Personally I run InfluxDB which is a database designed specifically for time series data, so is very efficient at storing regular (i.e. sensor) data. Not sure if it runs on a RPi tho, it didn't used to but that was a while ago.




mlew980

8 posts

Wannabe Geek


  #1951893 5-Feb-2018 11:35
Send private message

Looking further into your solutions, maybe it'll be more hassle free implementing an MQTT broker on the PI (using Mosquito) and then using mqttwarn to forward the data onto an InfluxDB rather than fiddling with the MySQL lib. The GitHub repo you mentioned has some superb instructions which should make configuring it a piece of cake. Now I guess it's time to look for a unwanted Pi


  #1951895 5-Feb-2018 11:39
Send private message

I might be able to help you with that ;). I have a couple of RPi2s which have just become free, you are welcome to one of them for the cost of shipping if you are interested?


davidcole
5807 posts

Uber Geek

Trusted

  #1951953 5-Feb-2018 12:13
Send private message

I'd be using influxdb as well (if for at home).  Another option is to use the http api on thingspeak and push your values there.





Previously known as psycik

OpenHAB: Gigabyte AMD A8 BrixOpenHAB with Aeotech ZWave Controller, Raspberry PI, Wemos D1 Mini, Zwave, Xiaomi Humidity and Temperature sensors
Media:Chromecast v2, ATV4 4k, ATV4, HDHomeRun Dual
Windows 10
Host Plex Server 3x3TB, 4x4TB using DriveBender, Samsung 850 evo 512 GB SSD, Hyper-V Server with 1xW10, 2xUbuntu 20.04 LTS, Backblaze Backups, usenetprime.com


Masterpiece
247 posts

Master Geek


  #1953359 7-Feb-2018 22:39
Send private message

For what it is worth, In one of my lives, I build datalogging, control systems and environmental monitoring networks.
A couple of these are rainfall simulation with 200 nozzles, 32 valves and 48 relays.

The main problem for new players to this sort of thing is they focus on the end goal, "I want to see the data", and not on the basic operation and control.
My home system it has 4 zones, I purchased a off the shelf 4 way solenoid system and controller, why? Because running complicated systems that are automatic still require input, and if you don't keep an eye it when it breaks(and it will) you end up with a watery mess.

Concentrate on the irrigating system allowing for expansion, I'd even go so far to say start with an off the shelf system to work out what works for you and what doesn't. They are pretty limited, and frankly annoying when compared to advanced control systems however you learn what and how with them. Or if you are going Arduino get the control working first. Doing this allows you to understand what and how you want to record.

Data, everyone wants 1 minute data. Sounds fine, but I tell you now from someone who collects data for research, 1 minute period is really only good for short high resolution information because high resolution bogs databases files down, then retrieval can get just as bad. Noting that control at 1 minute intervals is a perfect period, but data for what is happening is perfect at 15 minute, hourly and daily. 15 minute works well, but even then you can get bogged down with data handling. I typically use daily and hourly these days, which bring me to a data handling problem.

Time stamps, one main problem for you to understand early is the time stamp. Daily time the value 12 midnight or 24 hours actually does not exist, neither does the top of an hour as this becomes the next hour, or for the day the next day.
What?? you say, just consider the time clock for a day is 0 to 23:59:59.9999, what does this mean?
Consider, Day 1, if you collect data for the day to take a total daily rain or irrigation volume, so at the end of the day output this total and midnight. This outputs Day 1 as Day 2 time stamp because midnight is zero which is the next day.
How you handle this is your choice, there is a few methods, just be aware of it when data doesn't appear to plot on the right day or hour as you expect.





Me:"I'm not a robot!"

 

ET: "Maybe; you have some freewill, but you chose your path by arrangement"

 

Me "That sounds like a program with no freewill?"

 

ET: "We will catch up when you end this cycle"

 

Me: "Sounds like a 'KPI'!"

 

ET: "Did you read the terms and conditions?"

 

Me: .....



bazzer
3438 posts

Uber Geek

Trusted

  #1953368 7-Feb-2018 22:58
Send private message

SumnerBoy:

 

I might be able to help you with that ;). I have a couple of RPi2s which have just become free, you are welcome to one of them for the cost of shipping if you are interested?

 

 

What were you planning to do with the other one? :D


  #1953369 7-Feb-2018 23:00
Send private message

Planning to give it away, to someone worthy...

TwoSeven
1512 posts

Uber Geek

Subscriber

  #1953792 8-Feb-2018 18:39
Send private message


I would probably just write the data into a text file in csv format, then create a new file every day. The old files can be added to an archive to save space.





Software Engineer
   (the practice of real science, engineering and management)


Filter this topic showing only the reply marked as answer Create new topic





News and reviews »

Prodigi Technology Services Announces Strategic Acquisition of Conex
Posted 4-Dec-2023 09:33


Samsung Announces Galaxy AI
Posted 28-Nov-2023 14:48


Epson Launches EH-LS650 Ultra Short Throw Smart Streaming Laser Projector
Posted 28-Nov-2023 14:38


Fitbit Charge 6 Review 
Posted 27-Nov-2023 16:21


Cisco Launches New Research Highlighting Gap in Preparedness for AI
Posted 23-Nov-2023 15:50


Seagate Takes Block Storage System to New Heights Reaching 2.5 PB
Posted 23-Nov-2023 15:45


Seagate Nytro 4350 NVMe SSD Delivers Consistent Application Performance and High QoS to Data Centers
Posted 23-Nov-2023 15:38


Amazon Fire TV Stick 4k Max (2nd Generation) Review
Posted 14-Nov-2023 16:17


Over half of New Zealand adults surveyed concerned about AI shopping scams
Posted 3-Nov-2023 10:42


Super Mario Bros. Wonder Launches on Nintendo Switch
Posted 24-Oct-2023 10:56


Google Releases Nest WiFi Pro in New Zealand
Posted 24-Oct-2023 10:18


Amazon Introduces All-New Echo Pop in New Zealand
Posted 23-Oct-2023 19:49


HyperX Unveils Their First Webcam and Audio Mixer Plus
Posted 20-Oct-2023 11:47


Seagate Introduces Exos 24TB Hard Drives for Hyperscalers and Enterprise Data Centres
Posted 20-Oct-2023 11:43


Dyson Zone Noise-Cancelling Headphones Comes to New Zealand
Posted 20-Oct-2023 11:33









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.







Norton for Gamers