Tiny Core Base > Raspberry Pi
Enable UART serial communications while mainainting wifi
eSPee:
Hi all,
Can anybody help?
I found a great (silent) stepper motor driver:
TMC2209 V4.0 https://wiki.fysetc.com/Silent2209/#wiring-diagram and i would love to use this python library to run it:
https://github.com/Chr157i4n/TMC2209_Raspberry_Pi especially for enabling the stallguard functionality.
The library requires the serial port to be enabled for UART communication. However i am finding this difficult to get working on the piCore 14.1 & Raspberry Pi Zero w.
In this thread enabling the serial functionality is explained: https://forum.tinycorelinux.net/index.php/topic,24825.0.html
Steps taken so far:
1. In /opt/bootlocal.sh uncommened the line that starts serial console
2. In cmdline.txt changed console to: console=serial0,115200
3. In config.txt added this at the end:
--- Code: ---[PI0]
dtoverlay=disable-bt
--- End code ---
When i get at step 3 the Pi losses wifi and i can't connect to it anymore. (It runs headless on wifi) When step3 is omitted i test the serial functionality with minicom:
--- Code: ---sudo tce-load -wi minicom
minicom -D /dev/serial0 -b 115200
--- End code ---
Which gives me an error:
--- Code: ---minicom: cannot open /dev/serial0: No such file or directory
--- End code ---
Adding
--- Code: ---enable_uart=1
--- End code ---
to config.txt doesn't seem to help either.
Can anybody point me in the right direction to get serial over UART working while mainainting wifi functionality on the raspberry pi zero w?
Many thnx!
Paul_123:
If you want to use the serial port for your program, you need to disable the serial console.
eSPee:
Thnx Paul! ;)
The UART is now working. What i did:
1. Added this to config.txt:
--- Code: ---enable_uart=1
--- End code ---
2. Changed the console entry in cmdline.txt to (not sure if this is actual required):
--- Code: ---serial0,115200
--- End code ---
No other changes were made. I tested the UART communications with a USB to TTL adapter (FTD1232).
I can connect by SSH through Wifi and from there send commands to the UART serial port:
--- Code: ---echo "Hello!" > /dev/ttyS0
--- End code ---
Which shows up in the serial port console.
Unfortunately, it is not possible to send commands from the serial port console to the raspberry.
Does anybody know if / how this can be enabled?
Paul_123:
From cmdline, it is only a readonly console. You need to attach getty to the serial port to be able use it.
I think there is a script called startserialconsole to facilitate this. But it may need tweaked for your port
Paul_123:
Just looked at the startserialtty script. It was never updated for the pi4/cm4/pi5 but it should work for the zero
Make sure you have read through this https://www.raspberrypi.com/documentation/computers/configuration.html#configure-uarts
Navigation
[0] Message Index
[#] Next page
Go to full version