Home › Forums › Raspberry Pi Compatible Compiler for LabVIEW Forum › Raspberry Pi Compatible Compiler for LabVIEW Support Forum › Can't get Serial to work
April 7, 2017 at 7:11 am #1541
I am trying to get RS-232 communications established with my PC. I have a level shifter connected but I do not see any activity on the TX GPIO line.
Couldn’t get my RPi3 to either send or receive characters.
Modified the serial loop back to continuously send a character (serial send.png). I set the VISA resource name to /dev/ttyAMAO.
See no activity on my scope on PIN 08 (GPIO14) . I have tried this without setting the GPIO pin to an output.
a ls /dev/tty* shows ttyAMAO as a device.
Attachments:You must be logged in to view attached files.April 7, 2017 at 7:19 am #1543
It is hard for me to help much without having the setup here (it is specially hard to support HW related topics), but maybe you can use some of the tips on this article (http://elinux.org/Serial_port_programming) on how to debug the Pi’s serial port to make sure all is configured correctly before you dive into LabVIEW. Breaking down the problem into smaller chunks usually help narrowing down at least where the problem is.
Hope this helps some.April 7, 2017 at 2:41 pm #1544
I understand. Surely someone in this forum has done this. So I followed your link and am now using Python I installed python-serial as instructed, ran their program. Then I modified it to (below the initial code). So I think I am writing test every 100 msec.
port = serial.Serial(“/dev/ttyAMA0”, baudrate=115200, timeout=3.0)
rcv = port.read(10)
port.write(“\r\nYou sent:” + repr(rcv))
port = serial.Serial(“/dev/ttyAMA0”, baudrate=9600, timeout=.1)
I run this and I am looking for any characters (with scope) coming out of GPIO 14 pin 08.
Any help is appreciated guysApril 9, 2017 at 3:14 am #1545
To work with serial, follow instructions below.
To get the serial port working on all model Pi’s with Jessie from May 2016 or later, add: enable_uart=1
to the end of the “/boot/config.txt” file, and refer to the serial port as “/dev/serial0” in your code. sudo nano /boot/config.txt
If you wish to communicate with with anything other than a terminal, remove the phrase: console=serial0,115200
from the file “/boot/cmdline.txt”. Note that “cmdline.txt” is just that, a single line, do not split it into more than one line. sudo nano /boot/cmdline.txt
VladoApril 10, 2017 at 9:02 am #1546
Thanks. I have characters coming out, now I just need to get the level shifting working.
GregApril 12, 2017 at 9:03 pm #1548
Any progress?April 13, 2017 at 3:47 am #1549
For the moment I have given up and am trying to use Arduino for now. Prior to your last post I read a number of posts about the serial port on Raspberry Pi 3. What it looks like is the “problem” I am having stems from the RPi3 using the “hard” serial port for BlueTooth.
On my Pi I do a ls /dev/tty* and the list of devices comes back without ….serial0 listed. I use /dev/ttyS0. On my receiving end I am not capturing any characters even though the “1” character I am using looks correct on the scope. On the Pi end when I send a “1” character the Pi crashes, i.e. I get a python error.
Where I left off is I suspect I may need to actively disable Bluetooth in config and secondly I need to look at the level shifting a again.April 26, 2017 at 2:58 pm #1562
The workaround is to run sudo raspi-config then disable the serial port, reboot, reenable and reboot.June 26, 2017 at 12:24 am #1922
I had success on Ras Pi 3 using :
enabling UART=1 in the config
+ disabing the Bluetooth port
I forget the exact procedure, mostly just googled my way to success, I have next to no knowledge of Linux.
/sørenOctober 9, 2019 at 3:25 pm #4031
I am having problem with the Data bit staying at 7. The front panel says 7 but the information on the screen is 8. I tested the USB device with Putty and it does work properly.
Is this something that anyone has found how to control?
You must be logged in to reply to this topic.