Hello I dont know how to read the Error out of the Program ich tried this.
ErrorLog = can.get_error_log()
print(str(ErrorLog))
the answer is this:
ErrorLoG:
ErrorLog(transceiver_state=0, transceiver_write_error_level=0, transceiver_read_error_level=0, transceiver_stuffing_error_count=0, transceiver_format_error_count=0, transceiver_ack_error_count=0, transceiver_bit1_error_count=197, transceiver_bit0_error_count=0, transceiver_crc_error_count=0, write_buffer_timeout_error_count=0, read_buffer_overflow_error_count=0, read_buffer_overflow_error_occurred=(False, False), read_backlog_overflow_error_count=0)
Press key to exit
When i have an Error on the CAN Brick V2 (Red LED is on), i want to reset the Brick or if anyboday has an idear how to solve this?
If i have an erroe i tried this:
HOST = "localhost"
PORT = 4223
UID_can = "can" # Change XYZ to the UID of your CAN In Bricklet 2.0
from tinkerforge.bricklet_can_v2 import BrickletCANV2
from tinkerforge.ip_connection import IPConnection
ipcon = IPConnection() # Create IP connection
can = BrickletCANV2(UID_can, ipcon)
Reset = can.reset()
HOST = "localhost"
PORT = 4223
UID_can = "can" # Change XYZ to the UID of your CAN In Bricklet 2.0
from tinkerforge.bricklet_can_v2 import BrickletCANV2
from tinkerforge.ip_connection import IPConnection
ipcon = IPConnection() # Create IP connection
can = BrickletCANV2(UID_can, ipcon)
But i get an Error (I deletet my folder ;)):
Traceback (most recent call last):
File "C:/Users/.../ErrorLogTest.py", line 8, in <module>
Reset = can.reset()
File "C:/Users/...\tinkerforge\bricklet_can_v2.py", line 697, in reset
self.check_validity()
File "C:/Users/...\tinkerforge\ip_connection.py", line 506, in check_validity
device_identifier = self.ipcon.send_request(self, 255, (), '', 33, '8s 8s c 3B 3B H')[5] # <device>.get_identity
File "C:/Users/...\tinkerforge\ip_connection.py", line 1302, in send_request
self.send(request)
File "C:/Users/...\tinkerforge\ip_connection.py", line 1274, in send
raise Error(Error.NOT_CONNECTED, 'Not connected')
tinkerforge.ip_connection.Error: Not connected (-8)
So anybody can help me with this problem?