Firstly, I'm floundering and out of my depth, like a blind man in a dark room looking for a black cat that really isn't there. I've been going around in circles all day with this and have had to admit defeat after multiple failed solutions (aka guesses). Please try and keep help, if you'd be so kind, to be reasonably basic.
Situation: I'm running a 3D printer from an RPi 4b. All had been running perfectly for a year or so until today, when I changed an unrelated bit of printer hardwire. Somehow during this I have stuffed up GPIO14 and 15, which I was using to communicate with the printer (using Klipper/Mainsail). I found the stuff up using gpiotext. That shows me that everything works ... other than GPIO 14 & 15.
(Edit as I forgot to state): I'm now trying to use a different pair of pins for comms. I've picked GPIO8 & 9, but it needn't be that pair if there's a reason they can't be used.
What I had originally...
In my RPi /boot/config.txt I HAD the following:
enable_uart=1
dtoverlay=disable-bt
I've tried multiple things in the new config.txt and I think the closest I have got might be this:
enable_uart=1
dtoverlay=uart1
dtoverlay=pi3-miniuart-bt
dtoverlay=uart1,txd1_pin=8,rxd1_pin=9
dtoverlay=disable-bt
What I think I'm doing there, line by line ...
Enabling UART in general terms
Setting things to use UART1
A line that, well, just seems to need to be there but might not
Setting the pins to be GPIO8 (TX) and GPIO9 (RX)
Disabling Bluetooth, as that was there already
Additionally, in my printer.cfg, in Klipper/Mainsail, I have changed a line. Originally I had:
[mcu]
serial: /dev/ttyAMA0
baud: 250000
restart_method: command
And "/dev/ttyAMA0" now reads "/dev/ttyAMA1"
I think I need to use UART 1, and I think I can use any free GPIO pins. However, I'm finding all sorts of different advice on the net, none of which are quite my situation. The only relevant hardware change I've made is to move the TX and RX cables to those new pins.
I know this can be done, and don't want to have to cheat and buy a new RPi so I have working GPIO 14 and 15, but I've tried just about everything and can't get this going.
I'm missing something, hopefully a simple something, but just can't get it.
Help please, and let me know if there's info you need I haven't supplied. I am really floundering here.
It still doesn't work with those changes, but they leave me wondering:
Where in there is anything saying I'm using GPIO 8 & 9? With telling it nothing is it still trying to use GPIO 14 & 15?
(sorry, can't seem to put in line breaks)
– Natator Jul 20 '23 at 08:49/dev/serial0
has been in Raspbian/Raspberry Pi OS for 7 years and is the default UART on GPIO14/15. Unless you have damaged the GPIO it should work. If you WANT to use any other pins you need to clarify your question. – Milliways Jul 20 '23 at 08:52Name: uart1 Info: Change the pin usage of uart1 Load: dtoverlay=uart1,=
Params: txd1_pin GPIO pin for TXD1 (14, 32 or 40 - default )
rxd1_pin GPIO pin for RXD1 (15, 33 or 41 - default 15)
Does that mean I con only use the pins shown there, which given 14 & 15 are damaged, and I don't have GPIO 30+, leaves me still stumped.
– Natator Jul 20 '23 at 09:12