adeguntoro
Posts: 87
Joined: Wed Sep 14, 2016 11:11 am

[SOLVED] how to make RPi IoT realtime online ?

Wed Feb 22, 2017 2:22 pm

first of all, sorry for my bad english.
and this is my first time i'm join with IoT.
i want make a little project, just for me, it's about how i can monitoring online my sensor, so i can see my sensor from anywhere via browser.
can you show me simple tutorial / link, so i can learn more about this..
thank you.
Last edited by adeguntoro on Tue Sep 12, 2017 7:20 am, edited 1 time in total.

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: how to make RPi IoT realtime online ?

Wed Feb 22, 2017 3:22 pm

There is one big decision you will have to make:
- Should the web-page be hosted on the Raspberry Pi ? ( example: https://github.com/node-red/node-red-dashboard )
- Or should the sensor date just be uploaded to the cloud and the web-page created there ? ( example: http://freeboard.io/ )

Its always helpful to know which programming languages you already know or want to learn.

StephenCJones
Posts: 1
Joined: Wed Feb 22, 2017 9:55 pm

Re: how to make RPi IoT realtime online ?

Wed Feb 22, 2017 11:09 pm

Since upgrading my pi3 two hours ago, Node-Red no longer works. The command lines seem to suggest that email etc needs to be added. All I want is the program to work as before. Can anyone help please.
Thanks
Stephen

adeguntoro
Posts: 87
Joined: Wed Sep 14, 2016 11:11 am

Re: how to make RPi IoT realtime online ?

Thu Feb 23, 2017 3:12 am

topguy wrote:There is one big decision you will have to make:
- Should the web-page be hosted on the Raspberry Pi ? ( example: https://github.com/node-red/node-red-dashboard )
- Or should the sensor date just be uploaded to the cloud and the web-page created there ? ( example: http://freeboard.io/ )

Its always helpful to know which programming languages you already know or want to learn.
well, thank you for your help.
oke, first yes, it should be hosted on the raspberry, because i have another plan to make cluster or HA server with my raspberry pi.
and programing ai already learn is java, php, html, and python..
and this raspberry also will become data collector few sensor.

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: how to make RPi IoT realtime online ?

Thu Feb 23, 2017 8:15 am

StephenCJones wrote:Since upgrading my pi3 two hours ago, Node-Red no longer works. The command lines seem to suggest that email etc needs to be added. All I want is the program to work as before. Can anyone help please.
Thanks
Stephen
Please start a new thread on this issue.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: how to make RPi IoT realtime online ?

Thu Feb 23, 2017 10:05 am

oke, first yes, it should be hosted on the raspberry, because i have another plan to make cluster or HA server with my raspberry pi.
Ok.. so the next question is: Do you prefer to use a web-server like Apache (a LAMP solution probably) or would you test out Python web-framework like "Flask" ( https://www.raspberrypi.org/learning/py ... ith-flask/ ) ?

adeguntoro
Posts: 87
Joined: Wed Sep 14, 2016 11:11 am

Re: how to make RPi IoT realtime online ?

Thu Feb 23, 2017 11:15 am

topguy wrote:
oke, first yes, it should be hosted on the raspberry, because i have another plan to make cluster or HA server with my raspberry pi.
Ok.. so the next question is: Do you prefer to use a web-server like Apache (a LAMP solution probably) or would you test out Python web-framework like "Flask" ( https://www.raspberrypi.org/learning/py ... ith-flask/ ) ?
woah, thanks for link, it's very helpful.
absolutely yes, but, how i can control / program my sensor ??

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: how to make RPi IoT realtime online ?

Thu Feb 23, 2017 11:46 am

absolutely yes
Yes to what exactly ? Flask ?
how i can control / program my sensor ??
You haven't told us anything about your sensor yet.

adeguntoro
Posts: 87
Joined: Wed Sep 14, 2016 11:11 am

Re: how to make RPi IoT realtime online ?

Fri Feb 24, 2017 5:26 am

topguy wrote:
absolutely yes
Yes to what exactly ? Flask ?
how i can control / program my sensor ??
You haven't told us anything about your sensor yet.
exactly with lamp..

and for sensor, it can be any sensor, because the goal of this project is i can monitor my sensor from anywhere..
okay, for example is moisture sensor..

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: how to make RPi IoT realtime online ?

Fri Feb 24, 2017 9:49 am

There are probably hundreds of LAMP guides for raspberry pi out on the internet.
There is even one on this site: https://www.raspberrypi.org/learning/la ... wordpress/ ( you can skip the wordpress steps if you like )
okay, for example is moisture sensor..
And there is a lot of examples there just a google away. Much more detailed than anyone will bother to write in this forum: https://www.modmypi.com/blog/raspberry- ... n-tutorial

A typical setup would be to run some Python program to read the sensors and put the data into the MySQL database. Then the PHP program running on Apache only have to worry about presenting those data on the web-page.

adeguntoro
Posts: 87
Joined: Wed Sep 14, 2016 11:11 am

Re: how to make RPi IoT realtime online ?

Thu Mar 02, 2017 6:47 pm

topguy wrote:There are probably hundreds of LAMP guides for raspberry pi out on the internet.
There is even one on this site: https://www.raspberrypi.org/learning/la ... wordpress/ ( you can skip the wordpress steps if you like )
okay, for example is moisture sensor..
And there is a lot of examples there just a google away. Much more detailed than anyone will bother to write in this forum: https://www.modmypi.com/blog/raspberry- ... n-tutorial

A typical setup would be to run some Python program to read the sensors and put the data into the MySQL database. Then the PHP program running on Apache only have to worry about presenting those data on the web-page.
so i found lot of tutorial, but mostly they use RPi 2, and i'm using RPi 3 B..
is any difference betwen script on RPi 2, RPi 3B , RPi Zero ??
i'm gonna use Moisture Sensor and MCP3008..

drjam
Posts: 11
Joined: Sun Nov 13, 2016 7:20 am
Location: Austraya

Re: how to make RPi IoT realtime online ?

Sat Aug 05, 2017 3:30 am

can you link the tutorial please?
I am REALLY having hard time getting my brain around all the separate things i need to make this work for me too. :shock:
Couple of pi 3's, a pi 2 and an assortment of hardware.
your move brain.....your move

alphanumeric
Posts: 2547
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: how to make RPi IoT realtime online ?

Sun Aug 06, 2017 1:21 pm

Being a Pi 2 or Pi 3 or Zero shouldn't matter. The GPIO is that same pinout on all Pi's with a 40 pin header.

What I try to do, sensor wise. Is find ones that talk over the I2C, and have a python library available. It what works for me.

adeguntoro
Posts: 87
Joined: Wed Sep 14, 2016 11:11 am

Re: how to make RPi IoT realtime online ?

Sun Aug 06, 2017 1:23 pm

drjam wrote:
Sat Aug 05, 2017 3:30 am
can you link the tutorial please?
I am REALLY having hard time getting my brain around all the separate things i need to make this work for me too. :shock:

well, basicly it easy. You just need to use simple programing to upload your data into realtime database, and display it into HTML. i use Firebase, i will upload my project as soon as possible from my github repo. https://github.com/adeguntoro/Firebae

drjam
Posts: 11
Joined: Sun Nov 13, 2016 7:20 am
Location: Austraya

Re: how to make RPi IoT realtime online ?

Sun Aug 06, 2017 1:53 pm

thanks guv.
ive just worked out that i can also do these things:
1. possibly change Grafana to port 80 and stop nginx (maybe?)
2. have nginx in front of grafana and have it proxy request to grafana
3. redirect wormhole traffic to another port and then forward that to port 80

ill try it all out and post here as well... so we can all grow smarter. thanks again! ;)
Couple of pi 3's, a pi 2 and an assortment of hardware.
your move brain.....your move

adeguntoro
Posts: 87
Joined: Wed Sep 14, 2016 11:11 am

Re: how to make RPi IoT realtime online ?

Sun Aug 06, 2017 2:09 pm

are you use offline database ?

drjam
Posts: 11
Joined: Sun Nov 13, 2016 7:20 am
Location: Austraya

Re: how to make RPi IoT realtime online ?

Wed Sep 06, 2017 3:25 am

UPDATE
decided to flick third party services for now, the cost is too high for what i want to do (and for what i can charge people for)
im using a Virtual Machine running Linux, with Grafana and Influx setup on that.
on the remote computers / servers, i am running telegraf and that is sending metrics to the WAN of where i am hosting the Linux Grafana box.

I wish Dataplicity's Wormhole would have allowed me to view the Pi's Grafana Website ANYWHERE, id gladly pay them for that. But it dodnt work, I could not change the reverse proxy settings to allow it to show Grafana internal dashboard site, instead of the Welcome to Dataplicity page on your device:yay.

oh well. Im keeping one pi alive on Dataplicity because the remote access to the pi from there IS USEFUL....not at $2 per month just to reboot it, but i might figure it out later.

and no, not offline database, im using Influxdb on the same VM as Grafana. host OS is ubuntu. :mrgreen:
Couple of pi 3's, a pi 2 and an assortment of hardware.
your move brain.....your move

Elliot_M
Posts: 39
Joined: Wed Dec 17, 2014 12:59 am

Re: how to make RPi IoT realtime online ?

Wed Sep 06, 2017 11:45 am

Hi there
Happy to help you get it running if you like... wormhole should work, but if grafana dashboard uses something other than localhost port 80 you may need to either adjust the reverse proxy or put up an nginx one in front to do the redirect (wormhole will listen only on this interface and this port).

Apologies for the slow response in advance, am just about to board a plane, but will check back in when I land tomorrow.

Best
Elliot

adeguntoro
Posts: 87
Joined: Wed Sep 14, 2016 11:11 am

Re: how to make RPi IoT realtime online ?

Tue Sep 12, 2017 7:36 am

Elliot_M wrote:
Wed Sep 06, 2017 11:45 am
Hi there
Happy to help you get it running if you like... wormhole should work, but if grafana dashboard uses something other than localhost port 80 you may need to either adjust the reverse proxy or put up an nginx one in front to do the redirect (wormhole will listen only on this interface and this port).

Apologies for the slow response in advance, am just about to board a plane, but will check back in when I land tomorrow.

Best
Elliot
Well, thank you for you advace, and sorry for not update my title, it's already fixed. I use Firebase for my online database, and it's realtime, i upload data from my sensor using some kind Python Library, it call as Pyrebase. And to show data from firebase i use javascript, very simple and always change when data is changed or new input.
For input data, i use one more file from google service account for security reason, so just me as the owner can read, delete, update and input data from raspberry into firebase. so, theres no special setting, just connect raspberry with internet ( i try with 1Mbps connection, 90 ping to google.com), run python program, and i can see data "feed" into firebase from Firebase console.

but let me try you idea for bigger project on my university.
thanks.

Return to “Automation, sensing and robotics”