lemariva / uPyCam

Take a photo with an ESP32-CAM running MicroPython
https://lemariva.com/blog/2019/09/micropython-how-about-taking-photo-esp32
Apache License 2.0
140 stars 42 forks source link

camera.init() failure #6

Closed johncblacker closed 4 years ago

johncblacker commented 4 years ago

I have a ttgo-camera-plus board which has a pin configuration different from what the default camera module expects, therefore it fails. Is there a way to create a "config" file and pass that as a parameter to the camera.init() and in that config file define the pin configuration for the boards camera? Or, if a mp distro can be built, where in the source are the pins defined?

lemariva commented 4 years ago

The pin configuration is here. I will extend the driver to include a pin-config like this one.

johncblacker commented 4 years ago

Thank you. Do I need to rebuild micropython in order to add your changes or are you providing a .bin file for the esp32 firmware? If I have to rebuild, do you have a specific release/commit of micropython that your are testing with? Thank you for help.

lemariva commented 4 years ago

If you want to make the changes now, you need to rebuild the micropython version as described here: https://lemariva.com/blog/2019/09/micropython-how-about-taking-photo-esp32 I can provide a bin file. But, if you needed ASAP you should try changing the pins and compiling.

lemariva commented 4 years ago

The firmware with pin selection is included here: https://github.com/lemariva/micropython-camera-driver You can follow the instructions to build the firmware from scratch or just flash the included bin file. An example is also available in the README file. I tested it with the ESP32-CAM and the M5CAMERA (B).

johncblacker commented 4 years ago

Thank you so very much. I will give this a try tomorrow and let you know my results.

From: Mauro Riva notifications@github.com Sent: Saturday, June 20, 2020 5:43 PM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

The firmware with pin selection is included here: https://github.com/lemariva/micropython-camera-driver You can follow the instructions to build the firmware from scratch or just flash the included bin file. An example is also included in the description. I tested it with the ESP32-CAM and the M5CAMERA (B).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#issuecomment-647048628 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAVKYITTEBGRZJUGZHLRXUUPPANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAAXAKSZRKMJK6QDW2PTRXUUPPA5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE2IS3NA.gif

johncblacker commented 4 years ago

I gave it a shot and here’s my call to camera.init():

            camera.init(0, d0=34, d1=13, d2=26, d3=35, d4=39, d5=38, 

              d6=37, d7=36, format=camera.JPEG, 

              xclk_freq=camera.XCLK_FREQ_10MHz,

              href=27, vsync=5, reset=-1, sioc=23, siod=18,

              xclk=4, pclk=25)  #TTGO-CAMERA-PLUS

I get:

            Error occurred: ‘module’ object has no attribute ‘XCLK_FREQ_10MHz’

however, it did seem to take pictures with my ESP32-CAM board; however, I don’t have an sd card on it so I can’t

download the picoweb, micropython-ulogging and ujson modules because I’ve run out of space on the board and can’t run webcam

to see what I’m getting.

Do you have any ideas?

From: Mauro Riva notifications@github.com Sent: Saturday, June 20, 2020 5:43 PM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

The firmware with pin selection is included here: https://github.com/lemariva/micropython-camera-driver You can follow the instructions to build the firmware from scratch or just flash the included bin file. An example is also included in the description. I tested it with the ESP32-CAM and the M5CAMERA (B).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#issuecomment-647048628 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAVKYITTEBGRZJUGZHLRXUUPPANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAAXAKSZRKMJK6QDW2PTRXUUPPA5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE2IS3NA.gif

johncblacker commented 4 years ago

I went at it a different way. I simply dropped the xclk_freq parameter from my call and let it default and that got around the problem I recently reported.

But, I got a problem with the webcam stuff…when I connected to webserver I get 500 Internal Privoxy Error which I have never seen before.

I did verify that my ssid and password are correct since if they weren’t I would not get the network ip listed.

Any ideas on this one? Picoweb issue?

From: Mauro Riva notifications@github.com Sent: Saturday, June 20, 2020 5:43 PM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

The firmware with pin selection is included here: https://github.com/lemariva/micropython-camera-driver You can follow the instructions to build the firmware from scratch or just flash the included bin file. An example is also included in the description. I tested it with the ESP32-CAM and the M5CAMERA (B).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#issuecomment-647048628 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAVKYITTEBGRZJUGZHLRXUUPPANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAAXAKSZRKMJK6QDW2PTRXUUPPA5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE2IS3NA.gif

