"The device server is not defined in database" error when trying to run the sample PyTango device server

I'm trying to get the sample PyTango PowerSupply device server provided in the documentation running on Ubuntu. However, when I try to run it as described with
python PowerSupplyDS.py test
I get an error after which the program immediately exits:
The device server PowerSupply/test is not defined in database. Exiting!
I tried to register the device server both using Jive and using code as per instructions. In both cases, I can actually see the PowerSupplyDS in Jive afterwards (but not in e.g. Astor). Selecting the /test/power_supply/1 device in Jive displays the following problematic device info:
Device Info
 
No IOR found in database for test/power_supply/1
(Maybe, the device has never been exported…)
Server:          PowerSupplyDS/test
Exported:        false
last_exported:   ?
last_unexported: ?

What am I missing? Should I place the PowerSupplyDS.py file in some special place (right now, I don't see how Tango could possibly be aware of it)?

Note that the client example using TangoTest works fine. I have TANGO_HOST variable set normally.
Edited 6 years ago
Hi,

Do you still get the same error:

The device server PowerSupply/test is not defined in database. Exiting!
when starting the device server after having defined the device server using jive?

The device info reported by jive is suggesting that the device server is currently not running (and has never been running until the point where the device has been exported) so the device test/power_supply/1 is currently not exported, so not available on the network.
Now that you defined correctly the device server in jive, I think you would just need to start your device server with the correct TANGO_HOST and then if everything goes well, jive should report that the device test/power_supply/1 is exported.

Kind regards,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
The problem here is with the call PowerSupply.run_server(), which makes the server name to be the same as the class name.
Associated with this, the "Quick tour" documentation that you are looking at contains an error - server name used when importing into the database should be PowerSupply, and not PowerSupplyDS:

e.g. the import python script should be corrected (and Jive screenshot also accordingly):
>>> dev_info.server = "PowerSupply/test"


To use a different server name (for example PowerSupplyDS), you could use an alternative call:
PyTango.server.run({'PowerSupplyDS': (PowerSupply)})
Thank you both. mkomel was right, this was a naming problem. The device server works normally after the correction.

The only potential remaining issue is that device properties specified in the class (host, port) don't show up in Jive → Properties pane, which remains empty …
 
Register or login to create to post a reply.