Tiny Core Base > Raspberry Pi
Enable UART serial communications while mainainting wifi
eSPee:
Hi Paul,
Again, thnx for helping. Reading the document i did try some other settings, however with no result.
Straightly enough (when i just about thinking to just give up) the driver communication worked one time!
--- Code: ---tc@testpi:~/www/TMC2209$ sudo python3 debug_script_01_uart_connection.py
---
SCRIPT START
---
2024-10-06 11:49:52,192 - TMC2209 0 - INFO - Init
2024-10-06 11:49:52,196 - TMC2209 0 - INFO - GPIO Init finished
2024-10-06 11:49:52,198 - TMC2209 0 - INFO - Init finished
---
---
2024-10-06 11:49:52,219 - TMC2209 0 - INFO - ---
2024-10-06 11:49:52,227 - TMC2209 0 - INFO - TEST UART
2024-10-06 11:49:52,242 - TMC2209 0 - DEBUG - received 12 bytes; 96 bits
2024-10-06 11:49:52,244 - TMC2209 0 - DEBUG - hex: 550006e81b5b30313b33326d
2024-10-06 11:49:52,246 - TMC2209 0 - DEBUG - bin: 010101010000000000000110111010000001101101011011001100000011000100111011001100110011001001101101
2024-10-06 11:49:52,254 - TMC2209 0 - DEBUG - length snd: 4
2024-10-06 11:49:52,262 - TMC2209 0 - DEBUG - length rtn: 12
2024-10-06 11:49:52,268 - TMC2209 0 - DEBUG - complete messages:
2024-10-06 11:49:52,274 - TMC2209 0 - DEBUG - 550006e8
2024-10-06 11:49:52,282 - TMC2209 0 - DEBUG - 550006e81b5b30313b33326d
2024-10-06 11:49:52,288 - TMC2209 0 - DEBUG - just the first 4 bits:
2024-10-06 11:49:52,295 - TMC2209 0 - DEBUG - 550006e8
2024-10-06 11:49:52,301 - TMC2209 0 - DEBUG - 550006e8
2024-10-06 11:49:52,308 - TMC2209 0 - DEBUG - the Raspberry Pi received the sent
bits and the answer from the TMC
2024-10-06 11:49:52,317 - TMC2209 0 - DEBUG - the Raspberry Pi received exactly the bits it has send.
the first 4 bits are the same
2024-10-06 11:49:52,327 - TMC2209 0 - INFO - ---
2024-10-06 11:49:52,334 - TMC2209 0 - INFO - UART connection: OK
2024-10-06 11:49:52,340 - TMC2209 0 - INFO - ---
---
---
2024-10-06 11:49:52,353 - TMC2209 0 - INFO - Deinit
2024-10-06 11:49:52,359 - TMC2209 0 - INFO - Motor output active: False
2024-10-06 11:49:52,365 - TMC2209 0 - INFO - GPIO cleanup
2024-10-06 11:49:52,373 - TMC2209 0 - INFO - Deinit finished
---
SCRIPT FINISHED
---
--- End code ---
a second later it didn't work anymore... ??? :o
--- Code: ---tc@testpi:~/www/TMC2209$ sudo python3 debug_script_01_uart_connection.py
---
SCRIPT START
---
2024-10-06 11:50:26,716 - TMC2209 0 - INFO - Init
2024-10-06 11:50:26,725 - TMC2209 0 - INFO - GPIO Init finished
2024-10-06 11:50:26,733 - TMC2209 0 - INFO - Init finished
---
---
2024-10-06 11:50:26,751 - TMC2209 0 - INFO - ---
2024-10-06 11:50:26,758 - TMC2209 0 - INFO - TEST UART
2024-10-06 11:50:26,773 - TMC2209 0 - DEBUG - received 12 bytes; 96 bits
2024-10-06 11:50:26,779 - TMC2209 0 - DEBUG - hex: 6d20306d306d306d306d306d
2024-10-06 11:50:26,787 - TMC2209 0 - DEBUG - bin: 011011010010000000110000011011010011000001101101001100000110110100110000011011010011000001101101
2024-10-06 11:50:26,798 - TMC2209 0 - DEBUG - length snd: 4
2024-10-06 11:50:26,800 - TMC2209 0 - DEBUG - length rtn: 12
2024-10-06 11:50:26,802 - TMC2209 0 - DEBUG - complete messages:
2024-10-06 11:50:26,803 - TMC2209 0 - DEBUG - 550006e8
2024-10-06 11:50:26,805 - TMC2209 0 - DEBUG - 6d20306d306d306d306d306d
2024-10-06 11:50:26,806 - TMC2209 0 - DEBUG - just the first 4 bits:
2024-10-06 11:50:26,808 - TMC2209 0 - DEBUG - 550006e8
2024-10-06 11:50:26,823 - TMC2209 0 - DEBUG - 6d20306d
2024-10-06 11:50:26,830 - TMC2209 0 - DEBUG - the Raspberry Pi received the sent
bits and the answer from the TMC
2024-10-06 11:50:26,839 - TMC2209 0 - DEBUG - the Raspberry Pi did not received the bits it has send.
the first 4 bits are different
2024-10-06 11:50:26,847 - TMC2209 0 - INFO - ---
2024-10-06 11:50:26,855 - TMC2209 0 - ERROR - UART connection: not OK
2024-10-06 11:50:26,862 - TMC2209 0 - INFO - ---
---
---
2024-10-06 11:50:26,875 - TMC2209 0 - INFO - Deinit
2024-10-06 11:50:26,880 - TMC2209 0 - INFO - Motor output active: False
2024-10-06 11:50:26,886 - TMC2209 0 - INFO - GPIO cleanup
2024-10-06 11:50:26,895 - TMC2209 0 - INFO - Deinit finished
---
SCRIPT FINISHED
---
--- End code ---
Could this be caused by a bad UART connection?
eSPee:
Or could it be that the ttyAMA0 which i am now using needs an --autologin addition somehow?
When i connect the ttl adapter to the RX & TX GPIO's it does ask for a user & psswd before any commands can be given or received.
eSPee:
Running:
--- Code: ---sudo hexdump -C /dev/ttyAMA0
--- End code ---
Confirms that indeed the ttyAMA0 asks for a user & password...
I am now checking this post https://forum.tinycorelinux.net/index.php/topic,21129.0.html to see if this can be resolved somehow. Although i am not sure if this is the actual problem communication with the TMC driver.
Just trail & error approach i am afraid :-\
Paul_123:
I think you have some confusion. If you are using a program to control the driver on the serial line, you cannot have anything else accessing the serial port. No console, no tty. Do not reference the serial port on cmdline.txt and do not start a serial tty. Just add enable_uart=1 to config.txt
Just use a normal ssh session or connect a usb keyboard and display, and run your script.
Stefann:
oops wrong thread
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version