PySOBUS provides ISO 11783 (ISOBUS) message specifications and decoding tools for proprietary messages which are not publicly defined.
The initial focus is on messages that are relevant to yield calculation. Currently supported are combines with AFS 700 or GreenStar 2600/2630 displays.
Message specifications are stored in pysobus/message_definitions.csv in the following format:
pgn_id
– parameter group numbermanufacturer
– equipment manufacturer, e.g. John Deere, Case, etc.source_address
– CAN bus network address for message senderpgn_length_bytes
– number of bytes per messagespn_start_position
– bit offset for the SPN (suspect parameter number) within the PGN message. Format: {byte offset}.{bit offset} (ones based). Examples: 1.1 => 0 bit offset, 2.3 => 10 bit offsetspn_bit_length
– number of bits for this SPNspn_id
– unique identifier (optional)spn_name
– descriptive functional name for SPNspn_description
– SPN descriptionscale_factor
– scale factor/multiplier for SPN (float)offset
– fixed offset for SPN (float)units
– SPN units, e.g. degrees, kg/sec, etc
Install from PyPI:
pip install pysobus
Alternatively, you can clone this repository and install it via setup.py
:
git clone https://github.com/FarmLogs/pysobus.git
cd pysobus/
python setup.py install
>>> from pysobus.parser import Parser
>>> p = Parser()
>>> p.parse_message('18FEF31C3D422397722E724B')
{'info': {'header': '18FEF31C',
'message': '18FEF31C3D422397722E724B',
'payload_bytes': ['3D', '42', '23', '97', '72', '2E', '72', '4B'],
'payload_int': 5436458769886429757,
'pgn': 65267,
'priority': 6,
'source': 28,
'timestamp': 0},
'pgn': 65267,
'spn_vals': {'Latitude': 43.56703329999999, 'Longitude': -83.4225806}}
Additional example messages with decoded results are available in pysobus/tests.