johncblacker commented 4 years ago

OK, found that the 500 Privoxy Error was the result of my being connected with VPN. Apparently that won’t work even though I’m not going outside my local intranet.

VPN is starting to suck for me. Using SurfShark and I have problems connecting to my email server when I have VPN turned on and they don’t know how to fix except

to disable it from everything except Browser; and now it seems that even browser is a problem….arghhhhhhhhhhhhhhhhhhhh!

Thanks for help. So, just get back to me about the fix for the xclk_freq issue, if you would. XCLK_FREQ_10MHz isn’t accepted, even though that’s your default!

jb

From: Mauro Riva notifications@github.com Sent: Saturday, June 20, 2020 5:43 PM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

Closed #6 https://github.com/lemariva/uPyCam/issues/6 .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#event-3465025232 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAVKYITTEBGRZJUGZHLRXUUPPANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAAQVJWUFCRGFMZQYCFLRXUUPPA5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOZ2EBNUA.gif

lemariva commented 4 years ago

I uploaded the firmware twice today, and I think you picked the one that had an error (it was only 20 minutes online, sorry). Just clone the last version, and the xclk_freq problem should be solved.

johncblacker commented 4 years ago

Thank you for the new firmware, haven’t tried it yet. I want to get the webcam server code working; but, I’m not familiar with picoweb, nor with @app.route(“/”), so perhaps you could guide me to a site where I could learn how to use picoweb in order to understand the workings of the webcam.py program. Also, what I’ve found is that the esp32-cam board that I have doesn’t have enough storage to load the uPyCam programs plus the picoweb, micropython-ulogging and ujson code. I have to rely on using an sdcard with my TTGO-CAMERA-PLUS board, but I don’t have an external sdcard reader I can use with the esp32-cam boards.

From: Mauro Riva notifications@github.com Sent: Sunday, June 21, 2020 1:49 PM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

I uploaded the firmware twice today, and I think you picked the one that had an error (it was only 20 minutes online, sorry). Just clone the last version, and the xclk_freq problem should be solved.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#issuecomment-647159770 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAUVEDXLZJ7SUTHZ4ZTRXZB2RANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAAUOY3I5ARR3SJLOZYTRXZB2RA5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE2JN7WQ.gif

johncblacker commented 4 years ago

Take a look at the output below of my attempted camera.init just from repl, then it went into a reboot (crash).

Link to Espressif error codes -> https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/error-codes.html.

Note: I2C driver install error a few lines down:

OSError: Camera Init Failed

camera.init(0, d0=34, d1=13, d2=26, d3=35, d4=39, d5=38,

...

... d6=37, d7=36, format=camera.JPEG,

...

... href=27, vsync=5, reset=-1, sioc=23, siod=18,

...

... xclk=4, pclk=25)

