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

Topics about the Software of Revolution Pi
User avatar
RR4711
Posts: 229
Joined: 22 Feb 2018, 13:28

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

Post by RR4711 »

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:

Code: Select all

            "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
Posts: 65
Joined: 09 Jan 2017, 10:46

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

Post by Frank »

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 768 times
Frank
Posts: 65
Joined: 09 Jan 2017, 10:46

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

Post by Frank »

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
Posts: 229
Joined: 22 Feb 2018, 13:28

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

Post by RR4711 »

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
Expert
Posts: 186
Joined: 13 Feb 2017, 10:29

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

Post by lukas »

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
Posts: 229
Joined: 22 Feb 2018, 13:28

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

Post by RR4711 »

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

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

Post by Frank »

... 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
Posts: 229
Joined: 22 Feb 2018, 13:28

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

Post by RR4711 »

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
User avatar
RR4711
Posts: 229
Joined: 22 Feb 2018, 13:28

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

Post by RR4711 »

I just updated to Pictory 1.4.4 in my "production" system (the one we talked above was my bench clone for development) and I noticed that some assignments are displayed wrong most likely due to the additional fields in the config file.

Image
Is there a way to fix the config file without recreating it from scratch? I don't wanna recreate it because we are still doing tests on this system to hunt some AIO related issues.
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

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

Post by Amar »

Hi Markus,
The generated offsets from Position 28 to 0 of your devices shall not be affected when you recreate a config.rsc file from scratch.

You can try this if it works:
Backup your original config .rsc file

Then edit config.rsc and delete only ModbusRTU master and save it.

Change version from 1.4.3 to 1.4.4 manually in config.rsc,if it is not already done.

Clear browser cache and load the configuration.Then add Modbus RTU Master back,make your Master configuration related to it and save the
new config.rsc file.

Regards, Amar
KUNBUS
Post Reply