Connecting an Arduino with raspberry PI 2

Hello I’m a Moroccan student, i just started working with arduino i want to collect data from my T/H sensor and send it by wifi to a raspberry card by Xbee and stock those datas in Excel file.
i wonder if any one can help with that.
I managed to get the temparture and humidity values but i don’t know how to send them

Thank you and sorry if my english is not understandable

You want to read about using MQTT. That will do the things you want.

I'm using ESP8266 01 and 12 to send MQTT message to RPi.
RPi run MQTT brocker Mosquitto

I use ESPEasy on ESP8266s, too easy really to program different sensors.

To show the whole info, you have a lot of alternatives. Domoticz, OpenHab, and others. I use Node Red for RPi .

didyi:
and send it by wifi to a raspberry card by Xbee

As far as I know an XBee is not Wifi. I think XBees just provide a wireless serial connection.

...R
Serial Input Basics
Python - Arduino demo

Yea i don't know too much about it.
I only have those components and i have to turn this on with them
thank you for your answer

surbyte:
I'm using ESP8266 01 and 12 to send MQTT message to RPi.
RPi run MQTT brocker Mosquitto

I use ESPEasy on ESP8266s, too easy really to program different sensors.

To show the whole info, you have a lot of alternatives. Domoticz, OpenHab, and others. I use Node Red for RPi .

yea but it's a university project i have to use thecomponents that i mentioned before
Thank you

yea but it's a university project i have to use the components that i mentioned before

Oh no not that old chestnut again. You don't have to use those components, you misunderstand your lecturer or you misunderstand the project brief.

send it by wifi to a raspberry card by Xbee

That is impossible because as you have been told Xbee doesn't do Wi-Fi. If your lecturer thinks you can then he knows nothing, so go back to him and say that Wi-Fi and Xbee can not be inter-operable. If he refuses to listen then go to the admin office and demand your tuition fee back.

Hello i miss choose words i think
This is what i'm trying to do it's to do a gateway using Xbee
and use the data collected by the temperature/humidity sensor by the raspberry

Thank you for your answers


i miss choose words i think

Yes I think that as well.

Arduino end
Look at the Xbee examples for the Arduino and use the serial mode of the Xbee and just send the readings at what ever rate you want.

Pi end
What language are you using? I am assuming Python.
Enable the serial port in python by using:-

ser = serial.Serial('/dev/ttyACM0',115200, timeout=2)

with the 115200 replaced by the baud rate you are sending with the Arduino.
The read the serial port with

a = ser.read(4)

Replacing the 4 with how many bytes you expect to read. If there are no bytes to receive within the timeout period the variable “a” will contain a null.

Thank you

i'll see how it works i'm not familiar with pythone i only studied C++

Thank you again

didyi:
Hello i miss choose words i think
This is what i'm trying to do it's to do a gateway using Xbee
and use the data collected by the temperature/humidity sensor by the raspberry

Have you studied the links I gave you in Reply #3. They should give you a lot of what you need.

...R

didyi:
i'll see how it works i'm not familiar with pythone i only studied C++

It works the same in C just the syntax is slightly different.