Tic 825 example code

i am trying to run “12.9. Example I²C code for Linux in Python” code on my ubuntu machine.
install tic software,installed smbus2.
getting this error.
any help would be appreciated .

Traceback (most recent call last):
File “./stepper.py”, line 64, in
position = tic.get_current_position()
File “./stepper.py”, line 50, in get_current_position
b = self.get_variables(0x22, 4)
File “./stepper.py”, line 45, in get_variables
self.bus.i2c_rdwr(write, read)
File “/home/ravi/miniconda3/lib/python3.8/site-packages/smbus2/smbus2.py”, line 658, in i2c_rdwr
ioctl(self.fd, I2C_RDWR, ioctl_data)
OSError: [Errno 6] No such device or address


Can you post pictures clearly showing how you have the Tic T825 stepper motor controller connected to your Ubuntu machine? Also, can you run ls /dev/i2c* and post the results here? Did you make any changes to the example I2C code for Linux in Python?

- Amanda

Hi Amanda, Thanks for quick response.
posting some pictures of tic connections. running run ls /dev/i2c* gives me below.
/dev/i2c-0 /dev/i2c-1 /dev/i2c-2 /dev/i2c-3 /dev/i2c-4 /dev/i2c-5 /dev/i2c-6 /dev/i2c-7 /dev/i2c-8 /dev/i2c-9
and haven’t made any changes, apart from changing ‘bus and address’ still not sure how we determine those values.

There are no I2C connections between the Tic and your laptop; the only connection between the Tic and laptop is the USB cable, which is not the same interface. You can learn about the Tic’s I2C interface under the “Setting up I2C control” section in the Tic Stepper Motor Controller User’s Guide. If you want to control the Tic via its USB interface, then the easiest way is to use the Pololu Tic Control Center. If you want to write your own program, you can invoke the Tic Command-line Utility (ticcmd) in your code. For more information on writing software for the Tic, see the “Writing PC software to control the Tic” section in the user’s guide.

- Amanda