volttron

volttron scheduling actuator agent with CRON


For my volttron agent that I used the agent creation wizard to develop, can I get a tip on an error related to this , 'Timezone offset does not match system offset: -18000 != 0. Please, check your config files.'

When testing my script with the from volttron.platform.scheduling import cron feature I noticed the timezone/computer time was way off on my edge device so I reset the time zone with this tutorial which I am thinking definitely screwed things up.

ERROR: volttron.platform.jsonrpc.RemoteError: builtins.ValueError('Timezone offset does not match system offset: -18000 != 0. Please, check your config files.')

Whether or not this makes a difference this edge device does use the fowarding agent to push the data to a central VOLTTRON instance.

2021-05-14 12:45:00,007 (actuatoragent-1.0 313466) volttron.platform.vip.agent.subsystems.rpc ERROR: unhandled exception in JSON-RPC method 'request_new_schedule':
Traceback (most recent call last):
  File "/var/lib/volttron/volttron/platform/vip/agent/subsystems/rpc.py", line 158, in method
    return method(*args, **kwargs)
  File "/home/volttron/.volttron/agents/8f4ee1c0-74cb-4070-8a8c-57bf9bea8a71/actuatoragent-1.0/actuator/agent.py", line 1343, in request_new_schedule
    return self._request_new_schedule(rpc_peer, task_id, priority, requests, publish_result=False)
  File "/home/volttron/.volttron/agents/8f4ee1c0-74cb-4070-8a8c-57bf9bea8a71/actuatoragent-1.0/actuator/agent.py", line 1351, in _request_new_schedule
    local_tz = get_localzone()
  File "/var/lib/volttron/env/lib/python3.8/site-packages/tzlocal/unix.py", line 165, in get_localzone
    _cache_tz = _get_localzone()
  File "/var/lib/volttron/env/lib/python3.8/site-packages/tzlocal/unix.py", line 90, in _get_localzone
    utils.assert_tz_offset(tz)
  File "/var/lib/volttron/env/lib/python3.8/site-packages/tzlocal/utils.py", line 46, in assert_tz_offset
    raise ValueError(msg)
ValueError: Timezone offset does not match system offset: -18000 != 0. Please, check your config files.

This is my raise_setpoints_up function below that is alot like the CSV driver agent code.

def raise_setpoints_up(self):

_log.info(f'*** [Setter Agent INFO] *** -  STARTING raise_setpoints_up function!')
schedule_request = []

# create start and end timestamps
_now = get_aware_utc_now()
str_start = format_timestamp(_now)
_end = _now + td(seconds=10)
str_end = format_timestamp(_end)

# wrap the topic and timestamps up in a list and add it to the schedules list
for device in self.jci_device_map.values():
    topic = '/'.join([self.building_topic, device])
    schedule_request.append([topic, str_start, str_end])

# send the request to the actuator
result = self.vip.rpc.call('platform.actuator', 'request_new_schedule', self.core.identity, 'my_schedule', 'HIGH', schedule_request).get(timeout=4)
_log.info(f'*** [Setter Agent INFO] *** -  actuator agent scheduled sucess!')

Thanks for any tips


Solution

  • I suspect the time configured by tzdata is different than the timezone configured by the system since you changed this manually. Give this a try:

    sudo dpkg-reconfigure tzdata