My main issue is i keep getting serial console data from the new bookworm pi on the old buster Pi
I have a set up between 2 raspberry pi model 3B+ that has been working for the last 4 years, one of the Pis has died and needs to be replaced. the orignal setup was on a buster light build of the OS which i had images saved for but they dont appear to be working on the new model 3B+ i got to replace it so Im having to rebuild everything on bookworm. everything worked fine with the old code with no issues.
on the new bookworm pi I have set it up for serial comms, i have done the raspi-config, i have modified the config.txt with the following linesi have removed the console references from the cmdline.txt file
i have disabled the bluetooth intialisation using
i have made sure that dialout is active as i have been getting serial0 permission denied messages
the old buster pi is using software serial as it has some hats that are using the software serial, it had no issues transmitting and recieving before with the old pi.
the code for the new bookworm pi is
the code for the old buster pi is
every i run the code from the old buster pi i keep getting serial console data on it,
which shouldnt be happening as i have "APPARENTLY" turned it off using raspi-config. it is also transimitting at a differnet baud rate to what i have asked it to. i have to change my read baud rate to 38400 for it to work, when 9600 worked before.
any and all help would be greatly appreciated.
I have a set up between 2 raspberry pi model 3B+ that has been working for the last 4 years, one of the Pis has died and needs to be replaced. the orignal setup was on a buster light build of the OS which i had images saved for but they dont appear to be working on the new model 3B+ i got to replace it so Im having to rebuild everything on bookworm. everything worked fine with the old code with no issues.
on the new bookworm pi I have set it up for serial comms, i have done the raspi-config, i have modified the config.txt with the following lines
Code:
enable_uart=1dtoverlay=disable-btdtparam=krnbt=off
Code:
root=PARTUUID=415b7385-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom_AU
Code:
sudo systemctl disable hciuart
on the old buster light pi i have pretty much the same setup and i know it works due to it working with the old Pi.pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi
the old buster pi is using software serial as it has some hats that are using the software serial, it had no issues transmitting and recieving before with the old pi.
the code for the new bookworm pi is
Code:
import serialimport jsonimport time as tmclass ReadSerial:def __init__(self, portin):self.port = portinself.info = Noneself.DC = Falseself.buildup = 0def read_pi(self):try:data_chunk = json.loads(self.port.readline().decode())#read data from serial as json to put back into usable listself.info = data_chunkself.buildup = 0self.DC = Falseexcept Exception as e:print(str(e))self.buildup += 1if self.buildup >= 9:self.DC= Trueprint(self.buildup)pass#for testingwhile True: temp = ReadSerial(serial.Serial("/dev/serial0", baudrate=9600, tim> temp.read_pi() print(temp.info) tm.sleep(0.1)
Code:
import pigpioimport jsonimport time as tmclass SoftSerial:def __init__(self, RX, TX):self.rxPin = RXself.txPin = TXself.send = Noneself.recieve = Noneself.serialpi = pigpio.pi()self.serialpi.set_mode(self.rxPin, pigpio.INPUT)self.serialpi.set_mode(self.txPin, pigpio.OUTPUT)pigpio.exceptions = Falseself.serialpi.bb_serial_read_close(self.rxPin)pigpio.exceptions = Trueself.baudratetx = 19200 #this baudrate is based of how slow the serial is to 9600*(210/104)self.baudraterx = 9600self.serialpi.bb_serial_read_open(self.rxPin,self.baudraterx,8)def send_line(self):self.serialpi.wave_clear()self.serialpi.wave_add_serial(self.txPin, self.baudratetx, self.send, 0, 8, 2)wid = self.serialpi.wave_create()self.serialpi.wave_send_once(wid)while self.serialpi.wave_tx_busy():tm.sleep(0.1)self.serialpi.wave_delete(wid)def soft_send(self, to_send):self.send = (json.dumps(to_send)+'\n').encode()self.send_line()tm.sleep(0.1)def soft_recieve(self):(count, data) = self.serialpi.bb_serial_read(self.rxPin)if count:#print(data)self.recieve = json.loads(data.decode())tm.sleep(0.1)#for testingtest = SoftSerial(21, 20)while 1:x = [20, 1, 0, 0]#x = "*"test.soft_send(x)input = test.soft_recieve()print(input)
Code:
bytearray(b'6828] sysrq: HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(v) show-blocked-tasks(w) dump-ftrace-buffer(z) \r\n[ 1089.677157] sysrq: HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(v) show-blocked-tasks(w) dump-ftrace-buffer(z) \r\n\x80x\x1ex\xe0x[ 1090.180416] sysrq: HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(v) show-blocked-tasks(w) dump-ftrace-buffer(z) \r\n[ 1090.280835] sysrq: HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e)
any and all help would be greatly appreciated.
Statistics: Posted by TJwarnock — Wed Jun 19, 2024 5:10 am