[0;32mI (2595505) sccb: pin_sda 18 pin_scl 23

[0m

[0;31mE (2595505) i2c: i2c driver install error[0m

[0;32mI (2595505) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m

[0;32mI (2595665) gpio: GPIO[36]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

[0;32mI (2595665) gpio: GPIO[37]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

[0;32mI (2595675) gpio: GPIO[38]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

[0;32mI (2595685) gpio: GPIO[39]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

[0;32mI (2595695) gpio: GPIO[35]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

[0;32mI (2595705) gpio: GPIO[26]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

[0;32mI (2595715) gpio: GPIO[13]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

[0;32mI (2595725) gpio: GPIO[34]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

[0;32mI (2595735) gpio: GPIO[5]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

[0;32mI (2595735) gpio: GPIO[27]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

[0;32mI (2595745) gpio: GPIO[25]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m

ESP_ERROR_CHECK failed: esp_err_t 0x105 (ESP_ERR_NOT_FOUND) at 0x4009a534

file: "/home/lemariva/esp/esp-idf/components/esp32-camera/driver/camera.c" line 452

func: i2s_init

expression: esp_intr_alloc(ETS_I2S0_INTR_SOURCE, ESP_INTR_FLAG_INTRDISABLED | ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_IRAM, &i2s_isr, NULL, &s_state->i2s_intr_handle)

ELF file SHA256: 0000000000000000

Backtrace: 0x40099e6c:0x3ffd7280 0x4009a537:0x3ffd72a0 0x4016b1a1:0x3ffd72c0 0x4016b8e1:0x3ffd7370 0x400fc466:0x3ffd73a0 0x400e4426:0x3ffd7410 0x400e017d:0x3ffd7440 0x400e02b6:0x3ffd7460 0x400ee5ff:0x3ffd7480 0x400e44f4:0x3ffd7520 0x400e017d:0x3ffd7550 0x400e01a6:0x3ffd7570 0x401041fc:0x3ffd7590 0x4010441e:0x3ffd7620 0x400f7bd4:0x3ffd7660 0x40091859:0x3ffd76a0

Rebooting...

ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

configsip: 0, SPIWP:0xee

clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00

mode:DIO, clock div:2

load:0x3fff0018,len:4

load:0x3fff001c,len:5180

load:0x40078000,len:14032

load:0x40080400,len:3800

entry 0x4008063c

[0;32mI (588) psram: This chip is ESP32-D0WD[0m

[0;32mI (588) spiram: Found 64MBit SPI RAM device[0m

[0;32mI (588) spiram: SPI RAM mode: flash 40m sram 40m[0m

[0;32mI (591) spiram: PSRAM initialized, cache is in low/high (2-core) mode.[0m

[0;32mI (598) cpu_start: Pro cpu up.[0m

[0;32mI (602) cpu_start: Application information:[0m

[0;32mI (607) cpu_start: Compile time: Jun 20 2020 11:34:03[0m

[0;32mI (613) cpu_start: ELF file SHA256: 0000000000000000...[0m

[0;32mI (619) cpu_start: ESP-IDF: v4.0.1[0m

[0;32mI (624) cpu_start: Starting app cpu, entry point is 0x40083990[0m

[0;32mI (616) cpu_start: App cpu up.[0m

[0;32mI (1499) spiram: SPI SRAM memory test OK[0m

[0;32mI (1500) heap_init: Initializing. RAM available for dynamic allocation:[0m

[0;32mI (1500) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM[0m

[0;32mI (1506) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM[0m

[0;32mI (1512) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM[0m

[0;32mI (1519) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM[0m

[0;32mI (1525) heap_init: At 3FFCB708 len 000148F8 (82 KiB): DRAM[0m

[0;32mI (1531) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM[0m

[0;32mI (1538) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m

[0;32mI (1544) heap_init: At 4009BAEC len 00004514 (17 KiB): IRAM[0m

[0;32mI (1550) cpu_start: Pro cpu start user code[0m

[0;32mI (1555) spiram: Adding pool of 4096K of external SPI memory to heap allocator[0m

[0;32mI (1577) spi_flash: detected chip: generic[0m

[0;32mI (1577) spi_flash: flash io: dio[0m

[0;32mI (1578) cpu_start: Starting scheduler on PRO CPU.[0m

[0;32mI (0) cpu_start: Starting scheduler on APP CPU.[0m

[0;32mI (1585) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations[0m

[0;32mI (1635) main: Allocated 2048K for micropython heap at 0x3f940020[0m

[0;32mI (2135) modsocket: Initializing[0m

I (2445) wifi:wifi driver task: 3ffda7e8, prio:23, stack:6656, core=0

[0;32mI (2445) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m

[0;32mI (2455) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m

I (2475) wifi:wifi firmware version: aa5336b

I (2475) wifi:config NVS flash: enabled

I (2475) wifi:config nano formating: disabled

I (2475) wifi:Init dynamic tx buffer num: 32

I (2485) wifi:Init data frame dynamic rx buffer num: 32

I (2485) wifi:Init management frame dynamic rx buffer num: 32

I (2495) wifi:Init management short buffer num: 32

I (2495) wifi:Init static tx buffer num: 16

I (2505) wifi:Init static rx buffer size: 1600

I (2505) wifi:Init static rx buffer num: 10

I (2505) wifi:Init dynamic rx buffer num: 32

connecting to network...

[0;32mI (2615) phy: phy_version: 4180, cb3948e, Sep 12 2019, 16:39:13, 0, 0[0m

I (2615) wifi:mode : sta (24:6f:28:79:2c:48)

[0;32mI (2615) wifi: STA_START[0m

I (2735) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1

I (3435) wifi:state: init -> auth (b0)

I (3445) wifi:state: auth -> assoc (0)

I (3475) wifi:state: assoc -> run (10)

I (3485) wifi:connected with BHNTG1682GDC08, aid = 3, channel 1, BW20, bssid = 78:23:ae:5e:87:31

I (3495) wifi:security: WPA2-PSK, phy: bgn, rssi: -39

I (3495) wifi:pm start, type:

From: Mauro Riva notifications@github.com Sent: Sunday, June 21, 2020 1:49 PM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

I uploaded the firmware twice today, and I think you picked the one that had an error (it was only 20 minutes online, sorry). Just clone the last version, and the xclk_freq problem should be solved.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#issuecomment-647159770 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAUVEDXLZJ7SUTHZ4ZTRXZB2RANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAAUOY3I5ARR3SJLOZYTRXZB2RA5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE2JN7WQ.gif

johncblacker commented 4 years ago

Tried building your repository/firmware myself. I wanted to add sdcard support but ran into a problem with make.

* make output errors *****

make: *** No rule to make target '/home/jobla/esp32cam/esp-idf/components/esp32/ld/esp32.project.ld.in', needed by 'build-GENERIC/esp32.project.ld'. Stop.

** end of errors ****

I suspect you didn’t run into this problem creating firmware. Any ideas? I cloned the micropython.git repository (latest), looked at the ESPIDF has in the Makefile and

in the esp-idf directory did a git check --> supported hash <-- Now maybe my micropython is at a different level than yours, but this problem is on the esp-idf side,

not micropython.

Any ideas? Or, perhaps you could put your fork of micropython on github under your id and I can build from it?

Thanks.

John Blacker

From: Mauro Riva notifications@github.com Sent: Saturday, June 20, 2020 5:43 PM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

Closed #6 https://github.com/lemariva/uPyCam/issues/6 .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#event-3465025232 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAVKYITTEBGRZJUGZHLRXUUPPANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAAQVJWUFCRGFMZQYCFLRXUUPPA5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOZ2EBNUA.gif

johncblacker commented 4 years ago

So, I've managed to build firmware using the commit of MP that you point to on your website and have found that firmware already has an sdcard driver.

So, for example, with my esp32-cam board I can simply do:

Import machine

import os

os.mount(machine.SDCard(slot=-1, sck=18, mosi=23, miso=19, cs=5), "/sd")

There's no need for the sdcard.py in your repository, nor the longform method of creating "sd" and then performing the mount.

The config information is already in the config.py, so the above could be made more general.

I was able to get the esp32-cam working and being able to view the picture from a webpage. Now, I've gotten the repository with the esp camera code that

is supposed to fix the "isr issue" and will integrate that and get back to my TTGO-CAMERA-PLUS. Also, I want to get streaming working; I already have a MQTT server setup on my p/c.

Thanks for your hard work, it's much appreciated!

John

lemariva commented 4 years ago

You can check the new article on my website: https://lemariva.com/blog/2020/06/micropython-m5camera-timelapse-over-mqtt

johncblacker commented 4 years ago

I’m getting an error during camera.init() for my TTGO-CAMERA-PLUS board. The error is:

[0;33mW (540965) camera: gpio_install_isr_service already installed[0m

[0;31mE (540965) sccb: SCCB_Write Failed addr:0x30, reg:0x05, data:0x01, ret:263[0m

I’m seeing that there’s a fix for this, but it doesn’t seem to be in your firmware and when I build from

the repositories you supposedly build from, the board won’t boot, or at least that’s what it seems, I can’t

connect with a terminal and get to REPL.

Do you have firmware with the “isr” fix in it available?

Thanks.

John Blacker

From: Mauro Riva notifications@github.com Sent: Wednesday, June 24, 2020 4:06 PM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

You can check the new article on my website: https://lemariva.com/blog/2020/06/micropython-m5camera-timelapse-over-mqtt

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#issuecomment-649042115 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAVLUJVQIWNUKZXGYLDRYJMDLANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAAW3YFXIBMBOIXI6CELRYJMDLA5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE2XZRQY.gif

lemariva commented 4 years ago

The error that you saw doesn't stop the camera from working. Just ignore it!

The fix is not a fix, it makes that the camera doesn't stop from working, but the board still reports it.

The fix was applied as you may already have seen, I forked the repository and added the PR, that you mentioned.

Please follow the instructions to compile. It works. Check my blog for that.

Otherwise, if you find a problem or a bug, feel free to fork the repo, repair it and submit a PR.

johncblacker commented 4 years ago

I apologize for bothering you with my problem…I appreciated the information you have provided so far, but now

it seems you no longer wish to help me. Therefore, I will honor your wishes and will no longer bring any issues to

your attention. And, since you’ll have more time on your hands since you won’t be responding to my issues, you

can take that time to straighten out your repositories regarding the ESP32-CAM, et al. – they’re a mess!

jb

From: Mauro Riva notifications@github.com Sent: Friday, June 26, 2020 8:19 PM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

The error that you saw doesn't stop the camera from working. Just ignore it. The fix is not a fix itself, it makes that the camera doesn't stop from working. The fix was applied as you may already saw, I forked the repository and added the PR. Please follow the instructions to compile. It works. Otherwise, if you find a problem or a bug, fell free to fork the repo, repair it and submit a PR.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#issuecomment-650460342 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAQEYXGZI6PAF3RUP7DRYU3F3ANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAASIDDTHS76GL5V2ZPTRYU3F3A5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE3CTZNQ.gif

lemariva commented 4 years ago

John, I did answer every issue that you wrote. I'm taking the time to answer this complaint too. Furthermore, I've extended the driver so that you can use it with the TTGO camera.

Your profile says that you have programming knowledge in many popular languages, that means you can program. That is why I was asking you to repair the code (if it was broken) and extend it. The repository is open-source with an Apache 2.0 license. Thus, you can contribute to the repository and even though you can use it for commercial purposes.

The code is not a final product, and I am not selling it. I published the code that I wrote in my "hobby/free" time so that you and many others can play with an ESP camera and MicroPython. I am helping people to start coding.

I saw that you joined Github some time ago, and the last months you were only generating issues. That is very nice! We have you as a code tester! But, you can't ask us to make everything for you. Thus, it would be great to see that you use your programming skills and contribute to the community. I can also tell you, that my code maybe is a mess, but I code and try to improve every day (I don't only complain). Therefore, if you have some suggestions about my code, it would be great to hear them: Please take the time, fork the repository(/ies), modify the code (they are popular languages: C & Python) so that it is not a mess, and submit a PR. It would be much appreciated! and thank you in advance! :)

johncblacker commented 4 years ago

You misunderstood what I was trying to say. I have no complaints with your code, but your instructions for mp build don’t seem correct. Also, you have changed the organization of your repos to accommodate time-lapse(?) and the names cause confusion for me. I appreciated the code you created t make board selection at run-time, but I think that having a general firmware for many boards might not be so good because the board vendors have different size external ram - my TTGO has 8mb but all doesn’t seem to be avail. I’m curious how you got m5 cam to work, because I get “heap” corruption errors with my M5CAM bd.

Sent from my iPad

On Jul 2, 2020, at 1:45 PM, Mauro Riva notifications@github.com wrote:

 John, I did answer every issue that you wrote. I'm taking the time to answer this complaint too. Furthermore, I've extended the driver so that you can use it with the TTGO camera.

Your profile says that you have programming knowledge in many popular languages, that means you can program. That is why I was asking you to repair the code (if it was broken) and extend it. The repository is open-source with an Apache 2.0 license. Thus, you can contribute to the repository and even though you can use it for commercial purposes.

The code is not a final product, and I am not selling it. I published the code that I wrote in my "hobby/free" time so that you and many others can play with an ESP camera and MicroPython. I am helping people to start coding.

I saw that you joined Github some time ago, and the last months you were only generating issues. That is very nice! We have you as a code tester! But, you can't ask us to make everything for you. Thus, it would be great to see that you use your programming skills and contribute to the community. I can also tell you, that my code maybe is a mess, but I code and try to improve every day (I don't only complain). Therefore, if you have some suggestions about my code, it would be great to hear them: Please take the time, fork the repository(/ies), modify the code (they are popular languages: C & Python) so that it is not a mess, and submit a PR. It would be much appreciated! and thank you in advance! :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lemariva commented 4 years ago
johncblacker commented 4 years ago

Thanks for the reply, Mauro,

Yes, I always do an erase_flash prior to any firmware load. Line 477 in multi_heap.c is where the error occurs.

Function is “multi_heap_free_impl” but I don’t have a clue about any of this esp-idf code to even begin to

determine what’s wrong. An os.statvfs(‘/’) produces:

(4096, 4096, 512, 482, 482, 0, 0, 0, 0, 255)

which seems to indicate 482 blocks of size 4096 are free, which is almost 2MB which is half of the PSRAM (4MB, according to the

docs).

Secondly, I’m wondering why your M5CAM works, yet mine doesn’t. I got it off of Amazon and it

took a while to get the correct pin settings correct (there’s several different versions apparently).

But, I get the error of a bad (NULL) pointer in the multi_heap.c at line 477.

You mention “partitions” in your reply and I looked in the build output and see:

application.bin, bootloader.bin, firmware.bin and partitions.bin are built. Sizes are:

rw-rw-rw- 1 jobla jobla 1496704 Jun 27 16:15 application.bin

-rw-rw-rw- 1 jobla jobla 23232 Jun 27 16:14 bootloader.bin

-rw-rw-rw- 1 jobla jobla 1558144 Jun 27 16:15 firmware.bin

-rw-rw-rw- 1 jobla jobla 3072 Jun 27 16:13 partitions.bin

Firmware.bin seems to be the combination of the other three .bin files, indicating that there is partition info

in the firmware.bin that gets flashed. In fact, I can see if I run a couple of repl commands that there appears

to be 2 partition “types”, 0 and 1. I’ve tried using some of the esp32.Partition commands but haven’t figured

them out yet. But, there seems to be a couple of partitions on the M5CAM board flashed with the firmware.bin

file from my build.

Now, if I were to change the “main” file value from 2 to something else, which way should I go, up to 3, or down to 1.8 (if that’s even a valid value?

Once again, thanks for your help. I’m trying to learn this as fast as I can to get my boards all working.

John Blacker

From: Mauro Riva notifications@github.com Sent: Friday, July 3, 2020 11:15 AM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

// allocate part of PSRAM for micropython, leave rest for native camera module mp_task_heap_size = 2 1024 1024; void *mp_task_heap = malloc(mp_task_heap_size); ESP_LOGI("main", "Allocated %dK for micropython heap at %p", mp_task_heap_size/1024, mp_task_heap);

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#issuecomment-653591838 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAVDTB2G472J637HYYTRZXYXFANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAAQADRGI7UU6MXLDXL3RZXYXFA5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE32QKHQ.gif

lemariva commented 4 years ago

John, I cannot help you with that. You are going deep into the ESP-IDF files, settings, and errors, and I don't have that expertise. Sorry, the partitions shouldn't be an issue here. The flash is not giving you any problems. I go that wrong, I was thinking about "out of space" and not "out of memory". Yes, there are many camera versions. I got the M5Camera B, which is different from the M5CAM and there are three versions of the M5Camera with different pin settings: https://github.com/m5stack/M5Stack-Camera

johncblacker commented 4 years ago

Mauro,

I just want to pass along some information regarding the “webcam.py” script, at least as it applies to my TTGO-CAMERA-PLUS board. On a positive note, I was able to finally

make it work – taking a single camera shot each time refresh webpage is issued; however, what I had to do was revamp the webcam.py script for my board without the

two “if” statements and instead, just presume the camera.init(…..) was successful. The reason was that even when the camera.init(….) was successful, the “if” statement

was always satisfied – meaning there was an error in the init. I’m not sure about the other boards and whether they will pass back a return codes like True or False but my

board does not. So, your idea of possibly trying 2 camera.init(….) and if those don’t work, then return a 503 error just doesn’t work for my TTGO… board.

Also, I tried several different values for the ram size in the main.c program and couldn’t get them to even flash and run on the M5CAM – don’t know why. After I flash the

firmware onto the board, the “led” light stays on and I cannot connect to the board with uPyCraft or any other terminal program – it’s like it’s in a loop and never comes out

of it. I’ll work on it some more.

Thank you for “listening” to my status update.

John Blacker

From: Mauro Riva notifications@github.com Sent: Friday, July 3, 2020 11:15 AM To: lemariva/uPyCam uPyCam@noreply.github.com Cc: John Blacker joblacker@cfl.rr.com; Author author@noreply.github.com Subject: Re: [lemariva/uPyCam] camera.init() failure (#6)

// allocate part of PSRAM for micropython, leave rest for native camera module mp_task_heap_size = 2 1024 1024; void *mp_task_heap = malloc(mp_task_heap_size); ESP_LOGI("main", "Allocated %dK for micropython heap at %p", mp_task_heap_size/1024, mp_task_heap);

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lemariva/uPyCam/issues/6#issuecomment-653591838 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6WAAVDTB2G472J637HYYTRZXYXFANCNFSM4N4QS5YA . https://github.com/notifications/beacon/AB6WAAQADRGI7UU6MXLDXL3RZXYXFA5CNFSM4N4QS5YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE32QKHQ.gif

lemariva commented 4 years ago

a return codes like True or False

Sorry John, but you don't check the repositories. Therefore, you are duplicating issues. I've already solved that issue 12 days ago.