I installed lineage os 14 on raspberry pi 3 I connected a gps module with UART port, however, the baud rate of GPS is 9600 but baud rate of /dev/ttyS0 is 115200 I want to change the baud rate of ttyS0 in order to read GPS data I tried stty command

stty -F /dev/ttyS0 9600

However, this won't change the baud rate when I check again with this command
stty -F /dev/ttyS0 the speed value is 115200. How can I change the baud rate of /dev/ttyS0 I also find some solution with serial command serial /dev/ttyS0 9600 however it doesn't exist on adb shell.Any help would be grateful

  • Why don't you set it up in the code that reads the GPS data? – Seamus Jul 8 '18 at 21:27
  • OK, just saw the lineage os 14 in your post - sorry for the oversight. I can't help you with lineage, but you should read the organization's UART documentation as it may "change things" :) – Seamus Jul 8 '18 at 21:44
  • And finally, FWIW, in Raspbian I can change the speed to 9600 using (nearly) the same command you used: sudo stty -F /dev/ttyS0 9600. Verified using $ sudo stty -F /dev/ttyS0 -a -> speed 9600 baud; ..... etc – Seamus Jul 8 '18 at 22:22
  • @Seamus I used your solution but it didn't work stty: invalid number 'baud' I even add a quotation mark for solving this error, the command successfully executed however it doesn't change the baud rate – Daniel.V Jul 10 '18 at 10:24
  • Sorry... must be due to diffs between the lineageos and Raspbian os. If the organization's UART documentation didn't explain anything, then I'm afraid I am not equipped to provide any help. – Seamus Jul 10 '18 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.