Configure Serial Raspberry Pi 4B - UART - GPIO 14 and 15

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody so this video covers how to check raspberry pi revision number and board version and how to configure uart serial communication on the raspberry pi 4. okay so the first thing to do is you name space hyphen a and that'll tell you linux pi4 so you can verify that you're on the correct version of next command you want to type is cat so if you're familiar with linux or even windows these days cat displays contents of a file and this particular file is actually proc forward slash device hyphen tree forward slash model so cat space forward slash proc forward slash device hyphen tree forward slash model and there we go raspberry pi 4 model b revision 1.2 so next we want to look at the pin out so believe it or not you type you type pin out hit enter and there we go and if i just make that a little bit larger you'll see you've got all of the pinots and you can see the voltages which is important because don't use 5 volts for your usb it'll damage your pi so there we go there's the board and obviously that um image there you just need to rotate and you want the okay you got your two red ones there correspond to those two red ones there so that's pretty good pin outs so that's how to check everything on the raspberry pi next we need to look at how to configure serial in brackets uart okay so next we want to check the config of the pi so we do sudo your language and there we go we have raspberry pi 4 model 1 b rev 1.2 and we want to go to okay next so we do sudo space rust spy config and should get a screen which looks like this and then we need to go using the down arrow on your keyboard go to number three interface options hit enter then down arrow again down to number six serial ports and would you like a login shell to be accessible over serial and you'll press tab to take it away from the default onto no press enter would you like the serial port hardware to be enabled and then it's on yes so then you click yes the serial login shell is disabled the serial interface is enabled okay so then the next thing hit ok and then if you're happy with that which you should be click finish and it will tell you that you need to reboot so i'm just going to hit enter and i'll resume when the raspberry pi has rebooted okay so a few minutes later the pi is back up and just to check you need to then just do tail space forward slash boot forward slash config.txt hit enter and you should just see at the very last line enable underscore uart equals one is meaning that uart serial communication is now enabled okay next we need to actually identify the device so if we do ls space hyphen l space forward slash dev forward slash lowercase t with asterisk for world card press enter and you should see down at the bottom you will have tty s0 but also you'll have a ttyam a zero and that's a legacy arm thing so let's change that okay so just to cover the difference the tty a m a zero is used to communicate with the onboard bluetooth device on a raspberry pi 3. so if you're on a raspberry pi 3 the serial port must be changed to ttys0 ttyam should also be changed to ttys0 in the following program if you're running a raspberry pi 3 and that's the example using wiring pi dot h if you're writing a c program to test with chances are you using python the other thing is if you've got a usb to serial converter you just need to install sudo apt in store minicom and then to start the adapter you do mini com space hyphen capital d and then you'll do forward slash dev forward slash tty amn ama zero so um not actually got the adapter the hand but we'll install the software anyway and there we see it working okay and then we'll just we'll start it anyway even though there's nothing connected there we go so this if i had a device connected i would then be able to send some commands and get a response so ctrl c ctrl d ctrl oh [Music] you
Info
Channel: Python 360
Views: 43,569
Rating: undefined out of 5
Keywords:
Id: oevxqPk78sM
Channel Id: undefined
Length: 7min 7sec (427 seconds)
Published: Fri Aug 13 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.