Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uart: set baudrate as configured in config file #32

Closed
wants to merge 77 commits into from

Conversation

grischi
Copy link

@grischi grischi commented Sep 27, 2024

This PR extends the method for connecting to a serially connected sbg Ellipse D with unknown baudrate. If the baudrate from the .yaml config file does not work, one after the other possible baudrate is tried. Once a baudrate is found where connecting succeeds, it is used to set the baudrate from the .yaml config file on the device and re-connect.

mzembsbg and others added 30 commits October 19, 2021 17:35
 - GPS to UTC time correctly apply leap second offset
 - GGA only sent if a valid position is available
 - GGA is sent at 1 Hz only
 - Minor improvements

Code is not yet tested nor build
Added RTCM subscriber and NMEA GGA publisher
@tolesam
Copy link

tolesam commented Oct 1, 2024

@grischi
Thanks you for your PR.

When running your solution with an Ellipse D it doesn't work as expected.
The baudrate is found but we don't receive any data from the Ellipse.
By removing the call of setDeviceBaudrate() it works.

However, having a fixed list of baudrate in the code avoids being able to update it easily.
A preferred solution would be to support a baudrate list directly in the yaml configuration file so each user can define the baudrates he wants to test.
For example you could have the following configuration and then test for only 921600 and 115200 baudrates that would match with the desired and the default baudrates.

[...]
baudRate:
    - 921600
    - 115200
[...]

Moreover that would allow to extend with new possible values without having to build a new firmware.

@grischi
Copy link
Author

grischi commented Oct 2, 2024

Hi @tolesam ,

I was able to reproduce the problem on our side and pushed a fix, so setting the baudrate shall now work.

@tolesam
Copy link

tolesam commented Oct 21, 2024

@grischi
Thank you, however fallback baudrates are still hardcoded and then avoid to make it evolved using the configuration only.
Could you change to support the following in the configuration file and then remove hardcoded baurates list:

      # Baud rate (4800 ,9600 ,19200 ,38400 ,115200 [default],230400 ,460800 ,921600)
      baudRate: 115200

      # Fallback baud rates to test if baudRate doesn't work
      fallbackBaudRates:
        - 115200
        - 921600

@grischi
Copy link
Author

grischi commented Dec 2, 2024

replaced with #41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants