Trying to read a RPM PID I see in the minion logs -
2019-03-07 17:57:14,363 [messaging :222 ][ERROR ][863] Recurring exception (2 times) in worker thread 'readout_30sec' while running workflow for message: {'filter': 'alternating_readout', 'handler': 'query', 'returner': 'cloud', 'args': ['Motor_RPM_2'], 'kwargs': {'force': True, 'pid': 101, 'header': '7E4', 'mode': 220, 'formula': 'twos_comp(bytes_to_int(message.data[58:59])*256+bytes_to_int(message.data[59:60]),16)', 'protocol': 'auto'}}
Traceback (most recent call last):
File "/var/cache/salt/minion/extmods/utils/messaging.py", line 188, in do_work
self._call_hook_for(message, "workflow", message)
File "/var/cache/salt/minion/extmods/utils/messaging.py", line 395, in _call_hook_for
return True, func(*args, **kwargs)
File "/var/cache/salt/minion/extmods/utils/messaging.py", line 326, in extended_workflow
self._call_hook_for(message, "returner", message, result)
File "/var/cache/salt/minion/extmods/utils/messaging.py", line 395, in _call_hook_for
return True, func(*args, **kwargs)
File "/var/cache/salt/minion/extmods/utils/messaging.py", line 561, in returner_wrapper
return returner_func(result, *args, **kwargs)
File "/var/cache/salt/minion/extmods/returners/cloud_returner.py", line 189, in returner_data
cloud_cache.enqueue(r)
File "/var/cache/salt/minion/extmods/utils/cloud_cache.py", line 79, in enqueue
self.client.lpush(self.PENDING_QUEUE, json.dumps(data, separators=(",", ":")))
File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 1333, in lpush
return self.execute_command('LPUSH', name, *values)
File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 673, in execute_command
connection.send_command(*args)
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 610, in send_command
self.send_packed_command(self.pack_command(*args))
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 585, in send_packed_command
self.connect()
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 489, in connect
raise ConnectionError(self._error_message(e))
Now raw data is -
7EC103E620101FFF7E7
7EC21FFBC19AA465003
7EC22FFEA0FD10B0A0A
7EC230A0A0A00000ACE
7EC244BCE4600009300
7EC2500635E00006022
7EC26000025B7000023
7EC2716001227EB0901
7EC28940000000003E8
Debuging I notice the following extracts a byte correctly -
$ obd.query Motor_RPM_1 mode=220 pid=101 header='7E4' bytes=62 formula='bytes_to_int(message.data[55:56])' force=true
_type: motor_rpm_1
_stamp: '2019-03-07T20:05:04.742986'
value: 148
( 148 = 0x94 which we see on the last row )
But trying to get the next byte fails -
$ obd.query Motor_RPM_1 mode=220 pid=101 header='7E4' bytes=62 formula='bytes_to_int(message.data[56:57])' force=true
_type: motor_rpm_1
_stamp: '2019-03-07T20:07:02.456788'
value: |-
7EC103E620101FFF7E7
7EC21FFBC197D465003
7EC22FFE80FD30B0A0A
7EC230A0A0A00000ACE
7EC2447CE4600009300
7EC2500636000006022
7EC26000025B8000023
7EC2716001229110901
7EC28940000000003E8
Instead of a single byte returned, the whole message is.
I’m wondering if there is a limit to the size of a message ?
I did try increasing bytes but it didn’t seem to make much difference.