User avatar
RR4711
Topic Author
Posts: 85
Joined: 22 Feb 2018, 13:28

Bug: Modbus RTU Config disappears after Update to Stretch 06/2020

28 Jul 2020, 23:00

Hi,
I just updated my test system to the latest Stretch and Pictory 1.4.3 via apt-get update && apt-get upgrade

I wanted to see if some export bugs were fixed and was astonished to find all MODBUS related settings missing in the export and actually also in the Pictory.

After throwing the _config.rsc file into JSON Validator from https://jsonformatter.curiousconcept.com/ to make it better readable (can't that actually be stored more human readable formatted, I think the few extra kb it's worth it...) the config is actually there, but the JSON Names have some version information looking like a timestamp coded into the member names, something like:
            "data":{               "ActionId_01_ModbusRTUMaster_20180122_1_1":"1",
               "SlaveAddress_01_ModbusRTUMaster_20180122_1_1":"1",
               "SlaveIP_01_ModbusRTUMaster_20180122_1_1":"",
               "SlavePort_01_ModbusRTUMaster_20180122_1_1":"",
               "FunctionCode_01_ModbusRTUMaster_20180122_1_1":"3",
               "RegisterAddress_01_ModbusRTUMaster_20180122_1_1":"33",
               "QuantityOfRegisters_01_ModbusRTUMaster_20180122_1_1":"2",
               "ActionInterval_01_ModbusRTUMaster_20180122_1_1":"200",
               "DeviceValue_01_ModbusRTUMaster_20180122_1_1":"Reading_ID1",
               "ModbusActionStatus_01_ModbusRTUMaster_20180122_1_1":"Modbus_Action_Status_1",
               "ActionStatusReset_01_ModbusRTUMaster_20180122_1_1":"Action_Status_Reset_1",
               "ActionId_02_ModbusRTUMaster_20180122_1_1":"2",
               "SlaveAddress_02_ModbusRTUMaster_20180122_1_1":"2",
               "SlaveIP_02_ModbusRTUMaster_20180122_1_1":"",
               "SlavePort_02_ModbusRTUMaster_20180122_1_1":"",
               "FunctionCode_02_ModbusRTUMaster_20180122_1_1":"3",
               "RegisterAddress_02_ModbusRTUMaster_20180122_1_1":"33",
               "QuantityOfRegisters_02_ModbusRTUMaster_20180122_1_1":"2",
               "ActionInterval_02_ModbusRTUMaster_20180122_1_1":"200",
               "DeviceValue_02_ModbusRTUMaster_20180122_1_1":"Reading_ID2",
               "ModbusActionStatus_02_ModbusRTUMaster_20180122_1_1":"Modbus_Action_Status_2",
               "ActionStatusReset_02_ModbusRTUMaster_20180122_1_1":"Action_Status_Reset_2",
I assume the pictory 1.4.3 expects a newer JSON structure because when I save the project in Pictory 1.4.3 somehow the structure changes and those "Timestamps" disappear.
Shouldn't the old JSON be converted to the new format on apt-get upgrade update then?

At least a warning would be good. Other people may get confused, too.

Markus

P.S. My old V1.4.2 config is here: https://keeper.mpdl.mpg.de/f/9dbc7353876c4926a253/?dl=1
 
Frank
KUNBUS
Posts: 63
Joined: 09 Jan 2017, 10:46

Re: Bug: Modbus RTU Config disappears after Update to Stretch 06/2020

29 Jul 2020, 13:30

Hello Markus,

the 'timestamps' you see in the config file are simply the names of the used device configuration files (RAP files) - they have no relation to actual current system timestamps. Thank you for providing the download of your old _config.rsc file.

Please replace the file

/var/www/pictory/resources/data/js/main.js

with the version attached to this mail (contained in a ZIP file for security purposes - please extract manually). You need to make the /var/www/pictory/resources/data/js directory writable first with the LINUX chmod command of course ...

Explanation:
as you yourself detected some time ago, the file ModbusRTUMaster_20180122_1_1.rap contained a wrong 'multi' setting for the 'Output Bit' value - it was set to 48 instead of 32.
We decided to replace the file with a corrected version in the new release - but now the loading function tried to assign the value Output_Bit_33 - which is present in your 'old' _config.rsc file but no longer exists in the corrected RAP file. This wasn't trapped in the loading code - but is now in the corrected version attached.

IMPORTANT: after replacing the main.js file please ensure to restart PiCtory AFTER YOU CLEARED THE CACHE OF YOUR BROWSER ...

Regards,
Frank
Attachments
main.zip
(54.98 KiB) Downloaded 7 times
 
Frank
KUNBUS
Posts: 63
Joined: 09 Jan 2017, 10:46

Re: Bug: Modbus RTU Config disappears after Update to Stretch 06/2020

29 Jul 2020, 13:52

Error on my side ... of course the directory where the main.js file is contained is:

/var/www/pictory/resources/js

NOT

/var/www/pictory/resources/data/js
 
User avatar
RR4711
Topic Author
Posts: 85
Joined: 22 Feb 2018, 13:28

Re: Bug: Modbus RTU Config disappears after Update to Stretch 06/2020

29 Jul 2020, 13:58

Looks OK now, at least it shows up in the Modbus Config again.
Thanks!
So I assume there will be a pictory 1.4.4 soon?

Markus

Edit: will the superflous entries be deleted once I load it with the updated main.js and save it again? So I kinda end up with a "bugfixed" _config.rsc
 
User avatar
lukas
KUNBUS
Posts: 168
Joined: 13 Feb 2017, 10:29

Re: Bug: Modbus RTU Config disappears after Update to Stretch 06/2020

29 Jul 2020, 16:43

I've just pushed pictory 1.4.4 to the apt repository. Thanks a lot for the report Markus, let us know if you come across further issues.

The question regarding deletion of superfluous entries needs to be answered by Frank, I'll nudge him to take another look at this thread.
 
User avatar
RR4711
Topic Author
Posts: 85
Joined: 22 Feb 2018, 13:28

Re: Bug: Modbus RTU Config disappears after Update to Stretch 06/2020

29 Jul 2020, 16:52

Thanks. No worries. I let you know if I find issues.
 
Frank
KUNBUS
Posts: 63
Joined: 09 Jan 2017, 10:46

Re: Bug: Modbus RTU Config disappears after Update to Stretch 06/2020

29 Jul 2020, 20:48

... regarding the superfluous entries ... no, they are still kept. Mainly because this was a quick fix to help all users like you who worked with the ModbusRTUMaster device und upgraded to the new release. Deleting them on the next save operation would have meant to alter the saving function as well as the loading function - which is more complex to generalize for possible similar cases in the future (I don't want to hardcode this single cleanup only) and needs significantly more care to prevent any side effects. But I have put this 'cleanup' in the backlog task list already ...

Frank
 
User avatar
RR4711
Topic Author
Posts: 85
Joined: 22 Feb 2018, 13:28

Re: Bug: Modbus RTU Config disappears after Update to Stretch 06/2020

29 Jul 2020, 23:13

Thanks for the explaination and the fix. Was not meant as criticism, I just wanted to get a rough idea what happens „under the hood“.
You guys do a terrific job in big fixing. :D

Markus

Who is online

Users browsing this forum: No registered users and 4 guests