{"id":13612973,"url":"https://github.com/namato/micropython-ov2640","last_synced_at":"2025-04-13T15:32:14.028Z","repository":{"id":97463945,"uuid":"92807807","full_name":"namato/micropython-ov2640","owner":"namato","description":"A MicroPython class for the ov2640 camera.","archived":false,"fork":false,"pushed_at":"2022-10-05T13:34:06.000Z","size":9,"stargazers_count":105,"open_issues_count":8,"forks_count":24,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-04-22T12:36:02.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/namato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-05-30T07:22:00.000Z","updated_at":"2024-04-22T05:37:15.000Z","dependencies_parsed_at":"2024-01-07T21:53:35.477Z","dependency_job_id":null,"html_url":"https://github.com/namato/micropython-ov2640","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namato%2Fmicropython-ov2640","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namato%2Fmicropython-ov2640/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namato%2Fmicropython-ov2640/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namato%2Fmicropython-ov2640/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/namato","download_url":"https://codeload.github.com/namato/micropython-ov2640/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248735846,"owners_count":21153483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T20:00:37.449Z","updated_at":"2025-04-13T15:32:13.782Z","avatar_url":"https://github.com/namato.png","language":"Python","funding_links":[],"categories":["精选驱动库","Libraries"],"sub_categories":["传感器","Sensors"],"readme":"\n# MicroPython class for OV2640 Camera\n\nThis is a basic interface to the [ArduCAM OV2640](http://www.arducam.com/camera-modules/2mp-ov2640/) under MicroPython for the ESP8266.  I wrote this because I could not find any good camera interfaces with MicroPython on the ESP8266.\n\nUsing this class you can:\n* Initiate still pictures up to 1600x1200 resolution\n* Read them from the camera\n* Save them to flash on the ESP8266\n\nAfter saving the image you can use other modules to post it to a REST API,\nor save a (short) history of pictures on the flash for later retrieval.\n\n## Usage - Hardware Setup\n\nThis particular camera has both an i2c and spi interface for setup and\ngetting data on/off the camera.  A good way to wire up the camera to\nthe ESP8266 is as follows (note Vcc and GND pins are not included here):\n\n Camera Pin | ESP8266 Pin  |\n| --------- | ------------ |\n| CS        | GPIO2        |\n| MOSI      | GPIO13       |\n| MISO      | GPIO12       |\n| SCK       | GPIO14       |\n| SDA       | GPIO4        |\n| SCL       | GPIO5        |\n\n## Usage - Software\n\nFirst upload the module 'ov2640.py' into the root filesystem on the\nESP8266 board you are using.  The [ampy](https://github.com/adafruit/ampy)\ntool from Adafruit is a useful tool for doing that.  Together with\n[esptool](https://github.com/espressif/esptool), you can re-flash your\nboard and load the code here in one shot with these commands.\n\nFirst download the latest MicroPython [image from here](http://micropython.org/download#esp8266).\n\n```\nsudo esptool.py --port /dev/ttyUSB0 erase_flash\nsudo esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 ~/Downloads/esp8266-20170526-v1.9.bin\ngit clone https://github.com/namato/micropython-ov2640\ncd micropython-ov2640\nsudo ampy -p /dev/ttyUSB0 put boot.py\nsudo ampy -p /dev/ttyUSB0 put main.py\nsudo ampy -p /dev/ttyUSB0 put ov2640_constants.py\nsudo ampy -p /dev/ttyUSB0 put ov2640_hires_constants.py\nsudo ampy -p /dev/ttyUSB0 put ov2640_lores_constants.py\nsudo ampy -p /dev/ttyUSB0 put ov2640.py\n```\n\nThen initialize and capture still frames using code like this.  The included `main.py` contains an example.\n\n```\nimport ov2640\ncam = ov2640.ov2640()\nnbytes = cam.capture_to_file(\"/image.jpg\")\n```\nYou can then retrieve the image off of the board, upload it to a server, etc.\n\nA good way to retrieve files for testing/verification is\n[rshell](https://github.com/dhylands/rshell).\n\n```\nsudo rshell -p /dev/ttyUSB0\nConnecting to /dev/ttyUSB0 ...\nWelcome to rshell. Use Control-D to exit.\n/home/namato/micropython-ov2640\u003e \n/home/namato/micropython-ov2640\u003e cp /image2.jpg .\n```\n\nThis will copy the newly created image locally for viewing.\n\n## Credits\n\nThe original driver source from Arducam was instrumental in the creation of this pure\nMicroPython version.\n\nThe overall project was inspired by\n[esparducam](https://johan.kanflo.com/building-the-esparducam/), but\ngetting this to work doesn't require any SMD soldering. :)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamato%2Fmicropython-ov2640","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamato%2Fmicropython-ov2640","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamato%2Fmicropython-ov2640/lists"}