Roller485 with PWRCAN and CORE
-
Hello,
I am trying to get a Roller485 to work with a POWRCAN module attached to a CORE controller but I don't seem to get it to run.
Please note that it does work over I2C.
Here's the configuration:POWERCAN:
12V, line A to line A, line B to line B, TX:G17, RX:G16, terminator enabled.
Roller485:
RS485, node #:1, 115200 Baud, MODE: SpeedI am attaching the UIFlow2 application.
Thank you for your support.import os, sys, io import M5 from M5 import * from module import PwrCANModuleRS485 from unit import Roller485Unit label0 = None pwrcan_0 = None roller485_0 = None def setup(): global label0, pwrcan_0, roller485_0 M5.begin() Widgets.setRotation(1) Widgets.fillScreen(0x222222) label0 = Widgets.Label("label0", 38, 38, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18) pwrcan_0 = PwrCANModuleRS485(2, baudrate=115200, bits=8, parity=None, stop=1, tx=17, rx=16) roller485_0 = Roller485Unit(pwrcan_0, address=1, mode=Roller485Unit.RS485_MODE) def loop(): global label0, pwrcan_0, roller485_0 label0.setText(str('Label')) roller485_0.set_motor_mode(1) roller485_0.set_motor_speed(100) roller485_0.set_speed_max_current(100) if __name__ == '__main__': try: setup() while True: loop() except (Exception, KeyboardInterrupt) as e: try: from utility import print_error_msg print_error_msg(e) except ImportError: print("please update to latest firmware")
-
I also tried the example app at:
https://uiflow-micropython.readthedocs.io/en/develop/units/roller485.html
(see roller485_485_fire_example.m5f2 : https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/unit/roller485/roller485_485_fire_example.m5f2)but it errors out:
E (10676) i2c: i2c driver install error
Traceback (most recent call last):
File "<stdin>", line 67, in <module>
File "<stdin>", line 43, in setup
File "unit/roller485.py", line 127, in get_motor_mode
TypeError: 'NoneType' object isn't subscriptableIt appears that the i2c error is benign.
Your help is appreciated.
Iorex