{"id":24305,"library":"pycampbellcr1000","title":"PyCampbellCR1000","description":"A Python library for communicating with Campbell Scientific CR1000 and similar dataloggers via TCP/IP or RS-232. Current version is 0.4. Development appears to be sporadic; no recent releases or updates.","status":"active","version":"0.4","language":"python","source_language":"en","source_url":"https://github.com/LionelDarras/PyCampbellCR1000","tags":["campbell","datalogger","cr1000","scientific-instrumentation"],"install":[{"cmd":"pip install pycampbellcr1000","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"CR1000","correct":"from pycampbellcr1000 import CR1000"}],"quickstart":{"code":"from pycampbellcr1000 import CR1000\n\n# Connect to datalogger via IP or serial\nlogger = CR1000.from_url('tcp:192.168.1.100:6789')\n# or serial: logger = CR1000.from_url('serial:/dev/ttyUSB0:115200')\n\n# Get table names\ntables = logger.get_table_names()\nprint('Tables:', tables)\n\n# Read data from a table (returns list of dicts)\ndata = logger.get_data('Table1', count=5)\nfor row in data:\n    print(row)\n\n# Close connection\nlogger.close()","lang":"python","description":"Connects to a CR1000 datalogger, retrieves table names, and reads sample data."},"warnings":[{"fix":"Use CR1000.from_url('tcp:host:port') instead of CR1000(host, port).","message":"As of v0.4, from_url() method used for connections; older examples may use CR1000(host, port) directly which may not work.","severity":"breaking","affected_versions":"0.3 and earlier"},{"fix":"import logging; logging.basicConfig(level=logging.DEBUG)","message":"The library uses Python's built-in logging; enable debug logging to see communication details.","severity":"gotcha","affected_versions":"all"},{"fix":"Use CR1000.from_url('tcp:host:port', timeout=10) to set a timeout.","message":"Data retrieval methods may block indefinitely if the datalogger is unreachable; set a timeout via the underlying socket timeout.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install pycampbellcr1000' in the correct environment.","cause":"Library not installed or installed into a different Python environment.","error":"ModuleNotFoundError: No module named 'pycampbellcr1000'"},{"fix":"Upgrade to latest: 'pip install --upgrade pycampbellcr1000'","cause":"Using an older version of the library (pre-0.4) where method names differed.","error":"AttributeError: 'CR1000' object has no attribute 'get_table_names'"},{"fix":"Verify datalogger IP and port (default 6789 for TCP). Ensure the datalogger is connected and network accessible.","cause":"Datalogger is not reachable at the specified IP/port or the server is not running.","error":"ConnectionRefusedError: [Errno 111] Connection refused"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}