[Solved] Missing /etc/revpi/config.rsc

Topics about the Software of Revolution Pi
Post Reply
Fabian
Posts: 3
Joined: 12 Sep 2017, 22:46
Answers: 0

[Solved] Missing /etc/revpi/config.rsc

Post by Fabian »

EDIT :
Mathias provide the following solution :

Code: Select all

sudo ln -s /var/www/pictory/projects/_config.rsc /etc/revpi/config.rsc
Hi Team,

I recently did an RevPi update and the system is in a strange state.

From the terminal :

Code: Select all

./piTest -r pt1000,h
Could not read variable pt1000. Internal Error
pt1000 is defined at byte 136.

With the following python snippets:

Code: Select all

f = open("/dev/piControl0", "wb+", 0)

print("Getting Offsets...", f)
# We are searching the offset and the byte of "RevPiStatus" and other process variables of the process image using KB_FIND_VARIABLE
# the IOCTL-parameter is calculated using the ASCIIC 'K' which is shifted by 8 bits plus the ID of the desired function (=17)
prm = (b'K'[0] << 8) + 17
# The argument for the function 17 is a packed byte array with contains 37 bytes. The first 32 bytes consist of the symbolic name
name = struct.pack('37s', b"RevPiStatus")
# The result values are written into a byte-array
# in which the first 32 byte are the symbolic name then 2 bytes for the offset and then 1 byte for the bitposition and then 2 byte for the length.
ret = fcntl.ioctl(f, prm, name) 
#Line 151 on top of this one
I got this error :

Code: Select all

Getting Offsets... <_io.FileIO name='/dev/piControl0' mode='rb+'>
Traceback (most recent call last):
  File "ProcessImageInterface.py", line 151, in <module>
    ret = fcntl.ioctl(f, prm, name)
FileNotFoundError: [Errno 2] No such file or directory
Would you have an idea about how to investigate this ?



Thank you

Export of my current configuration from Pictory

Code: Select all

