Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: extra keyword arguments given while trying to create a ModbusRTU instance #95

Open
winnieXY opened this issue Jul 16, 2024 · 0 comments

Comments

@winnieXY
Copy link

Description

I'm failing to create a ModbusRTU object on a blackpill device. See below for a minimal working example.

I would be more than happy to get some advice what's wrong here.

Reproduction steps

  1. Include umodbus as extmod within micropython
  2. Load it (working flawlessly)
  3. Try to execute the code below
    ...

MicroPython version

v.1.24.0

MicroPython board

other

MicroPython Modbus version

# e.g. v2.3.3
# use the following command to get the used version
import os
from umodbus import version
print('MicroPython infos:', os.uname())
print('Used micropthon-modbus version:', version.__version__))

MicroPython infos: (sysname='pyboard', nodename='pyboard', release='1.24.0-preview', version='v1.24.0-preview.100.g358e501e7.dirty on 2024-07-16', machine='WeAct_Core with STM32F411CE')
Used micropthon-modbus version: 2.3.7

Relevant log output

>>> ModbusRTU(addr=1, pins=(MODBUS_TX_PIN, MODBUS_RX_PIN))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "umodbus/serial.py", line 1, in __init__
  File "umodbus/serial.py", line 1, in __init__

User code

from umodbus.serial import ModbusRTU
import pyb

MODBUS_TX_PIN = pyb.Pin.board.PA15
MODBUS_RX_PIN = pyb.Pin.board.PB3

#also fails
from machine import Pin
MODBUS_TX_PIN = Pin('PA15')
MODBUS_RX_PIN = Pin('PB3')

foo = ModbusRTU(  
            addr=1,  
            pins=(MODBUS_TX_PIN, MODBUS_RX_PIN)
     )

Additional informations

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant