I am trying to use the AtomVM with esp32-CAM module. I have added the library as a dependency as it’s shown in the example:
{deps, [
{atomvm_esp32cam, {git, "https://github.com/atomvm/atomvm_esp32cam.git", {branch, "master"}}}
]}.
And in my code I do:
start() ->
ok = esp32cam:init(),
io:format("Camera initialized.~n"),
{ok, Image} = esp32cam:capture(),
io:format("Captured image. size=~p~n", [erlang:byte_size(Image)]).
When I upload the code on the code I am seeing this error:
I (824) AtomVM: Starting AtomVM revision 0.6.5
I (834) sys: Loaded BEAM partition boot.avm at address 0x1d0000 (size=262144 bytes)
I (854) network_driver: Initialized network interface
I (854) network_driver: Created default event loop
I (874) AtomVM: Found startup beam esp32init.beam
I (874) AtomVM: Starting esp32init.beam...
---
AtomVM init.
I (884) sys: Loaded BEAM partition main.avm at address 0x210000 (size=1048576 bytes)
Starting application...
CRASH
======
pid: <0.1.0>
Stacktrace:
[{esp32cam,init,1,[{file,"/Users/oleg/repos/atomvm_examples/erlang/tcp_server/_build/default/lib/atomvm_esp32cam/src/esp32cam.erl"},{line,52}]}]
cp: #CP<module: 4, label: 2, offset: 12>
x[0]: throw
x[1]: nif_error
x[2]: {1,1,103,1,[{5,35}],throw}
Stack
------
[]
#CP<module: 0, label: 34, offset: 0>
Mailbox
--------
Monitors
--------
**End Of Crash Report**
AtomVM finished with return value: throw
I (944) AtomVM: AtomVM application terminated. Going to sleep forever ...