I am not able to use ttyAMA0 serial port on the RaspberryPi3 from a cpp app when I build the image by using Yocto. If I use the original Raspbian image, on the same hw, then it works perfectly.
I followed the indication on meta-raspberrypi docs
docs
by adding
ENABLE_UART = '1'
and SERIAL_CONSOLE = '115200 tty1' ( to redirect to another tty the console )
and MACHINE_FEATURES += " pi3-disable-bt"
but nevertheless the RaspberryPi is not moving the UART_TX0 pin when I try sending some data to the uart. this instead works correctly with the original Raspbian image.
What should I add or modify ? it is not clear nor there is other documentation about this.
Usually the Raspberry Pi 3 has two serial ports, one via UART and the other on the GPIO pins. The first one has it's name commonly known as "ttyAMA0" the second one uses the name.
Try one of them if doesn't work you will have to look the name that it's being recognised and use it as your device name.
ls /dev/serial/by-id/
My device is a ARPI600 and when I connect it I setup my serial communication like this
serial.Serial("/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0", baudrate=115200, timeout=1.0)
Related
I am trying to integrate an RFID1356MIFARE, which uses NXP PN532, with an ESP32-EVB using their UART capabilities.
The NXP docs states that the PN532 is able to communicate on High Speed UART.
I am trying to use 38400 because that's the baud rate fixed by the reader that I'm using.
I've found a modified Adafruit PN532 library that added HSU support. This library states that HSU uses 115200 baud rate.
Now, I've modified PN532_HSU.cpp, where we can find:
void PN532_HSU::begin()
{
_serial->begin(115200);
}
into
void PN532_HSU::begin()
{
_serial->begin(38400, SERIAL_8N1, 36, 4);
}
Unfortunately, I haven't been able to establish communication between the reader and the ESP using this method.
I am able to get a readable output using normal Serial.read(), so UART communication works, but that's not how you read MIFARE cards.
I don't know what the problem is.
What do you think ?
[EDIT]
I went through the documentation and here is what i suggest: If you have a USB to serial device use it to directly connect reader module to computer else connect it directly using mini USB port in module. the follow following steps:
Put device in UART/ USB CDC mode depending on how you connected device to computer. Exact method to do this is provided in operation section of documentation
Use picoterm / screen or other serial terminal (if you are using Linux) or just use Arduino serial monitor with correct baud rate to connect device.(115200 for USB and 38400 for UART)
Type in commands listed in COMMAND SET FOR CDC AND UART MODE section in documentation to check if module is working or not.
Place some cards over reader to check what response does module sends when card is detected.
Use this information to develop your own library for reader.
It will not work with regular PN532 libraries. Instead you'll need to use regular Serial read and write to communicate.
[Original]
PN532 datasheet says host interface is selected by pulling up/down I0, I1 pins of device. For HSU both pins must be pulled down. This is implemented in hardware so you need to verify if the mode you want to use is set.
Looking into the link you posted for module, it says that it uses another micro-controller on board to extend communication capabilities, so maybe you need to use driver for that specific controller firmware? The link seems to have document explaining how to setup different communication system in Document section, please have a look there and check if it works.
Link: https://www.olimex.com/wiki/MOD-RFID1356MIFARE
I possess the USRP X310 with a Basic TX daughterboard installed. My plan is to use it via 10GbE together with LabView with a Win10 host machine.
I have connected the SDR with an Ethernet cable using Port 0 and the included SFP adapter to my host PC's (1GbE) ethernet interface for network testing purposes. The ethernet adapter is configured to use the static IP 192.168.10.1. Furthermore I have installed the UHD (uhd_3.15.0.0-release_Winx64_VS2017.exe). However when the device is connected and powered on, I can neither ping 198.168.10.2 nor detect it running the uhd_find_devices.exe. I have also started the NI-USRP Configuration Utility which I recently updated but it was not able to detect the SDR either. I do observe that none of the LEDs on the back is illuminated (especially not the Port 0 ethernet).
How can I get it working?
If you've worked with other usrps (I have a few), then you'll find the X310 to be somewhat different, to the lower models.
Anyway, there are different fpga loads / images, which corrospond to whether you are trying to connect via a 1G or 10G module.
"The PCIe interface is always available regardless of what FPGA image is loaded. Ettus ships two FPGA image variants, the HG or HGS image which has one 1 GigE interfaces and one 10 GigE interfaces, and the XG image which has two 10 GigE interfaces.
So you need to be sure you have the right image to connect to it via 1GE... or I expect it won't work, as it seems to be.
HTH's.
I want to connect the module HC05 (with UART protocol) to Raspberry pi and see the receiving result on wxwidgets (code-blocks GUI).
where can i write UART code in wxwidgets?
How can i write each protocol in wxwidgets?
wxWidgets doesn't provide a uniform API for communicating with serial ports, as explained here.
The Raspberry Pi is typically running a Linux distribution where serial ports are exposed as special device files such as /dev/stty0. Consult your favorite Linux/Raspberry Pi documentation for information on how to configure serial port parameters. Once configured, just read/write to the file in order to communicate with whatever devices is attached to the port.
I'm trying to create serial communication in NetBSD. This
communication will connect the computer with a controller via RS-485.
The problem is that I don't know if it necessary some configuration or driver to do it.
Specifically, the communication will be through the RS-485 port. I've tried to use /dev/tty01, but there are no pulses in serial output.
Are there some configurations , drivers or codes necessary to open, send and receive serial data in NetBSD?
I didn't have sucess until now.
Thanks
Nothing special needed.
If your serial is a real serial, then you could connect via:
# cu -l /dev/tty00
if your serial is a serial over USB then:
# cu -l /dev/ttyU0
However in both cases you have to be root, or change permissions on the device.
If the output is not visible, then adjust the speed with -s switch.
I want to turn ON/OFF some port bits on ttyS2 suspend/resume scenario but from driver code it is difficult to find code stub where I can check for ttyS2 and set/unset bits on suspend/resume.
Can anyone point be specific location or logic where i can decode port name and do specific action?
You should do it in user space.
One can look for driver name using "kobject_name" as registered by device driver. For serial driver we get tty instance number on specific platform.