{ "info": { "author": "Frederic Hess", "author_email": "fhess@st-sa.ch", "bugtrack_url": null, "classifiers": [], "description": "===================\nPython digimat.saia\n===================\n\nThis is a Python 2.7 (Python 3 not fully compatible yet, but will be in the future) module allowing anyone to create **client** and/or **server** `SAIA EtherSBus `_ nodes.\nThis code allow you to create low cost (and reliable) communication services with any EtherSBus device, reading and writing data from/to them. By data (items),\nwe mean inputs, outputs, flags, registers, timers and counters. In the exemple below, a local SBus node with address 253 (station number, or localid, or lid in our terminology) is created. \n\n.. code-block:: python\n\n >>> from digimat.saia import SAIANode\n >>> node=SAIANode(253)\n\nCongratulations ! You just have powered up your first EtherSNode device with 2 lines of code. A **background task handle now for you all the network SBus frames**. \nOpen your SAIA PG5 Debugger and try to read/write some data to your node. Of course, you can also talk to other SBus devices directly \nfrom your node. To give you an idea, you will find a basic `Python interactive session demo here `_. \n\n.. image:: https://st-sa.ch/img/figures/digimat-saia-asciinema.png\n :width: 360px\n :target: https://asciinema.org/a/0q7jfTE6Ooj7RPpVBL6bWfIj2\n\n\nWhen done, shutdown your node properly.\n\n.. code-block:: python\n\n >>> node.stop()\n >>> quit()\n\nPlease consider this work as *in progress* (**currently only partially tested**). Always use the latest version of this package, as it is frequently updated ! \nWarning : if you observe a socket error at node start, this is probably due to the fact that the listening port is already opened on your machine from\nan other process. The default listening port is 5050. Try changing it to see if this fix the problem\n\n.. code-block:: python\n\n >>> node=SAIANode(253, port=15050)\n\n\nNon exhaustive features list\n============================\n\nOut of the box features\n\n* EtherSbus Server (expose local data to other EtherSBus nodes)\n* EtherSBus Client (remote access to N remote EtherSBus nodes)\n* Local Server AND Remote Client(s) simultaneous communication support\n* Read/Write of local and remote Inputs/Outputs/Flags/Registers/Timers/Counters data values trough simple objects .value get/set\n* Background task (thread) managing every server+clients messages once the node is started\n* Registers value encoders allowing working transparently with float, float32 and some other 32 bits encodings\n* Automatic pooling in the background of every declared remote items (manual refresh is also possible)\n* Node station address automatic resolution\n* Automatic read/write requests aggregations (using one message for multiple items transfer)\n* Prioritized request queuing allowing urgent transactions to be processed first, providing good \n responsiveness even with tons of pooled items\n* Lightweight enough to be comfortably run on \"poor\" hardware systems (Raspberry Pi)\n* Compatible with the SAIA PG5 Debugger (display/write/clear orders)\n\nOptional features\n\n* Automatic *on-the-fly* local items creation when accessed by remote nodes (without prior declaration). This\n allows very easy EtherSBus node creation, working *out-of-the-box* once launched\n* Periodic remote node discovering and declaration (trough broadcast messages)\n* Automatic remote node information retrieval (trough READ_DBX blocks transfers),\n allowing to guess the PG5 compiler generated .map symbol file name ;) you will learn to love your .map files\n* PG5 symbols files (.map) parsing, allowing flags, registers, timers and counters symbolic access !\n* Dynamic objects creation at runtime when .map file is loaded to enhance Python \n interactive sessions experience (autocompletion)\n* Logging for local or remote debugging trough TCP/IP.\n\n\nSAIA EtherSBus\n==============\n\nThe EtherSBus is mainly an UDP encapsulated version of the serial SAIA S-Bus. The EtherSBus is `natively implemented `_\nin any SAIA nodes having a LAN port, providing a very easy way to exchange (read/write) information with 3rd party devices. Using native S-Bus protocol instead \nof something more *standard* like Modbus/IP or BACnet/IP has some advantages\n\n* No (or very few) setup is needed on the existing SAIA CPUs (means no or very few additional costs)\n* Mapping SAIA variables to Modbus/BACnet variables require additional specific config and hardware ressources that you may not have\n* Data communication using more sophisticated protocols like BACnet use more encapsulation around exchanged data. Using EtherSBus\n is more *lightweight* and efficient.\n\nThe digimat.saia module was mainly created to partially explore the S-Bus mecanisms on Raspberry Pi devices \nbefore starting a deeper implementation on our `Digimat `_ HVAC BMS infrastructures. SAIA Burgess\nhas absolutely **no implication** on this project and cannot be held responsible for any problem of any kind if you decide to use this module.\n\nAt this time, we don't have access to any S-Bus or EtherSBus protocol official specifications. If you own such documentation,\nplease forward it to us (fhess [at] st-sa [dot] ch), as SAIA doesn't want to provide it ;( If you need to learn about this protocol,\nsome good starting points may include :\n\n* `WireShark EtherSBus plugin source code `_\n* `SBPoll Python EtherSBus source code `_\n* `SAIA faq `_\n* The protocol specification *should* be theorically available upon request per email to SAIA at support [at] saia-pcd [dot] com, \n but you will need to sign a non disclosure agreement. Ask for the \"**Utilization Agreement for Saia S-Bus Developer Documentation**\" document.\n We have never received any response to thoses requests ;(\n\nUsing the SAIA PG5 debugger may also help understanding how things works. Wireshark has an excellent protocol decoder \nand you will easily find some .pcap samples by googling \"sbus pcap\". Really useful.\n\nDon't forget that the SAIA dynamic addressing won't be your friend here as you must know the address of the variable\nyou want to access (read/write). Consider fixing your variables to \"static\" addresses in your PG5 configuration (**read SAIA FAQ 101533**, to knows actions that may affect variables\naddress change). We have implemented some helpers to provide limited symbolic access using the PG5 .map file if you have it (see chapter \"Symbolic Adressing\" below).\nThere are some tricks available to help you using items tag name ;)\n\nOh, and of course, EtherSBus communication has to be enabled on your PCD device ;)\n\n\nInstallation\n============\n\nNothing specific here, just use pip (which will also install modules dependencies)\n\n.. code-block:: bash\n\n pip install -U digimat.saia\n\n\nEtherSBus Node (Server)\n=======================\n\nOnce created, the **SAIANode** object will implicitely start a background task responsible for protocol and bus variables management.\nThe task must be stop()ed before the program termination, to shutdown the background task. The node contains a server (allowing other nodes to read an write \ndata to it), and may also donnect (acting as a client) to other remote SBus servers to read/write remote data. Each server (local-node or remote-node)\nhas it's own memory representation (SAIAMemory) in the SAIANode object. Local-node memory is accessible trough node.memory (which is a shortcut to node.server.memory).\n\nThe **SAIAMemory** object handle every SBus variables (**inputs**, **outputs**, **flags**, **registers**, **timers**, **counters**). The SAIAMemory object provide a **SAIAItemFlags** object, \naccessible trough a .flags property, itself providing access to every registered SAIAItemFlag object (item). The same principle is used for inputs \n(**SAIAItemInputs**), outputs (**SAIAItemOutputs**), registers (**SAIAItemRegisters**), timers (**SAIAItemTimers**) and counters (**SAIAItemCounters**). Note that there are shortcuts implemented : \n*node.flags* can be used instead of *node.memory.flags*.\n\n.. code-block:: python\n\n >>> node=SAIANode(253)\n >>> myflag=node.memory.flags[18]\n\n >>> myflag\n \n\n >>> myflag.value=True\n >>> myflag.value\n True\n\nThe SAIAMemory object is initially created *empty* (with no items declared). Items are dynamically instanciated \"on-the-fly\" when they are accessed. In the example above,\nthe flag 18 is created on the first call, and returned in a SAIAItemFlag object. Any further call to this item will always return the same object instance.\nEach item provide some helpers methods to facilitate value manipulation\n\n.. code-block:: python\n\n >>> myflag.off()\n >>> myflag.on()\n >>> myflag.toggle()\n >>> myflag.set()\n >>> myflag.clear()\n >>> myflag.value=1\n >>> myflag.value=True\n >>> myflag.value\n 1\n\nBy default, \"on-the-fly-item-creation\" is active. This means that any data item (flag, input, output, register) which is accessed (locally or remotely)\nwill be dynamically instanciated if it doesn't exists. This can create a large amount of unwanted memory consumption in case of abuse or bug. This mode can\nbe disabled, and accessing a non pre-declared item will fail.\n\n.. code-block:: python\n\n >>> node.memory.enableOnTheFlyItemCreation(False)\n >>> node.memory.flags[19]\n None\n\nItems can be manually-created by \"declaring\" them, individually or by range\n\n.. code-block:: python\n\n >>> myflag=node.memory.flags.declare(index=18)\n >>> myflags=node.flags.declareRange(index=100, count=3)\n >>> myflags\n [,\n ,\n ]\n\nYou will also later discover a .declareForTagMatching() feature. Inputs, Outputs and Flags are boolean items. \nRegisters, Timers and Counters are simple \"32 bits uint values\".\n\n.. code-block:: python\n\n >>> myregister=node.memory.registers[0]\n >>> myregister.value=100\n >>> register.value\n 100\n\nRegisters are always stored as \"raw 32 bits\" values (without encoding). Helpers are available to set/get the register value with common encodings\n\n.. code-block:: python\n\n >>> myregister.float32=21.5\n >>> myregister.value\n 1101791232\n >>> myregister.float32\n 21.5\n\nActually, the following encoders/decoders accessors are implemented (each one is a derived class from **SAIAValueFormater**)\n\n+-----------------------+-----------------------------------------------------+\n| **.float32** | IEEE float32 encoding (big-endian) |\n+-----------------------+-----------------------------------------------------+\n| **.sfloat32** | Swapped IEEE float32 encoding (little-endian) |\n+-----------------------+-----------------------------------------------------+\n| **.ffp** | Motorola Fast Floating Point encoding (SAIA Float) |\n+-----------------------+-----------------------------------------------------+\n| **.float** | Alias for FFP encodings (easier to remember) |\n+-----------------------+-----------------------------------------------------+\n| **.int10** | x10 rounded value (21.5175 is encoded as 215) |\n+-----------------------+-----------------------------------------------------+\n| **.formatedvalue** | Reuse the last used formater |\n+-----------------------+-----------------------------------------------------+\n\nAs in SAIA float values *seems* to be FFP encoded (not really sure about that), the ffp encoder is automatically used\nwhen writing a float value to a register (instead of an int)\n\n.. code-block:: python\n\n >>> myregister.value=2\n >>> myregister.value\n 2\n >>> myregister.value=2.0\n >>> myregister.value\n 2147483714\n >>> myregister.ffp\n 2.0\n >>> myregister.float\n 2.0\n\nIf for any reason you want your localnode to be read-only (for any 3rd party EtherSBus client), you can\nlock your local memory\n\n.. code-block:: python\n\n >>> node.memory.setReadOnly()\n\nThis can be very useful to implement a data-provider-only service, simply ignoring any incoming SBus write requests. Thoses\nrequests will be NAKed by your node. Timers are managed (those declared *in the local node*). This means that any timer created will be automatically decremented until reaching 0\n\n.. code-block:: python\n\n >>> timer=node.server.timers[0]\n >>> timer.value=1000\n >>> # wait some time\n >>> timer.value\n 874\n >>> timer.value\n 510\n >>> timer.isTimeout()\n False\n >>> timer.clear()\n >>> timer.isTimeout()\n True\n\nThe default tickBaseTime is 100ms (decrement each counter by 1 every 100ms), which can be set on the timers object \n\n.. code-block:: python\n\n >>> node.server.timers.setTickBaseTimeMs(100)\n\n\nEtherSBus Client\n================\n\nNow the best part. The node object allow access to (as many) remote EtherSBus node servers you need, registered in a **SAIAServers** object\n\n.. code-block:: python\n\n >>> server1=node.servers.declare('192.168.0.100')\n >>> server2=node.servers.declare('192.168.0.101')\n >>> myRemoteFlag=server1.memory.flags[5]\n\nThe declaration process provide a **SAIAServer** object, containing a **SAIAMemory** object to access remote items. Thus, **local and remote data can be manipulated \nin the same manner**. When a remote data item (input, output, flag, register, timer or counter) is declared, an **automatic pooling mecanism** is launched in \nthe background task (manager). An **optimiser mecanism try to group many items per request**, avoiding to launch 1 request for 1 item refresh.\n\nThe default refresh rate is **60s** per item, modifiable with a myRemoteFlag.setRefreshDelay() call. Alternatively, the refresh rate can be specified \nfor the whole item collection, with a node.memory.flags.setRefreshDelay() call. Refresh can be triggered on demand with with theses kind of call\n\n.. code-block:: python\n\n >>> node.servers.refresh() or node.refresh()\n >>> server.memory.refresh() or server.refresh()\n >>> server.memory.flags.refresh() or server.flags.refresh()\n >>> myRemoteFlag.refresh()\n\nYou can query the elapsed time (in seconds) since the last value update (refresh) with the myRemoteFlag.age() method. If you really need to get the very \nactual value of an item (and not the last refreshed one), you need to initiate an item.refresh() and then \nwait *a certain amount of time* allowing the read queue to be processed by the background task. \nIf you have declared thousand of items, this *may* take a while. The whole thing can be done with a simple item.read(),\nreturning the just refrehed item.value (or None in case of timeout)\n\n.. code-block:: python\n\n >>> myRemoteFlag.read()\n True\n\nTheses refresh orders are **processed with more priority** than other \"standard\" polling-read, providing better responsiveness.\nA timeout can be passed to the read() function. **Changing** (**writing**) the remote data value is fully transparent\n\n.. code-block:: python\n\n >>> myRemoteFlag.value=1\n\nFor a non local object, **this will automatically queue a write order** in the SAIAServer object with the new given value. **The actual value of the item\nremains unchanged**. **When the write order has been executed**, **a refresh order is immediately triggered**, thus **allowing the actual value to be updated**. \nThis tend to keep the value synchonized with the remote value, even if something goes wrong. As for read() orders, the read-after-write is\nprocessed with **more priority** than standard pooling requests (more responsive). Please note that this approach *can* be problematic to write fast ON/OFF bursts.\n\nThe background manager try to be as reactive and idle as possible, keeping ressources for your application. We tried to\ntrap most of the possible errors, allowing using this module to be used as a standalone service. Note that automatic SAIA address \nresolution is implemented, so that only remote IP address is required to register a remote node. If known, the SAIA station address *can* be\ngiven during registration (this will avoid the initial address resolution requests to get the server address).\n\n.. code-block:: python\n\n >>> server=node.servers.declare(host, lid=54, port=5050)\n\nAs with items, servers can be declared by range for more convenience, by giving the ip address of the first server. The example below creates for you\n10 servers (from 192.168.0.100 to 192.168.0.109, assigned with station addresses 200..209). \n\n.. code-block:: python\n\n >>> servers=node.servers.declareRange('192.168.0.100', count=10, lid=200, port=5050)\n\nRemember that declared servers can be retrieved at any time by lid or by ip address using the SAIAServers object \n\n.. code-block:: python\n\n >>> server=node.servers[200]\n >>> server1=node.servers['192.168.0.100']\n\nThe background task poll each declared servers to maintain their running status (with READ_PCD_STATUS_OWN requests). The actual\nrun status of a server is accessible trough the .status property \n\n.. code-block:: python\n\n >>> server.status\n 82 (0x52)\n >>> server.isRunning()\n True\n\nIf your remote servers are stopped, this can be annoying ;) You can start them with the .run() method without \nusing the PG5 or the Debugger programs (assuming that *you* know what your are doing) \n\n.. code-block:: python\n\n >>> server.run()\n >>> servers.run()\n\n\nData Transfers with Remote Servers\n==================================\n\nThe SAIAServer object contains a **SAIATransferQueue** service allowing to submit and queue **SAIATransfer** jobs in the background, used\nfor processing transfers that require multiple packet exchange like *read-block*, for example. **When a remote server is declared**, **some\nREAD_DBX requests will be automatically done using a SAIATransferReadDeviceInformation with the remote server to retrieve the device \ninformation memory block**, containing this kind of config\n\n.. code-block:: python\n\n PG5Licensee=DEMONSTRATION VERSION\n PG5DeveloperID=CH_xxxxxxxx\n PCName=WINFHE\n Originator=DEMONSTRATION VERSION\n PG5Version=V2.2.230\n ProjectName=Test1\n DeviceName=Device1\n PcdType=PCD1.M2220\n ANSICodePage=1252\n ProgramVersion=1.0\n ProgramID=E291E0E08F55CBEC\n ProgramCRC=061C66CD\n BuildDateTime=2017/08/18 17:46:50\n DownloadDateTime=2017/08/18 17:49:47\n\nOnce retrieved, theses informations may be accessed with the server.getDeviceInfo() method (case insensitive)\n\n.. code-block:: python\n\n >>> server.getDeviceInfo('DeviceName')\n 'Device1'\n\nThe DeviceName, DeviceType (PcdType) and BuildDateTime can also be directly accessed as a server's property method\n\n.. code-block:: python\n\n >>> server.deviceName\n 'Device1'\n >>> server.deviceType\n 'PCD1.M2220'\n >>> server.buildDateTime\n datetime.datetime(2017, 8, 18, 17, 46, 50)\n\nYou can force a deviceInfo refresh later if anything goes wrong\n\n.. code-block:: python\n\n >>> server.submitTransferReadDeviceInformation()\n\nIf the deviceName is compatible with Python class variable naming convention, the SAIAServer object is automatically mapped (mounted)\nto a variable with the same name (but lowercase and normalized) accessible in the node.servers (SAIAServers) object\n\n.. code-block:: python\n\n >>> server=node.servers.device1\n\nThis is really useful in interactive sessions when combined with automatic node discovering (see below). \n\n\nNetwork nodes discovering\n=========================\n\nEvery SAIANode has a local SAIAServer object (node.server) allowing local data to be accessed by other SAIA EtherSBus clients. This local server\nhas a manager() periodically called by the background task. You can ask this task to periodically scan the network and potentially discover\nother EtherSBus servers online on the LAN\n\n.. code-block:: python\n\n >>> node.server.enableNetworkScanner(True)\n\nThis will periodically broadcast a READ_STATIONNUMBER on the network (255.255.255.255) using a SAIATransferDiscoverNodes transfer service.\nWhen discovering mode is active, any response to this message received by the local node (not comming from a local network interface) will be \naccepted and the corresponding remote server will be automatically delared for you. For convenience, the discover process is automatically started in Python interactive mode. In fact,\nyou can decide if network scanning should be active or not at the node creation\n\n.. code-block:: python\n\n >>> node=SAIANode() # network scanner is enabled only in interactive sessions\n >>> node=SAIANode(scanner=True) # scanner is enabled\n >>> node=SAIANode(scanner=False) # scanner is disabled\n\nWarning : we have seen some problems with node discovering enabled if nodes stations addresses are not unique. This has to be fixed in the future.\n\n\nSymbolic Addressing\n===================\n\nThe EtherSBus doesn't provide item access by name (symbol name, tag). But **if you own the PG5 .map file generated at compile time**, you may have some help by passing\nthis file during server declaration process. This will create a **SAIASymbols** object associated with the server, ready to serve you the requested **SAIASymbol**\n\n.. code-block:: python\n\n >>> server=node.servers.declare('192.168.0.48', mapfile='xxxxx.map')\n >>> server.symbols.count()\n 2140\n\n >>> symbol=server.symbols['RIO.Station_A12.Sonde3_16_Cmd_Reduit_Ch'] \n >>> symbol.index\n 2295\n >>> symbol.attribute\n 'f'\n >>> symbol.isFlag()\n True\n\n >>> symbol=server.symbols.register(2295)\n >>> symbol.tag\n 'rio.station_a12.sonde3_16_cmd_reduit_ch' \n\n**This allows bidirectional mapping between symbols names (tag) and items indexes**, **assuming that your map file is uptodate** ! Cool. The symbolic access is in fact implemented\nin all SAIAItem objects index access, so that syntaxes like this are perfectly working\n\n.. code-block:: python\n\n >>> server.registers[2295].value=99\n >>> server.registers['rio.station_a12.sonde3_16_cmd_reduit_ch'].value\n 99\n\n >>> flag=server.flags.declare('Sonde3_42_Lib')\n >>> flag.index\n 4634\n\nUse it carefully. For ease of use, symbolic access is implemented *case insensitive*. In interactive mode,\nyou can try to **mount** flags and registers symbols (SAIASymbol) as SAIASymbols object variables\nso that the **interpreter autocompletion** will save you some precious keystroke\n\n.. code-block:: python\n\n >>> symbols=server.symbols\n >>> symbols.mount()\n\n >>> symbols.flags.sonde3_1\n s.sonde3_10_defaut s.sonde3_13_defaut s.sonde3_19_defaut\n s.sonde3_10_lib s.sonde3_13_lib s.sonde3_19_setpoint\n s.sonde3_10_timeout s.sonde3_13_timeout s.sonde3_19_temp\n s.sonde3_11_defaut s.sonde3_14_defaut s.sonde3_19_timeout\n s.sonde3_11_lib s.sonde3_14_lib s.sonde3_1_defaut\n s.sonde3_11_timeout s.sonde3_14_timeout s.sonde3_1_timeout\n s.sonde3_12_defaut s.sonde3_15_defaut\n s.sonde3_12_lib s.sonde3_15_lib\n s.sonde3_12_timeout s.sonde3_15_timeout\n\n >>> symbols.flags.sonde3_11_timeout.index\n 3936\n\nWhen Python interactive mode is detected, symbols.mount() is automatically called for you. Items declaration can also be passed \nas a SAIASymbol object, so that autocompletion is your friend\n\n.. code-block:: python\n\n >>> server.flags.declare(symbols.flags.sonde3_11_timeout)\n >>> server.flags.declare(symbols['sonde3_11_timeout'])\n\nAs said in the last section, we can access the deviceInformation properties, allowing to guess the .map filename. If the deviceName is \"MySuperDevice\", the associated \n.map file produced by the SAIA PG5 compiler will be \"MySuperDevice.map\" by default. In fact, this can help us to do things automagically. \n**When a server is declared, the deviceInformation block is automatically retrieved and a try is made to load the default associated .map file**. By default, the map\nfile has to be stored in the current directory. This can be changed with the node.setMapFileStoragePath() method.\n\nIn Python 2.7, you may need to `enable autocompletion `_ \non your ~/.pythonrc setup file. Alternatively you can use IPython, Jupyter or something simpler like `ptpython `_ for\ninteractive sessions. **Don't miss** the excellent `bpython `_ project.\n\nKeep an eye open on your memory ressources when enabling symbols ;) as this can declare thousands of variables.\n\n\nTips & Tricks\n=============\n\nServers (SAIAServers), items (SAIAItemFlags/Registers/Inputs/Outputs/Timers/Counters) are *iterable* objects. This allows things like\n\n.. code-block:: python\n\n >>> server.flags.declareRange(0, 4096)\n >>> # give a little time allowing the background task to refresh thoses 4K items\n >>> flagsThatAreON=[flag for flag in server.flags if flag.value is True]\n\n >>> for flag in server.flags:\n >>> flag.value=1\n\nWhen working with registers, timers and counters, accessing to the hex or bin value representation can be useful\n\n.. code-block:: python\n\n >>> register=server.registers[50]\n >>> register.value=100\n >>> register.value\n 100\n >>> register.hex\n '0x64'\n >>> register.bin\n '1100100'\n\nWhen symbols are loaded, SAIAFlags, SAIARegisters, SAIATimers and SAIACounters objects can be declared by a *search* upon a *part* of their\ntag name.\n\n.. code-block:: python\n\n >>> registers=server.registers.declareForTagMatching('sonde')\n >>> len(registers)\n 626\n\nThe *searched argument* may also be a compiled regex\n\n.. code-block:: python\n\n >>> pattern=re.compile('sonde[0-9]+_[0-9]+_temp')\n >>> registers=server.registers.declareForTagMatching(pattern)\n\nIf for any reason you want to *pause* one remote server communications, you can use the server.pause(60) call (seconds). This is for example\ninternally used to stop server communications when a station address conflict (duplicate address) is detected.\n\n\nDumping & Debugging\n===================\n\nBy default, the module create and use a socket logger pointing on localhost. Launch your own tcp logger server\nand you will see the EtherSBus frames. If you don't have one, you can try our simple (and dirty) digimat.logserver\n\n.. code-block:: python\n\n pip install -U digimat.logserver\n python -m digimat.logserver\n\nYou can apply some basic output filtering with optional \"--filter string\" parameter. You can also give your own logger to the SAIANode\n\n.. code-block:: python\n\n >>> node=SAIANode(253, logger=mylogger)\n\nIf you want to completely disable the logger, just pass a logger=SAIALogger().null() parameter. Limited dump-debug can \nalso be done with objects .dump() methods. Try node.dump(), node.memory.dump(), node.memory.flags.dump(), \nnode.servers.dump(), server.dump(), etc. For debugging purposes, you can simulate a remote node \nby registering a remote pointing on yourselfi (woo!)\n\n.. code-block:: python\n\n >>> server=node.servers.declare('127.0.0.1')\n >>> localFlag=node.memory.flags[1]\n >>> remoteFlag=server.memory.flags[1]\n\n >>> localFlag.value, remoteFlag.value\n False, False\n\n >>> remoteFlag.value=1\n\n # network data synchronisation is done by the background manager task\n\n >>> localFlag.value\n True\n\nIn this example, localFlag and remoteFlag points to the same data, but the remoteFlag is a networked synchonized \nmirror representation of the localFlag.\n\nSAIA* objects *.__repr__* magic method are redefined to provide some useful information about the current state of the object.\nThis can be useful to gather some informations about your data\n\n.. code-block:: python\n\n >>> node\n \n\n >>> node.servers\n \n\n >>> node.servers[101]\n \n\n >>> server.memory\n \n # 0R = number of actual pending item-read in queue (background polling/refresh process)\n # 0R! = number of actual pending urgent item-read in queue (manual refresh, read-after-write)\n # 0W = number of actual pending item-write in queue\n\n >>> server.flags\n \n\n >>> server.flags[28]\n \n\n\nDemo Node\n=========\n\nUsing command line interpreter is cool, but for debugging, you will need to launch and relaunch your node. \nHere is a minimal empty node implementation, stopable with \n\n.. code-block:: python\n\n from digimat.saia import SAIANode\n\n node=SAIANode(253)\n\n # customize your node here...\n\n while node.isRunning():\n try:\n #\u00a0time.sleep(3.0)\n\n #\u00a0using integrated node.sleep() will \n # handle CTRL-C and propagate node.stop()\n node.sleep(3.0)\n\n node.dump()\n except:\n break\n\n # node.stop()\n\n\nOpen your SAIA Debugger on this node, and try reading/writing some items. \nYou can also use SBus *clear* requests with i,o,f and r items. For your convenience, \nyou can run the demo node shown above with this simple command line\n\n.. code-block:: python\n\n python -m digimat.saia\n\n\nTODO\n====\n\nDocumentation is very incomplete. Don't know if this is useful for someone. Tell it to us.\nThere is still some more locking mecanisms to implement making the background task really thread safe. The\nPython GIL make things yet wrongly safe. Python 3 compatibility.\n\nWe have no way to test what 'S-Bus gateway' feature is. When enabled, a PCD may be able? to expose S-Bus\nsub nodes on its EtherSBus interface. This \"proxy\" mode access is not supported yet.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.digimat.ch", "keywords": "", "license": "PSF", "maintainer": "", "maintainer_email": "", "name": "digimat.saia", "package_url": "https://pypi.org/project/digimat.saia/", "platform": "", "project_url": "https://pypi.org/project/digimat.saia/", "project_urls": { "Homepage": "http://www.digimat.ch" }, "release_url": "https://pypi.org/project/digimat.saia/0.1.12/", "requires_dist": null, "requires_python": "", "summary": "SAIA Burgess PCD EtherSBus Client+Server communication module", "version": "0.1.12" }, "last_serial": 3561594, "releases": { "0.0.100": [ { "comment_text": "", "digests": { "md5": "36dec7e400970e2073c0397979076b0d", "sha256": "013df1146a4be66c61511a4e8b3485b55f3f95eae13fb3218a556aef7117cd4b" }, "downloads": -1, "filename": "digimat.saia-0.0.100.tar.gz", "has_sig": false, "md5_digest": "36dec7e400970e2073c0397979076b0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55371, "upload_time": "2017-09-08T15:18:01", "url": "https://files.pythonhosted.org/packages/7e/65/101d1b12a7ca805260b9ce24f220e8f834e6b4ab96c83b32dc1de9d11701/digimat.saia-0.0.100.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "99200a71ed3e9ff054fd92b8c349bb54", "sha256": "79f0e06fcba1640df280aac4d57f35da2e79ba01d57322ccbd8498b04858e118" }, "downloads": -1, "filename": "digimat.saia-0.1.1.tar.gz", "has_sig": false, "md5_digest": "99200a71ed3e9ff054fd92b8c349bb54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55542, "upload_time": "2017-09-11T10:23:53", "url": "https://files.pythonhosted.org/packages/44/18/30da22a4b18e18d4729aeba9b7b5f144230cf0efc8aef599d1a8d3e1297a/digimat.saia-0.1.1.tar.gz" } ], "0.1.10": [ { "comment_text": "", "digests": { "md5": "d4f34dbef6d01a7f95cc85ea6c23e4b6", "sha256": "0c5193c4d7e99f47a55d8e10a15b1cd088006c4599b910a67e86faff89ffc4da" }, "downloads": -1, "filename": "digimat.saia-0.1.10.tar.gz", "has_sig": false, "md5_digest": "d4f34dbef6d01a7f95cc85ea6c23e4b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60884, "upload_time": "2017-10-25T20:34:14", "url": "https://files.pythonhosted.org/packages/5a/94/8bc7eae9a5d677ed9e5b264cf48755398709c9ed65fa27ce570e434be498/digimat.saia-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "477e6f2c7d9fcbec6ad5c07916322f78", "sha256": "950dba73947a6b8b171ab5ebeeca30839b809f6ff5659a43309859c8b144b015" }, "downloads": -1, "filename": "digimat.saia-0.1.11.tar.gz", "has_sig": false, "md5_digest": "477e6f2c7d9fcbec6ad5c07916322f78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60925, "upload_time": "2017-10-27T08:33:45", "url": "https://files.pythonhosted.org/packages/3a/7c/72306b4db1338a65367d8e5513f08fa221df56a6fb15488d1ed023815527/digimat.saia-0.1.11.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "8007d22cf08058dc2fe3ad41366c0f92", "sha256": "83eb684f67fce14809d8ae9a443d86914b8af7599a3bdbe755369ecd5bda8b70" }, "downloads": -1, "filename": "digimat.saia-0.1.12.tar.gz", "has_sig": false, "md5_digest": "8007d22cf08058dc2fe3ad41366c0f92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 64573, "upload_time": "2018-02-07T20:29:44", "url": "https://files.pythonhosted.org/packages/da/38/52f67d1c52811c729d412fd0dc643de438ec7a512ae3bd0bc95f14e917c9/digimat.saia-0.1.12.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "13ff0485bd49916d32d6be1910bb159f", "sha256": "f866295693b9bd79cf1624db39f2a9e4bdc27ada57a263fa0afb276585b1ee85" }, "downloads": -1, "filename": "digimat.saia-0.1.2.tar.gz", "has_sig": false, "md5_digest": "13ff0485bd49916d32d6be1910bb159f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56582, "upload_time": "2017-09-11T13:06:38", "url": "https://files.pythonhosted.org/packages/ce/88/e533d572614d0890ff71db50156ea2717e17095b3d610562f10887d97149/digimat.saia-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "a9b6bc73145ecae080a0b9fad1a49083", "sha256": "6dc8c4f05809e2034dc4c4d09918257c1ffe088bba979aae438560f3f5a27e98" }, "downloads": -1, "filename": "digimat.saia-0.1.3.tar.gz", "has_sig": false, "md5_digest": "a9b6bc73145ecae080a0b9fad1a49083", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56702, "upload_time": "2017-09-11T13:14:24", "url": "https://files.pythonhosted.org/packages/5c/f9/15163bcc625f0838f010dc773cc1d7f70ac2d147fb70ba907f2b7b047cce/digimat.saia-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "3d648a8acd4c6b7cfcc73d7f981e8a2c", "sha256": "326a170bd075b9f53b3c5619f4f9989deb801c11e8fbc90366f47e47c51aa756" }, "downloads": -1, "filename": "digimat.saia-0.1.4.tar.gz", "has_sig": false, "md5_digest": "3d648a8acd4c6b7cfcc73d7f981e8a2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56773, "upload_time": "2017-09-13T09:18:43", "url": "https://files.pythonhosted.org/packages/ff/80/20d6aca2accfa82bb8b048e86f9895b619b1dc58be4af66a8359f2deec00/digimat.saia-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "9ce9506ef343e30ba702b8aa7d40ba1f", "sha256": "ad9f225256c3d4f5a295bc65d9a9af71cabf94a14a1f435c001bf55707053b4d" }, "downloads": -1, "filename": "digimat.saia-0.1.5.tar.gz", "has_sig": false, "md5_digest": "9ce9506ef343e30ba702b8aa7d40ba1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59517, "upload_time": "2017-09-15T22:03:36", "url": "https://files.pythonhosted.org/packages/ef/30/815afb30470f11c92231af3c1f343371731451795d9bea2ccb80df0ab10a/digimat.saia-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "824fe99460b2252480b7ee2721504ab0", "sha256": "e40a9ebf35a54fa616c23002c906d74330e1b69ea028dda655baecf4145d08a4" }, "downloads": -1, "filename": "digimat.saia-0.1.6.tar.gz", "has_sig": false, "md5_digest": "824fe99460b2252480b7ee2721504ab0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59579, "upload_time": "2017-09-15T22:19:51", "url": "https://files.pythonhosted.org/packages/6e/54/1c70b2efe19743ecb211a8c85a5bb841f349ea4feffae92d036f7d82a418/digimat.saia-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "c24b0efa54855c50197cad1c4d676258", "sha256": "64676b1c3d9d928db952f1515980f389a2c55a38ddf1a0ca168b5b776a819667" }, "downloads": -1, "filename": "digimat.saia-0.1.7.tar.gz", "has_sig": false, "md5_digest": "c24b0efa54855c50197cad1c4d676258", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59579, "upload_time": "2017-09-15T22:21:52", "url": "https://files.pythonhosted.org/packages/bc/ae/82aaf5913ecc51b26078613ced4aeb6c7ea5faa542f105453f92bb576f20/digimat.saia-0.1.7.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "3c8915e0ae319291be9f32b91938b475", "sha256": "8e59e184f9930aa01a2eeb6ad9ef8593c42d0aabc9014307a615cfdae5bca11f" }, "downloads": -1, "filename": "digimat.saia-0.1.9.tar.gz", "has_sig": false, "md5_digest": "3c8915e0ae319291be9f32b91938b475", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60881, "upload_time": "2017-10-25T11:45:56", "url": "https://files.pythonhosted.org/packages/90/38/d3861b190f43ea998c109f64f73574a768fac5918bd34ed724cbf0675c3d/digimat.saia-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8007d22cf08058dc2fe3ad41366c0f92", "sha256": "83eb684f67fce14809d8ae9a443d86914b8af7599a3bdbe755369ecd5bda8b70" }, "downloads": -1, "filename": "digimat.saia-0.1.12.tar.gz", "has_sig": false, "md5_digest": "8007d22cf08058dc2fe3ad41366c0f92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 64573, "upload_time": "2018-02-07T20:29:44", "url": "https://files.pythonhosted.org/packages/da/38/52f67d1c52811c729d412fd0dc643de438ec7a512ae3bd0bc95f14e917c9/digimat.saia-0.1.12.tar.gz" } ] }