I used the Arduino tutorial for my first basic SoftwareSerial program and it's not working. I'm sending serial data on pin 3 on the Yun.
The program below never prints "Available".
I verified data is being sent to the RX pin (3). Am I missing any required configuration?
Please take a look, I couldn't find anything wrong after hours of investigation.
I have SparkFun RFID reader connected (SparkFun RFID Starter Kit - KIT-13198 - SparkFun Electronics)
I verified it's working when connected through USB.
I remove the USB and connect the pins Vcc to 5V, GND to GND, and the Tx to the Arduino IO pin I'm setting as RX in SoftwareSerial, similar to the Tutorial on the SparkFun site.
It's the same board. The one in my drawing is the back of the board.
The RFID USB board has a USB connection and also exposes the pins so you can connect it to Arduino without the USB cable.
I first tested the RFID board by connecting it to my PC using USB cable and read the RFID using PuTTY to confirm the RFID chip reads the cards as expected.
I then disconnected the RFID board from USB cable and hooked it up to the Arduino Yun board as in the image I attached.
When I touch the board with an RFID card the LED on the RFID card lights up and I get a buzzer sound, which indicates successful read. But for some reason nothing is showing in the Arduino Serial Monitor using the sketch I included in my first post.
I have an update!
I took out my old Arduino Uno and used it instead of the Yun, exact same sketch and exact same connection setup and it worked.
Does anyone know why this works on the Uno and not the Yun?
They both support interrupt on DIO pin 3, so why isn't this setup working on the Yun but is working on the Uno?
Just so you don't have to scroll up, here's the sketch working on Uno but not on Yun.
MageKirby:
They both support interrupt on DIO pin 3,
AFAIK SoftwareSerial does not need to be on an interrupt pin. Have you tried any other pins?
The Arduino side of the Yun is pretty much the same as a Leonardo. Unfortunately, however, the Yun designers decided to commandeer the HardwareSerial port for communication with the Linux side. It is possible, with a bit of effort, to get access to it.
MageKirby:
Thanks it worked on pin10 on the Yun.
I tried it on all external interrupt pins on the Yun (0,1,2,3,7) and none seems to work with the SoftwareSerial.
I was hoping it would work on the interrupt pins because the idea was to trigger an interrupt when an RFID is detected and then read it.
Try setting one of the interrupt pins as INPUT and connecting a jumper from it to pin 10 ?
What is the purpose of generating an interrupt when the first bit of data arrives? You still have to stand around and wait for the last bit to arrive. You might as well stay busy, keeping an eye on the serial buffer, reading when data has been stored in the buffer.