Cooking Hacks Forum
https://www.cooking-hacks.com/forum/

Raspberry Pi receiving Frames from Waspmote XBee
https://www.cooking-hacks.com/forum/viewtopic.php?f=37&t=19749
Page 1 of 1

Author:  mabosanz [ Wed Jul 03, 2019 3:48 pm ]
Post subject:  Raspberry Pi receiving Frames from Waspmote XBee

Hi every one!

I'm developing a system where waspmotes send frames to a Rasp Pi 3B+ with Arduino shield.

Waspmotes are configured and now I don't see in this tutorial (https://www.cooking-hacks.com/documenta ... -tutorial/) how can I get Frames received and use them to do something like sending to a webservice. How can I get frames from arduino shield and use in Raspberry scope.

Thanks in advance.

Regards.

Author:  libelium-dev [ Thu Jul 04, 2019 7:37 am ]
Post subject:  Re: Raspberry Pi receiving Frames from Waspmote XBee

Hi,

If the xbee module is configured with API mode 0, data is received as a serial buffer. You can read the serial buffer and save it in a variable

Code:
//Include ArduPi library
#include "arduPi.h"

char buffer;

void setup(){
  Serial.begin(9600);
  pinMode(led, OUTPUT);
}

void loop(){
  while(Serial.available()){
    buffer = Serial.read();
  }
}

int main (){
  setup();
  while(1){
    loop();
  }
  return (0);
}


Hope this helps.
Regards

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/