element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum how to use serial port in raspberry pi 3
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 24 replies
  • Answers 6 answers
  • Subscribers 679 subscribers
  • Views 5760 views
  • Users 0 members are here
  • raspberry_pi
Related

how to use serial port in raspberry pi 3

prasadjain05
prasadjain05 over 9 years ago

i had try so many code and thing but i dont get the correct answer for how to transmitter or receive the data through GPIO pin of serial port

  • Sign in to reply
  • Cancel
Parents
  • oksbwn
    0 oksbwn over 9 years ago

    gotto terminal ->type

     

    $sudo raspi-config

     

    goto advanced options->find serial

     

    Now over their make default login console through serial Disable

     

    Now your application can access the serial port.

    It works 100%.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • rew
    0 rew over 9 years ago in reply to oksbwn

    Bikash panda: Ehh. Modern versions apparently add "enable_serial=0"  to /boot/config.txt so that disables the serialport altogether. You need to check config.txt if that's ends up there, if so, and you want to use the serial port for other things, then you need to change it to =1.

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • oksbwn
    0 oksbwn over 9 years ago in reply to rew

    rew: Ya I am aware of that. But I just mentioned alternate way so that not to mess up with the text file...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rew
    0 rew over 9 years ago in reply to oksbwn

    No you're not aware of that.... raspi-config will DISABLE the serial port altogether by putting enable-serial=0 in the config file for you. Then you can no longer access the serial port hardware from the ARM side. As far as Linux is concerned the hardware has been unplugged. No "now your application can access it".

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • oksbwn
    0 oksbwn over 9 years ago in reply to rew

    image

     

    This is where you need to make it 'No' . Now any application running on your Raspberry Pi can Access the Serial Port

    And this is  "enable_uart=0" Instead of "enable_serial=0" what u have mentioned. Please check.

     

    And this works 100% with JAVA and Pi4J

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • prasadjain05
    0 prasadjain05 over 9 years ago in reply to oksbwn

    i had disable the login shell but i dont get idea how to send the data on serial port which is present on board if you can tel me how to send or receive message through UART in Rasberry pi 3

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • prasadjain05
    0 prasadjain05 over 9 years ago in reply to oksbwn

    i had disable the login shell but i dont get idea how to send the data on serial port which is present on board if you can tel me how to send or receive message through UART in Rasberry pi 3

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • oksbwn
    0 oksbwn over 9 years ago in reply to prasadjain05

    After that you can use any programming language to access the serial port depending upon what you are comfortable with.  I have not used python but have used with JAVA with Pi4J Library.

    Just google for Pi4J and that comes with a lot of descent examples.

     

    To run java application on Pi . If you are interested to give it a try you can go through my tutorial

     

    https://www.youtube.com/watch?v=kNvLRDpduYs

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • prasadjain05
    0 prasadjain05 over 9 years ago in reply to oksbwn

    your tutorial is good but you have not send that "hello world " over serial port i want to send it over serial port could you help me with it

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • oksbwn
    0 oksbwn over 9 years ago in reply to prasadjain05

    Ya sure....That video was not about serial port....I can help with that......But with JAVA only...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • prasadjain05
    0 prasadjain05 over 9 years ago in reply to oksbwn

    ok assist me for the java i can code in java

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • oksbwn
    0 oksbwn over 9 years ago in reply to prasadjain05

    Ok then download The Pi4J Project - Download

    and add it to your project. The downloaded zip folder contains nice examples for serial communication.

     

    If you can wait i am working on some tutorials around Pi4j which will be online before next week...

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago in reply to oksbwn

    Cool -> The Pi4J Project - Usage (Serial com over com port).

    C

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • oksbwn
    0 oksbwn over 9 years ago in reply to clem57

    Ya..

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • prasadjain05
    0 prasadjain05 over 9 years ago in reply to oksbwn

    i have raspberry pi 3  board so please assist me according to that  and

    thank you for everything

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • oksbwn
    0 oksbwn over 9 years ago in reply to prasadjain05

    prasadjain05 Hope you have finished with this otherwise you can check my video below for serial communication using JAVA.

     

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube