To start, I'd like to commend you for your work! It works great so far.
After testing this repository for some while I've noticed so not so obvious configuration 'issues' that are poorly documented (primarily from ABB)
Some background information:
I work with live robots as well as using ABB RobotStudio. We run most of our code from Ubuntu or from WSL (Ubuntu) and so far this has been working rather well.
Two points of feedback, that perhaps could be included in the ReadMe or as a FAQ/Troubleshooting
Situation 1: Setting Digital IOs without the correct access level
Certain ABB IOs can't be set if their access level isn't with the user's access rights. Most users will probably be using the Default User with password robotics I imagine. The function get_digital_io() has default inputs network: str='Local', unit: str='DRV_1', most of these signals are ReadOnly or Default, which can't be access by default by the Default User.
When this happens we receive :
abb_robot_client.rws.ABBException: C:\BUILDAGENTS\SEABB-IS-13906.3\_work\12\s\Areas\RobApi2\Components\rws_iosystem\rws_resource_iosystem.cpp[3554] Rejected code:-1073445881 icode:-2
Which after some extensive digging shows us that we need to look at the access level in the robot's configuration.
My suggestion would be to catch this error and elaborate a bit on it so that the user realizes this quicker :)
The way to properly set this up is to either:
Create a user with all access rights
update the Default User's access rights
Change the signals access level (RobotStudio -> Controller -> Configuration -> I/O System -> Signals -> double click signal to modify)
Situation 2 : Accessing RWS from WSL
This is not so specific to this repository but can still be useful for those using WSL, when trying to access RWS via WSL we are encountered with the following error
from abb_robot_client.rws import RWS
# Robot RWS IP of Virtual controller
robot_ip = "172.23.160.1" # my windows IP (vEthernet WSL) in this case
rws= RWS("http://{}:80".format(robot_ip), username='Default User', password='robotics')
# So far everything is fine
rws.get_execution_state()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mattis/meshenv/lib/python3.8/site-packages/abb_robot_client/rws.py", line 335, in get_execution_state
res_json = self._do_get("rw/rapid/execution")
File "/home/mattis/meshenv/lib/python3.8/site-packages/abb_robot_client/rws.py", line 213, in _do_get
return self._process_response(res)
File "/home/mattis/meshenv/lib/python3.8/site-packages/abb_robot_client/rws.py", line 242, in _process_response
if response.headers["Content-Type"] == 'application/json' and len(response.content) > 0:
File "/home/mattis/meshenv/lib/python3.8/site-packages/requests/structures.py", line 52, in __getitem__
return self._store[key.lower()][1]
KeyError: 'content-type'
After some digging into the python library I found that the response string from the _do_get() function contains "RAPI Unidentified Error"
After some googling I found the solution here
Which requires us to whitelist our WSL IP address for the virtual controller by adding or editing the file vcconf.xml in `"C:\Users\{user}\AppData\Roaming\ABB Industrial IT\Robotics IT\RobVC\"
** After some more digging I realized that if I use a different IP this issue doesn't occur. Rather than using the windows WSL IP I use the Windows IP (normal wifi or eth) so in my case 192.168.76.34 and then there is no need to use the whitelisting method.
To start, I'd like to commend you for your work! It works great so far. After testing this repository for some while I've noticed so not so obvious configuration 'issues' that are poorly documented (primarily from ABB)
Some background information: I work with live robots as well as using ABB RobotStudio. We run most of our code from Ubuntu or from WSL (Ubuntu) and so far this has been working rather well.
Two points of feedback, that perhaps could be included in the ReadMe or as a FAQ/Troubleshooting
Situation 1: Setting Digital IOs without the correct access level
Certain ABB IOs can't be set if their access level isn't with the user's access rights. Most users will probably be using the
Default User
with passwordrobotics
I imagine. The functionget_digital_io()
has default inputsnetwork: str='Local', unit: str='DRV_1'
, most of these signals areReadOnly
orDefault
, which can't be access by default by the Default User.When this happens we receive :
abb_robot_client.rws.ABBException: C:\BUILDAGENTS\SEABB-IS-13906.3\_work\12\s\Areas\RobApi2\Components\rws_iosystem\rws_resource_iosystem.cpp[3554] Rejected code:-1073445881 icode:-2
Which after some extensive digging shows us that we need to look at the access level in the robot's configuration.
The way to properly set this up is to either:
(RobotStudio -> Controller -> Configuration -> I/O System -> Signals -> double click signal to modify)
Situation 2 : Accessing RWS from WSL
This is not so specific to this repository but can still be useful for those using WSL, when trying to access RWS via WSL we are encountered with the following error
After some digging into the python library I found that the response string from the
_do_get()
function contains"RAPI Unidentified Error"
After some googling I found the solution here Which requires us to whitelist our WSL IP address for the virtual controller by adding or editing the filevcconf.xml
in`"C:\Users\{user}\AppData\Roaming\ABB Industrial IT\Robotics IT\RobVC\"
with the following content:
After this RWS can be accessed normally.
** After some more digging I realized that if I use a different IP this issue doesn't occur. Rather than using the windows WSL IP I use the Windows IP (normal wifi or eth) so in my case
192.168.76.34
and then there is no need to use the whitelisting method.Hope this helps somehow!