RevPiStatus		 0	 //BYTE  
RevPiIOCycle		 1	 //BYTE  
RS485ErrorCnt		 2	 //WORD  
Core_Temperatur		 4	 //BYTE  
Core_Frequency		 5	 //BYTE  
RevPiLED		 6	 //BYTE  
RS485ErrorLimit1		 7	 //WORD  
RS485ErrorLimit2		 9	 //WORD  
sw_1		 11.0	 //BOOL  
sw_2		 11.1	 //BOOL  
sw_3		 11.2	 //BOOL  
sw_4		 11.3	 //BOOL  
sw_5		 11.4	 //BOOL  
sw_6		 11.5	 //BOOL  
sw_7		 11.6	 //BOOL  
sw_8		 11.7	 //BOOL  
I_9		 11.8	 //BOOL  
I_10		 11.9	 //BOOL  
I_11		 11.10	 //BOOL  
I_12		 11.11	 //BOOL  
I_13		 11.12	 //BOOL  
I_14		 11.13	 //BOOL  
I_15		 11.14	 //BOOL  
I_16		 11.15	 //BOOL  
Output_Status		 13	 //WORD  
Status		 15	 //WORD  
e		 81.0	 //BOOL  
d		 81.1	 //BOOL  
c		 81.2	 //BOOL  
dp		 81.3	 //BOOL  
g		 81.4	 //BOOL  
f		 81.5	 //BOOL  
a		 81.6	 //BOOL  
b		 81.7	 //BOOL  
gnd		 81.8	 //BOOL  
24v		 81.9	 //BOOL  
O_11		 81.10	 //BOOL  
O_12		 81.11	 //BOOL  
O_13		 81.12	 //BOOL  
O_14		 81.13	 //BOOL  
O_15		 81.14	 //BOOL  
O_16		 81.15	 //BOOL  
InputMode_1		 99	 // ##ATTR_COMMENT## 
InputMode_2		 100	 // ##ATTR_COMMENT## 
InputMode_3		 101	 // ##ATTR_COMMENT## 
InputMode_4		 102	 // ##ATTR_COMMENT## 
InputMode_5		 103	 // ##ATTR_COMMENT## 
InputMode_6		 104	 // ##ATTR_COMMENT## 
InputMode_7		 105	 // ##ATTR_COMMENT## 
InputMode_8		 106	 // ##ATTR_COMMENT## 
InputMode_9		 107	 // ##ATTR_COMMENT## 
InputMode_10		 108	 // ##ATTR_COMMENT## 
InputMode_11		 109	 // ##ATTR_COMMENT## 
InputMode_12		 110	 // ##ATTR_COMMENT## 
InputMode_13		 111	 // ##ATTR_COMMENT## 
InputMode_14		 112	 // ##ATTR_COMMENT## 
InputMode_15		 113	 // ##ATTR_COMMENT## 
InputMode_16		 114	 // ##ATTR_COMMENT## 
InputDebounce		 115	 // ##ATTR_COMMENT## 
OutputPushPull		 117	 // ##ATTR_COMMENT## 
OutputOpenLoadDetect		 119	 // ##ATTR_COMMENT## 
OutputPWMActive		 121	 // ##ATTR_COMMENT## 
OutputPWMFrequency		 123	 // ##ATTR_COMMENT## 
pot		 124	 //INT  
humidity		 126	 //INT in % 
fromOut2		 128	 //INT  
fromOut1		 130	 //INT  
InputStatus_1		 132	 //BYTE  
InputStatus_2		 133	 //BYTE  
InputStatus_3		 134	 //BYTE  
InputStatus_4		 135	 //BYTE  
pt1000		 136      //INT  
RTDStatus_1		 140	 //BYTE  
OutputStatus_1		 142	 //BYTE  
OutputStatus_2		 143	 //BYTE  
ao1		 144	 //INT  
ao2		 146	 //INT  
Input1Range		 148	 //You must use wire bridges for current measurement! ##ATTR_COMMENT## 
Input1Multiplier		 149	 // ##ATTR_COMMENT## 
Input1Divisor		 151	 // ##ATTR_COMMENT## 
Input1Offset		 153	 // ##ATTR_COMMENT## 
Input2Range		 155	 //You must use wire bridges for current measurement! ##ATTR_COMMENT## 
Input2Multiplier		 156	 // ##ATTR_COMMENT## 
Input2Divisor		 158	 // ##ATTR_COMMENT## 
Input2Offset		 160	 // ##ATTR_COMMENT## 
Input3Range		 162	 //You must use wire bridges for current measurement! ##ATTR_COMMENT## 
Input3Multiplier		 163	 // ##ATTR_COMMENT## 
Input3Divisor		 165	 // ##ATTR_COMMENT## 
Input3Offset		 167	 // ##ATTR_COMMENT## 
Input4Multiplier		 170	 // ##ATTR_COMMENT## 
Input4Divisor		 172	 // ##ATTR_COMMENT## 
Input4Offset		 174	 // ##ATTR_COMMENT## 
ADC_DataRate		 176	 //Use lowest value for highest precision and a maximum 50 Hz suppression ##ATTR_COMMENT## 
RTD1Type		 177	 // ##ATTR_COMMENT## 
RTD1Wiring		 178	 //You must use wire bridges for 2-wire sensors! ##ATTR_COMMENT## 
RTD1Multiplier		 179	 // ##ATTR_COMMENT## 
RTD1Divisor		 181	 // ##ATTR_COMMENT## 
RTD1Offset		 183	 // ##ATTR_COMMENT## 
Output1Range		 193	 // ##ATTR_COMMENT## 
Output1EnableSlew		 194	 //Enable slew rate deceleration ##ATTR_COMMENT## 
Output1SlewStepSize		 195	 //Slew rate step size ##ATTR_COMMENT## 
Output1SlewClock		 196	 //lock rate of slew rate deceleration in kHz ##ATTR_COMMENT## 
Output1Multiplier		 197	 // ##ATTR_COMMENT## 
Output1Divisor		 199	 // ##ATTR_COMMENT## 
Output1Offset		 201	 // ##ATTR_COMMENT## 
Emergency_stop		 213	 //BYTE
Last edited by Fabian on 27 Sep 2017, 07:42, edited 3 times in total.
User avatar
volker
Posts: 1046
Joined: 09 Nov 2016, 15:41
Answers: 1

