You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UPDATE - I've just tested it with firmware release v1.23 -0 and it works, at least the provided samples seem to.
I've tried for most of the day yesterday to get this to work with a Pico W - any examples I can find seem to use an earlier version of Micropython (Micropython v1.19.1-1008-gc046b23ea)
No matter what I do I always get this error returned. (See log output)
Reproduction steps
...
MicroPython version
v1.22.2
MicroPython board
Raspberry Pico
MicroPython Modbus version
2.3.7
Relevant log output
MPY: soft reboot
waiting for wifi connection...
waiting for wifi connection...
waiting for wifi connection...
Connected to WiFi, Pico W IP : 192.168.10.171
Traceback (most recent call last):
File "<stdin>", line 64, in<module>
File "/lib/umodbus/tcp.py", line 86, in __init__
OSError: [Errno 103] ECONNABORTED
User code
importtimefromumodbus.tcpimportTCPasModbusTCPMasterimportnetwork# =============================================# connect to a wifi networkstation=network.WLAN(network.STA_IF)
ifstation.active() andstation.isconnected():
station.disconnect()
time.sleep(1)
station.active(False)
time.sleep(1)
station.active(True)
station.connect("MY_SSID", "PASSWORD")
time.sleep(1)
whileTrue:
print('waiting for wifi connection...')
ifstation.isconnected():
print(f'Connected to WiFi, Pico W IP : {station.ifconfig()[0]}')
breaktime.sleep(1)
# TCP Slave setupport=502slave_addr=1ireg_address=0register_qty=2# IP Address of Modbus TCP Serverip='192.168.10.171'# Setup Modbus TCP Clientmodbus_client=ModbusTCPMaster(slave_ip=ip,slave_port=port,timeout=5)
print(f'Resquesting data from modbus TCP Server at {ip}:{port}')
register_value=modbus_client.read_input_registers(slave_addr, starting_addr=ireg_address, register_qty=register_qty)
print('Status of IREG from {} to {}'.format(ireg_address+register_qty, register_value))
Additional informations
No response
The text was updated successfully, but these errors were encountered:
Philj6321
changed the title
Does this require a specific micropython firmware version ?
Does this require a specific micropython firmware version ? APPARENTLY NOT
Jun 3, 2024
MPY: soft reboot
Traceback (most recent call last):
File "", line 5, in
File "/lib/umodbus/serial.py", line 19, in
ImportError: no module named 'umodbus.functions'
Description
UPDATE - I've just tested it with firmware release v1.23 -0 and it works, at least the provided samples seem to.
I've tried for most of the day yesterday to get this to work with a Pico W - any examples I can find seem to use an earlier version of Micropython (Micropython v1.19.1-1008-gc046b23ea)
No matter what I do I always get this error returned. (See log output)
Reproduction steps
...
MicroPython version
v1.22.2
MicroPython board
Raspberry Pico
MicroPython Modbus version
Relevant log output
User code
Additional informations
No response
The text was updated successfully, but these errors were encountered: