Hot answers tagged

16 votes
Accepted

PiGPIO Library Example for Bit-Banging a UART

Here is some Python I used to test the reliability of software serial. The input side is fairly trivial. You just make the appropriate bit bang serial open calls in Python or C. The output side is ...
  • 68.3k
13 votes

Pi 4 I/O interface options... and where to find them

The preliminary Raspberry Pi 4 Model B datasheet, section "5.1.1 GPIO Pin Assignments" says: As well as being able to be used as straightforward software controlled input and output (with ...
  • 15.6k
13 votes
Accepted

Where are the uarts on the raspberry pi 4?

The preliminary Pi4 datasheet shows there are 6 UARTs. UART GPIO 0 14/15 1 14/15 2 0/1 3 4/5 4 8/9 5 12/13 Given that UART 0/1 are both connected to the same GPIO you can only use ...
  • 68.3k
11 votes
Accepted

Bit waveform clarification

To me it looks like ser.write(1) has an implicit conversion to string. So your 1 becomes a "1" which is 00110001, which perfectly fits into your observation.
  • 2,682
9 votes
Accepted

Disable DTR on ttyUSB0

The properties of a USB serial converter have nothing to do with the hardware of the hosting system, but only with the USB serial chip itself, and the software stack of the hosting system. The pi ...
8 votes

Binary garbage on the UART when powering the RPi

The Pi's UART has a fault (in the firmware). Whenever the port is opened there is a 30 µs low glitch on TXD. See http://elinux.org/RPi_Serial_Connection#Unwanted_serial_garbage_input and search for ...
  • 68.3k
7 votes

How to get more than one uart interface

The Raspberry Pi 4 supports up to 4 UART interfaces now that need to be enabled by means of an device tree overlay. You can find how to do this and which Pins are used here for now: https://www....
  • 171
7 votes

True 9-bit serial port data?

My pigpio library supports reading and writing 9-bit serial data. It uses bit banging so you can use any available GPIO. If I remember correctly any speeds of 19.2 kbps or slower were pretty stable. ...
  • 68.3k
7 votes

Where are the uarts on the raspberry pi 4?

As Joan has stated only 1 of UART0/1 is accessible (UART0 /dev/ttyAMA0 is connected to Bluetooth on later model Pi). There are additional UART on the Pi4. Raspberry Pi4 UART is a more up to date ...
  • 55.5k
6 votes

Disable DTR on ttyUSB0

@ChrisStrattons post describes how to use stty -F /dev/ttyUSB0 to avoid the hangup which results in a reset. Here is a snippet to do it in Python: import termios path = '/dev/ttyACM0' # Disable ...
  • 1,481
6 votes

How to connect SIM800 GSM ADD-ON to RaspberryPi 3

Assuming you are talking about one of these that looks like this you should go over this to test your device. From what I can see This device communicates over serial port (USART) using board pins ...
5 votes
Accepted

Why am I seeing some garbage bytes at the serial console login?

This is probably the well known bug of the spurious character when the serial port is opened. I don't remember the details, something to do with the TX line dropping for an instant so signalling a ...
  • 68.3k
5 votes

How to connect SIM800 GSM ADD-ON to RaspberryPi 3

I was having trouble making my SIM800 hat work with my Raspberry Pi Zero W; I thought it could be because of burnt gpios... So I tried with my Raspberry Pi 3. Same trouble. I then found this solution ...
  • 51
5 votes

Is Fingerprint Scanner TTL (GT-511C3) compatible with Raspberry Pi Zero?

This Fingerprint Scanner is compatible with the Raspberry Pi Zero. As it uses UART to interface. Amazon.com says the fingerprint scanner uses, "Simple UART protocol (Default 9600 baud)". Since the ...
5 votes
Accepted

software solution for non-blocking UART communications

This is not correct. Even single core CPUs are capable of running multiple processes giving them short time window to run and then switching to next process. Also both Python and C programs are ...
5 votes

How do I use a Raspberry Pi to install OpenWrt firmware on a BT HomeHub 5a or PlusNet Hub One router

Note I am deliberately answering my own question There are lots of detailed guides out there; this is an overview of the key points particularly with respect to using a Raspberry Pi as the host. Take ...
5 votes
Accepted

multiple UARTs on the 40-pin

so where was one big misunderstandings. thanks to @joan for pointing to the docs and @tlfong01 for their link to their article: https://penzu.com/public/b94e6b30 essentially, on the raspberry 4, there ...
  • 171
4 votes

Set default baud rate on /dev/ttyAMA0 and keep after reboot

well it's an old issue, but maybe for others who are searching for a solution, just edit the crontab like follows : @reboot sudo stty -F /dev/ttyAMA0 38400 works also with other commands :)
  • 41
4 votes
Accepted

How can I test if the serial / UART is good on a Raspberry Pi?

You asked "how to test to see if the serial ports on the Pi or the adapter". It is difficult to test the adapter, as so many things are involved, but you can test the Pi serial port. You can check ...
  • 55.5k
4 votes
Accepted

cannot increase UART clock frequency

It works on a B+. I added the following line to /boot/config.txt and rebooted. init_uart_clock=64000000 I set the baud rate to (the maximum) 4000000 with stty -F /dev/ttyAMA0 4000000 I then ...
  • 68.3k
4 votes
Accepted

Adafruit Ultimate GPS HAT Connections

I believe they are referring to the pin on the hat not the pin on the Pi. If you look at the following picture . You will see pin #4 labeled in the third row of pins across the top. It is a little ...
4 votes
Accepted

How tp get USB to USB UART console without linux

Let me try to un-confuse you :) In the good old days, computers came with serial ports. The standard is known as RS232. These slowly disappeared, first from laptops and then from desktops. These days,...
  • 1,868