Re: RevPi Update

Post by volker »

Hi Fabian,
The "no such file or directory" is somehow funny: The driver should stil be under "/dev/piControl0" in your device directory. please check this.
On the other hand: If the device driver would npot be present in the directory this error should be raised much earlier in the programm when you open the device with the statement:
f=open("/dev/piControl0","wb+",0)
Do you have this line in your code prior to sending an ioctl to f?
Unser RevPi Motto: Don't just claim it - make it!
Fabian
Posts: 3
Joined: 12 Sep 2017, 22:46
Answers: 0

Re: RevPi Update

Post by Fabian »

Hi Volker,

We figured out the problem with the following commands :

lsmod : module present -> OK
ls /dev/pi* : /dev/piControl0 -> OK
./piTest -d : Not OK

Code: Select all

./piTest -d
Found 3 devices:

Address: 0 module type: 95 (0x5f) RevPi Core V1.2
Module is present
     input offset: 0 length: 6
    output offset: 6 length: 5

Address: 32 module type: 96 (0x60) RevPi DIO V1.3
Module is present, but NOT CONFIGURED!!!
     input offset: 11 length: 70
    output offset: 81 length: 18

Address: 33 module type: 103 (0x67) RevPi AIO V1.2
Module is present, but NOT CONFIGURED!!!
     input offset: 99 length: 20
    output offset: 119 length: 4
    
We reset driver from pictory, no error on the interface but the problem was the same after reset.

dmesg give us a clue :

Code: Select all

[    3.558987] piControl: error: cannot open file /etc/revpi/config.rsc
[    3.567506] piControl: error: cannot open file /opt/KUNBUS/config.rsc
This /etc/revpi/config.rsc was deleted during our update process.

EDIT :
Mathias provide the following solution :

Code: Select all

sudo rm /etc/revpi/config.rsc
sudo ln -s /var/www/pictory/projects/_config.rsc /etc/revpi/config.rsc
Last edited by Fabian on 26 Sep 2017, 17:13, edited 1 time in total.
User avatar
volker
Posts: 1046
Joined: 09 Nov 2016, 15:41
Answers: 1

Re: RevPi Update

Post by volker »

Okay, sorry. So it was the rsc file (PiCtory configuration) which was missing, not the device driver file. The error message is somehaw misleading I will give the R&D a hint about that. And yes, you need to reconfigure your system after updating because the rsc might be deleted (depending onthe package you have updated and always when copyiong a new image to the system.
Unser RevPi Motto: Don't just claim it - make it!
User avatar
Mathias
Posts: 130
Joined: 29 Nov 2016, 10:46
Answers: 0

Re: RevPi Update

Post by Mathias »

Hi Fabian,
this is strange and I would like to understand how this could happen. What did you do in the first step? Only an update with apt-get update/upgrade? Do you remember which packets were updated?

Your copy solution will not work very good. We use a symbolic link.
If you change the configuration in PiCtory the file /var/www/pictory/projects/_config.rsc is written but you will still have the old configuration /etc/revpi/config.rsc.

Please use:

Code: Select all

sudo rm /etc/revpi/config.rsc
sudo ln -s /var/www/pictory/projects/_config.rsc /etc/revpi/config.rsc
Mathias
Fabian
Posts: 3
Joined: 12 Sep 2017, 22:46
Answers: 0

Re: RevPi Update

Post by Fabian »

Hi Mathias,

We are working on an automated way to provision RevPi in our infrastructure.
We thought initially to update process because that was the only potential change we made.
We figure out that during that process we got a folder in conflict with /etc/revpi.

I will use your solution, Thank you !
Post Reply