ArduinoGeneral

Weather Station and Raspberry

userHead anonymous 2020-12-24 18:01:43 1069 Views2 Replies
I am interfacing the DF Robot weather station with a Raspberry pi 3Bv2 because I want the data on the internet but I am currently having a problem getting the data from the DF Robot board to the Raspberry via serial connection.
I have made the following connections from DF Robot to Raspberry.
Vcc --- 5v
tx --- rx
rx --- tx
Ground --- ground
I do get data when reading in C but the data looks like "�����������" which translates to repeated "EF BF BD".
The document that came with the weather station says 9600baud and I have set the Raspberry to 9600baud. Obviously something else is wrong. Please advise.
The Raspberry C program copied from wiringPi examples :-
Code: Select all
 
#include <stdio.h>
#include <string.h>
#include <errno.h>

#include <wiringSerial.h>

int main ()
    {
    int fd ;

    if ((fd = serialOpen ("/dev/ttyAMA0", 9600)) < 0)
        {
        fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
        return 1 ;
        }

// Loop, getting and printing characters

    for (;;)
        {
        putchar (serialGetchar (fd)) ;
        fflush (stdout) ;
        }
    }
2020-12-26 16:32:36 The serial port on the DFRobot board is unlikely to be wrong as it works fine with Arduino Uno and as I am receiving data on the Raspberry Pi I do not understand your suggestion.
The point is I am getting data just not what is required.
userHeadPic anonymous
2020-12-24 18:32:42 The serial port pin you selected may be wrong, you can try to find the pin after connecting userHeadPic 347945801