Replies: 4 comments 2 replies
-
|
v3.0.x have not been supported for a couple of years, please update to the newest version. Logging was quite different in v3.0 as farcas I remember in never versions pymodbus have a call to activate logging, and the will log all calls. |
Beta Was this translation helpful? Give feedback.
-
|
Hey,
thanks for the information.
I tried to update. The old systems runs well.
The new is the problem!
A:
It seems, there is a diffent in logging using read or write register.
That hard to understand.
B:
Please can you explain the logging lines?
The hex dump show as adress: 0xc9 while device_id , in next line is zero ???
Is this a problem of understanding from my side, or whats the background ??
Thanks for any hint
JR
…________________________________
Von: jan iversen ***@***.***>
Gesendet: Mittwoch, 26. November 2025 07:29
An: pymodbus-dev/pymodbus ***@***.***>
Cc: JoRi4711 ***@***.***>; Author ***@***.***>
Betreff: Re: [pymodbus-dev/pymodbus] Logging changed (Discussion #2810)
v3.0.x have not been supported for a couple of years, please update to the newest version.
Logging was quite different in v3.0 as farcas I remember in never versions pymodbus have a call to activate logging, and the will log all calls.
—
Reply to this email directly, view it on GitHub<#2810 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/B2WC5IZ5AIS27LJW5NPFD7D36VJGLAVCNFSM6AAAAACNF7LVHSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKMBYGMZDKMA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Sorry,
the log in the file are writen from pymodbus 3.11.3
By problem of understanding:
Hey Dump seems ok
But second line is wrong ..... (see device_id)
Why ?
JR
…________________________________
Von: jan iversen ***@***.***>
Gesendet: Mittwoch, 26. November 2025 08:54
An: pymodbus-dev/pymodbus ***@***.***>
Cc: JoRi4711 ***@***.***>; Author ***@***.***>
Betreff: Re: [pymodbus-dev/pymodbus] Logging changed (Discussion #2810)
I cannot explain the old logs.
—
Reply to this email directly, view it on GitHub<#2810 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/B2WC5I6IWFLAQB2I2SEE6GT36VTFJAVCNFSM6AAAAACNF7LVHSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKMBYGM4TQMY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
It does not seem correct that it is 3.11 because then there would be logging for the read as well. You have removed a number of debug lines, however first line is what is being converted to a pdu (basically the payload). dev_id im line 2 is correct that is what the library returns (meaning broadcast). you know which device you requested so absolutely no reason to return it. Please remember debug log is for developers, and if you look en at the same log lines on the server side dev_id would be filled out. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I run pymodbus 3.0 for a long time and updateing the OS, I try to change all python modules too,
But it does not work.
I read the change.logs, and I change from unit o device_id in the call,
But I'm not able to run the old code.
So I activate the "old" logging:
For Reading Request, there is not logging ..?
And for write_register I get 2 logging line, while I expect a lot more. But these two line confused me:
2025-11-25 09:24:14,459 MainThread DEBUG base :72 Processing: 0xc9 0x6 0x0 0x0 0x0 0x0 0x99 0x82
2025-11-25 09:24:14,460 MainThread DEBUG decoders :79 decoded PDU function_code(6 sub -1) -> WriteSingleRegisterResponse(dev_id=0, transaction_id=0, address
From my understanding; first line logs the hexdump of the pdu-Frame
Decond line is interpretation: But why is device_id = 0 ???? In Hexdump, we see excactly 0xc9, witch is the right adress.
Thats the logging:
import logging
FORMAT = ('%(asctime)-15s %(threadName)-15s '
'%(levelname)-8s %(module)-15s:%(lineno)-8s %(message)s')
logging.basicConfig(format=FORMAT)
log = logging.getLogger()
log.setLevel(logging.DEBUG)
Thats the function code:
def qxdo24_setDuty ( client, io, wert ):
lunit = int(config_tempctl.ADDR_QXDO24)
val = int(wert * 10)
reg = 0x0
reg += io -1
print( "Set Unit= " + str(lunit) + " Reg: " + str(reg) + " Val: " + str(val) )
client.write_register(reg, val, device_id=lunit)
return()
and thats the createn on the connection:
client = ModbusClient(
#method = 'rtu'
framer = 'rtu'
,port=config_tempctl.port
,baudrate=baudrate
,parity = 'N'
,bytesize = 8
,stopbits = 1
,timeout=2
war 2 Sek
)
connection = client.connect()
if connection is None:
print ( "Fehler RTU Connection" )
# log_msg( "E","0", "0", "Fehler RTU Connect" )
exit ()
Where is my mistake.
The code runs on 3.0.2 on older python3 ...
So i'm confused.....
Please give me a hint for understanding
Thanks
JR
Beta Was this translation helpful? Give feedback.
All reactions