我想通过串行连接访问 3D 打印机的床和喷嘴温度传感器数据。有人可以指导我朝着正确的方向前进吗?
谢谢!
编辑:来自打印机的响应:
Connecting to printer...
Connection response from printer:
6R7�P)��h>L�JO� � ��V�\��`�r��T �� SK�<ʪ� �>�Vw^$���|���R n�I, o�!����H>�
mx�}M#
�LYԣPh���^@ ��rp � TP�j�~1�� V6 6 � f� 6�k#���&�H".��k K2���ek�(��&��^K�k2����Ul�(� ���~N�ʈ*.�>Z��k#d$�����(� ��
��(� ��� v��
���
Asking for temperatures (M105)...
Temperature response from printer:
^CTraceback (most recent call last):
File "printer_files/serialaccess.py", line 15, in <module>
response = ser_printer.readline()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 446, in read
ready,_,_ = select.select([self.fd],[],[], self._timeout)
KeyboardInterrupt
代码向打印机询问温度值后,终端上不再有输出。我等了一会儿,然后用 control+c 杀死了它。很明显打印机正在响应连接响应,但我不确定它为什么不返回温度值。再次,非常感谢您的帮助,Demetris!