Yahya05IE
Posts: 24
Joined: Tue Jul 11, 2017 9:11 pm

RPi Server

Mon Jul 17, 2017 8:43 pm

Hi,

Are there available software that can take the readings of my sensors from my program on RPi and store'em in a DB on a Server (+displaying them)?

Thanks.

User avatar
B.Goode
Posts: 7868
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: RPi Server

Mon Jul 17, 2017 8:59 pm

Since we don't know what your sensors are that's a little difficult to answer for certain.

But in outline that's roughly what the Raspberry Pi Foundation Weather Station Project does.

Reading about that might give you some inspiration: https://www.raspberrypi.org/education/w ... tion/faqs/

Yahya05IE
Posts: 24
Joined: Tue Jul 11, 2017 9:11 pm

Re: RPi Server

Mon Jul 17, 2017 9:13 pm

Thank you very much for your answer.

My project is about connecting roughly 12 gas sensors (most of them are MQx) to a RPi. I'm using Java as a programming language (Pi4J Open Source Library).

After taking the readings from the console on my NetBeans IDE (for testing purposes), the next step is sending those readings over the cloud to some free hosting server, so I can create an Android program that can fetch the readings from this server.

Also the server shall contain a Database for analysis purpose.

Would you please tell me if there is any software the can handle the Cloud part of my project?

W. H. Heydt
Posts: 10318
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: RPi Server

Tue Jul 18, 2017 1:33 am

I can't speak to the cloud aspect as I avoid the use of the cloud unless forced to use it for some reason. What you are--effectively--asking is: Can you connect to a remote database? The answer is a pretty obvious yes. You'd do it like you would to any remote database. You need an address for it. Doing so isn't intrinsically different from connecting to a database on the same machine the program is running one. Locally, the address will be "localhost".

What you might do is start by using a database installed on the Pi that is collecting the sensor data. Once that is working, create a program that copies that data to a "remote" database on your LAN. Once that is working, connect to a remote host somewhere else, like a cloud server.

Depending on what database engine you are using, you might be able to set up your cloud-based database a replicated slave of your local one. While I don't do it with the cloud, I do that with a pair of SBCs using MySQL. Data is written to the database on one system and the other automatically grabs it and populates a duplicate database with no programming (beyond replication set up) being done on my part.

Yahya05IE
Posts: 24
Joined: Tue Jul 11, 2017 9:11 pm

Re: RPi Server

Tue Jul 18, 2017 8:26 am

Cheers man, I know how to do it on a localhost, so it should be kinda replication of that approach.

Thanks again.

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: RPi Server

Sat Aug 05, 2017 3:07 pm

Do you need to record historical values or do you just need immediate values?

MQTT is my pick for communicating sensor data to "The Cloud". There are free (public) MQTT services available. (Just one example: http://www.mqtt-dashboard.com/)

There are Java and Android (as well as just about any other language) libraries from publishing and subscribing to MQTT topics.

I have also used Initial State (https://initialstate.com/) to publish sensor data when I also wanted to visualize historical graphs about the data. They have a free tier as well as a personal and pro subscription model. I used the personal subscription (very affordable) while I was testing.

Thanks, Robert
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: RPi Server

Sat Aug 05, 2017 3:14 pm

Another couple of services that I have looked at (but not personally used) are:
and so many more.
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

Return to “Off topic discussion”