7

I would like to design a system using Raspberry Pi that sends the sensor's data to server continuously and receive commands from server.

Will MQTT suit my needs ?

Is there any way to do so if I use Java on my Pi?

Edit

By continuously I mean that streams like video are continuous and other text based data is sent twice every minute.

The sensors are:

Humidity sensor - http://www.amazon.in/DHT11-Temperature-Humidity-Sensor-Module/dp/B01HI9G9ZU?tag=googinhydr18418-21&tag=googinkenshoo-21&ascsubtag=710c9d6b-87d0-41e2-b3e0-06a1045769f3

A 5MP camera (Webcam connected to USB of the Pi.)

LDR(Light and Dark) - Sensor

The server is based on a cloud hosting location.

  • 3
    Which sensor ? What is it connected to ? Is the Raspberry Pi your server ? Please edit your question to add this information. – Goufalite May 16 '17 at 13:19
  • 1
    How frequently is 'continuously'? The answer's probably different between once per second and once per minute, or hour. Make sure you edit with that so we can give you the best answer. – Aurora0001 May 16 '17 at 13:53
  • 1
    @Aurora0001 Updated the answer. – Shakti Phartiyal May 16 '17 at 14:19
  • 1
    @ShaktiPhartiyal Don't forget to also answer Goufalite's questions in an edit—make sure you give as much context as you can. – Aurora0001 May 16 '17 at 14:23
  • 1
    @Goufalite Updated the answer. – Shakti Phartiyal May 16 '17 at 14:27
7

Ok here goes

  • Install MQTT on your Raspberry Pi

Look if it is already running on your Rpi linux flavor or install it

  • Expose your MQTT port

Look at which port MQTT is installed and open this port using port forwarding with your broadband modem

  • Connect your cloud server to your local MQTT

  • Test your sensors

I don't know how the temperature sensor will be connected, my best guess would be with an Arduino. If it is the case, you can connect it to MQTT with a shield. If not, please edit your question to tell us how your sensors will be connected to your system.

  • Monitor your camera

Raspberry Pi has a library called motion which allows to control the camera, its behaviour on detection,...

Unless motion has already a MQTT interface, your best move is to output movements as pictures and then use a homemade service which uses inotify to wait for a new file and act (MQTT /camera/motion yes)

If you need more advice, please edit your question with other elements.

|improve this answer|||||
  • Thank you for the insightful answer.. Will try that out. – Shakti Phartiyal May 19 '17 at 5:04
3

By continuously I mean that streams like video are continuous

If you are considering continuous video streaming from Pi then LIVE555 Streaming Media is a may serve your purpose. Live555 will provide following:

  • Source distribution for standards based RTP/RTCP/RTSP/SIP multimedia streaming
  • Suitable for embedded and/or low-cost streaming application
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.