Sent and receive data from arduberry

Hello All,

I have device set up like a combination of Raspberry Pi, Arduberry and adafruit nfc sheild. Does this disable serial port?

I wonder how can I make Arduberry talk to Raspberry Pi?

I tried
void setup()
{
Serial.begin(115200); //Start the Serial at 9600 baud
}

void loop()
{
if(Serial.read()==‘s’) //If ‘s’ is recieved, send the data back
{
int sensorValue = analogRead(A0);
Serial.print(“Hi”);
Serial.println(sensorValue); //Send ‘hi’ followed by the analog read value
}
delay(1000);
}

Hi @shaow1,

Is the baud rate 9600, I think you have chosen 115200 as the baud rate so change it to Serial.begin(9600), also can you send us a screenshot of the output you see.Can you check if the serial monitor is working by adding Serial.println("Hello World") after the delay(1000) in your program.
Are you getting the LED Blink program to work with ArduBerry?

-Shoban

What LED Blink program? I am not using any of those port like COM1, so nothing is there in serial monitor. My device is set up like the following link (dexterindustries.com/Arduberry/example-projects-with-arduberry-and-raspberry-pi/nfc-card-reader/)

Hi @shaow1,

Sorry I meant, what you see on your minicom, Have you tried changing the baud rate to 9600 ?
Have you tried this LED blink program. LED blink program is to know if your ArduBerry works and the aim of adding the Serial print statement is to see if Serial print works on minicom.

-Shoban

I am trying this, but the python code says serialException something like that and device disconnect. Here is the link “dexterindustries.com/Arduberry/how-to-program-the-arduberry/python-communicating-arduberry/

Hi @shaow1,

We haven’t seen this trouble before, we will look into it and get back shortly.

-Shoban

Couple things I want make sure, first of all, in the first link, it uses Arduberry v1, but mine is Arduberry v7.0 does that matter?
Second, does the python communication using USB connection?
Third, the ttyAMA0 that we used for NFC detection(read data), can I also use it for sending data? Will it cause conflict?

@shaow1,
There should not be any difference between the way v1 and v7 work.

The Python comms with the Arduberry work with serial via the 26 or 40 pin GPIO header. USB is only for power.

Only one serial device can be used on ttyAMA0. So there will be a conflict if you want to talk between the Pi and Arduberry via Serial.

So any suggestions for my situation? I am already using ttyAMA0 for the NFC receive data, so how will I be able to send those data to the Raspberry Pi? Do you thing python works or I should pick another language?

@shaow1,
There is not a great way to use multiple serial devices. One way can be to use a serial Mux like this which would allow you to connect to multiple devices.

The other way can be to use an serial to USB adapter like this which would allow you to connect the second serial device to the USB port.

Can you send me a link to the NFC module that you are using.

https://www.dexterindustries.com/Arduberry/example-projects-with-arduberry-and-raspberry-pi/nfc-card-reader/

This one.

@shaow1,
This NFC shield can also be connected via I2C. Would you be comfortable soldering a few pads and making a few changes on the code so that it can work over I2C.

Hey Karan,

I solved this problem, the conflict is actually caused by having minicom open.

Now I wonder how can I detect
https://www.amazon.com/Black-NFC-Stickers-NTAG213-Tagstand/dp/B00KSR0636/ref=sr_1_3?ie=UTF8&qid=1488564746&sr=8-3&keywords=nfc+tag
this specific tag?

@shaow1,
Great to hear that it is working for you now. I am not really sure how to detect that particular NFC tag. Can you check the specs of that one and see if the NFC shield supports it. Usually the NFC shield is able to read the tag as soon as the tag is brought close to it.

Any code I need change in order to make it work for different tags? Also for the example code for this specific set up, how can I change the tag’s ID?