4 votes

What is the difference between the GPIO pins BCM 14 and BCM 18?

All GPIO pins can be either Input or Output, and many can have alternate functions. See Pinout for details of alternatives. Depending on the Pi model, Pins 8/10 (BCM 14/15) are usually configured as ...
  • 55.5k
4 votes
Accepted

What is the difference between the GPIO pins BCM 14 and BCM 18?

All of the GPIO pins can be configured for different purposes. At their simplest they can all act as general purpose input/output (hence the name). This means they can be set to act as an outputs, ...
4 votes

Connect sim800 to Raspberry PI (RX, TX)

The circuit as shown will not work as there is no common voltage reference between the SIM and the Pi. You need to connect a Pi ground to either the SIM ground or to the battery ground (-ve terminal)....
  • 68.3k
4 votes

Connect sim800 to Raspberry PI (RX, TX)

Just yesterday I managed to make my assembly respond. Here are my steps: Disable Serial Console sudo raspi-config --> Interfaces --> Serial --> No to 1st prompt; Yes for the 2nd Use "serial0" instead ...
  • 41
4 votes
Accepted

Read & Write on UART don't work

Isn't /dev/ttyAMA0 used for Bluetooth on the Raspberry Pi3? You may need to use /dev/ttyS0 or /dev/serial1 on the Pi3 (check in /boot/overlays/README).
  • 68.3k
4 votes
Accepted

Can I use the TX/RX pins and the USB ports for multiple serial devices?

You can use multiple USB serial dongles. They will appear as /dev/ttyUSBx where x will be a small number such as 0, 1, 2. You can use any serial software you want. They will all use the Linux ...
  • 68.3k
4 votes

Disable UART such that it will not be on during the boot process, but only after

You can solve this by setting the bootdelay of u-boot to -2 using the u-boot console: setenv bootdelay=-2 saveenv Another solution is adding these lines of code to include/configs/rpi.h: #define ...
4 votes
Accepted

UART RX stops reading data after working correctly

Check if you have disabled the login prompt on /dev/serial0. What you see may be due to two processes (your script and getty) reading from the same port. Login prompt on serial port can be disabled ...

Only top scored, non community-wiki answers of a minimum length are eligible