Author: Ralph Ronnquist Date: To: dng Subject: Re: [DNG] Setting serial speed on boot with daedalus on RPi
> TL;DR: how do you set serial port speed at boot? >
> Longer story, but I’m trying to set up an RPi 2 rev1.2 with Devuan
> daedalus. The purpose is to replace another RPi running RaspiOS that
> has a broken Garmin GPS used for keeping time.
>
> I’ve got a running RPi2 on RaspiOS using an Adafruit Ultimate GPS
> hat. Seems to work fine.
>
> Trying the same thing with daedalus on another RPi has been a chore.
> Lots of trial and lots of error, and in the end it works, but only
> if I set the serial speed manually (stty -F /dev/serial0 38400),
> because that’s how I set the GPS unit to match the other one that’s
> working. The daedalus boots with
>
> 9600 baud in spite of having in /boot/broadcom/config.txt:
> dtoverlay=i2c-rtc,ds1307
> enable_uart=1
> dtoverlay=disable-bt
> dtoverlay=pps-gpio,gpiopin=18
> init_uart_baud=38400
> arm_freq=800
> force_turbo=1
>
> Once the baud is set, I get PPS sync in ntp:
>
> oNMEA(0) .PPS. 1 l 10 16 377 0.0000 -0.0140 0.0010
>
> The one odd thing is that the time server setup mode for ntpsec
> doesn’t seem to match the notes: > # mode 0x11: linespeed 9600 bps, process $GPGGA
> # mode 0x31: linespeed 38400 bps, process $GPGGA
> server 127.127.20.0 mode 0x11 minpoll 4 maxpoll 4 prefer
> fudge 127.127.20.0 flag1 1 refid PPS stratum 1
>
> Since the init_uart_baud=38400 doesn’t seem to work, and I haven’t
> found where else is setting the port speed, I’m asking here.
>
> I suppose I could add: stty -F /dev/serial0 38400 to /etc/rc.local
First option if possible would perhaps be to add console=serial0,38400
to the kernel commandline.
Second option if using sysvinit would perhaps be to enable serial
console in /etc/inittab with maybe one of the following lines:
T0:23:boot:/sbin/getty -L serial0 38400
T0:23:once:/sbin/getty -L serial0 38400
T0:23:respawn:/sbin/getty -L serial0 38400
(Use the last of those if you actually use the serial console.)