Skip to content

pymongo timeout errors #4

@GemKosan

Description

@GemKosan

As a Rasp Pi & Grove noob, I'm having trouble getting this project to run without errors. I do have coding experience though not much in Python. Could you provide some advice on this error please?
Looks like maybe I need to configure the mongodb, but not sure how to do that.
Thanks in advance for your help with this!

CONTEXT

  • Rasberry Pi 3b+
  • GrovePi Plus Board
  • Grove - CO2 & Temperature & Humidity Sensor (SCD41) - connected to IC2-1 - red LED lit, config: scd4x_sensor_path = /dev/i2c-1
  • Grove - 4-Channel SPDT Relay - connected to IC2-2 - no LEDs lit
  • Grove - LCD RGB Backlight (Optional) - connected to IC2-3, disabled in config, displays 16 squares
  • Nothing connected to relay at this point

ERROR Stack trace

Please excuse any typos as I'm not able to copy/paste between devices right now:
ERROR Unhandled exception!
Traceback (most recent call last):
  File "..../ClimateControl.py" line 193, in main 
    mphdl.run()
  File "..../ClimateControl.py", line 51, in run 
    self.scd4x.read_wait_scd4x()
  File "..../lib/grove.py", line 153, in read _wait_scd4x 
    while not self.read_scd4x():
                     ^^^^^^^^^^^^^
  File "..../lib/grove.py", line 30 in update_sensor_database 
    mdb.collection.insert_one(data)
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/collection.py", line 658, in insert_one 
    self.insert_one(
    File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/collection.py", line 598, in insert_one 
    self.database.client.retryable_write(
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/mongo_client.py", line 1575, in retryable_write
    return self._retry_with_session(retryable, func, s, buld, operation, operation_id)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/mongo_client.py", line 1461, in _retry_with_session 
    return self._retry_internal(
               ^^^^^^^^^^^^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/_scot.py", line 108, in csot_wrapper
    return func(self, 'args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/mongo_client.py", line 1507, in _retry_internal).run()
                               ^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/mongo_client.py", line 2353, in run
    return self.read() if self._is_read else self.write()
                                                                    ^^^^^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/mongo_client.py", line 2456, in _write
    self.server = self._get_server()
                          ^^^^^^^^^^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/mongo_client.py", line 2439, in _get_server
    return self._client._select_server(
               ^^^^^^^^^^^^^^^^^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/mongo_client.py", line 1322, in _select_server
    server = topology.select_server(
                   ^^^^^^^^^^^^^^^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/topology.py", line 368, in select_server
    server = self._select_server(
                   ^^^^^^^^^^^^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/topology.py", line  346, in _select_server
    servers = self.select_servers(
                     ^^^^^^^^^^^^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/topology.py", line 253, in select_servers
    server_descriptions = self._select_servers_loop(
                                          ^^^^^^^^^^^^^^^^^^^^
  File "..../ClimateControl/virtualEnv/lib/python3.11/site-packages/pymongo/topology.py", line 303, in _select_servers_loop
    raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: 192.168.1.100:27017: timed out (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 30x, Topology Description: <TopologyDescription id: 66ea422dbff829e40ac49cde, topology_type: Unknown, servers: [<ServerDescription ('192.168.1.100', 27017) server_type: Unknown, rtt: None, error=NetworkTimeout('192.168.1.100:27017: timed out (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions