Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

reading data from raspberryPi

Creator
Creator

Hi,

 

I am trying to send data from raspberryPi to MindConnect IoT extension .

My question is:

do I have to build an agent on raspberryPi using MQTT, C++, or other available options ?

or is there another way to read data from the raspberryPI like visual flow creator.

Thanks in advance.

7 REPLIES 7

Re: reading data from raspberryPi

Genius
Genius

If using the MindConnect IoT Extension, you will not need to create your own agent. The Extension will handle the connection and all you have to do is create the same asset structure in MindSphere and map the data points over.

 

To connect R Pi to MindConnect extension.

https://www.cumulocity.com/guides/devices/raspberry-pi/

Re: reading data from raspberryPi

Creator
Creator

Thank you for your reply, I created a Python MQTT agent similar to the example mentioned below and I am able to send and read the data.

 

https://cumulocity.com/guides/device-sdk/mqtt/#hello-mqtt-python

Re: reading data from raspberryPi

Siemens Creator Siemens Creator
Siemens Creator

I am also trying to connect raspberry pi to IoT extension but somehow the mentioned serial no. of the raspberry pi device in the Iot extension of Registered device not showing.

 

Have you faced also the similar issue for the registration of the Raspberry PI device.

Re: reading data from raspberryPi

Creator
Creator

Which way are you following ? 

I tried the traditional redisteration for the raspberry Pi as a device described below 

https://www.cumulocity.com/guides/devices/raspberry-pi/

it worked for me but it wasn't what I am looking for

 

For me I built a Python MQTT Agent on the raspberry Pi to send/receive data

I followed the below guide for reading data 

https://www.cumulocity.com/guides/device-sdk/mqtt/#hello-mqtt-python

for sending commands you need to add one line to the code to activate the shell tab in IoT extension

which is :

client.publish("s/us", "114,c8y_Command,c8y_Configuration")

 

Hope I answered your question 

Re: reading data from raspberryPi

Experimenter
Experimenter

@Eyad_Almolki @RishabhGGN @Rex_Chen 

I am trying to send Temperature Sensor data from Raspberry Pi to Mind Connect, my device is already registered in all Devices list. But I wanted to configure the same RassberryPi Device and send the data into it. I am a bit confused with Device Name and Device Id and all the registered credentials it is asking for.   

 

I already tried with Cumulocity MQTT Python / Node code and My Device got registered, whenever I am trying to run the code again the data is not going to the same Device (The Predefined Template).

 

Can anyone Please help me with this?

 

Can I go ahead and send the Temp. Sensor data to already registered Device using Python/ NodeJs code  (or) To the predefined Template that already present?

 

Please do help me on this.

 

Thank you in Advance.

 

Re: reading data from raspberryPi

Creator
Creator
Hi @samir_lenka

have you found the solution to your problem yet? I facing something similar. I have registered my RPi using the cumulocity agent and following this tutorial https://developer.mindsphere.io/howto/howto-rpi-mciot.html#integrating-raspberry-pi-sensor-data-via-...

But would like to send temperature sensor data using mqtt in the same Rpi device and not have the program create a new one everytime.

Re: reading data from raspberryPi

Siemens Genius Siemens Genius
Siemens Genius

@SonaliJain  @samir_lenka 

You can connect to already registered device by using the following 3 parameters in your MQTT client:

mciot-e.png

 

You should use the same clientID in your MQTT client, if not, a new device will be registered each time you send measurements. The clientID can be found here:

 

mciot-e2.png

 

You can see below, I am able to connect to the already registered device and able to send measurements.

 

mciot-e3.png