atomvm / atomvm_dht

DHT11 and DHT12 drivers for AtomVM
Apache License 2.0
1 stars 1 forks source link

Failed to open module dht_example.beam #1

Closed ngomandat234 closed 8 months ago

ngomandat234 commented 1 year ago

Hi all,

When opening the monitor of esp32 I found that there was a line: Failed to open module dht_example.beam then crash. Module dht can not be resolved. Could you help me for this case?

Thanks a lot

fadushin commented 1 year ago

Hell @ngomandat234 .

Can you say more about what you have tried to do?

In order to make this project work, you will need to:

I am not sure from what you have written what from the above steps you have tried or succeeded at.

Thanks!

fadushin commented 1 year ago

Note that I had some old changes I made to this repo that I neglected to commit, but I just committed and tested the code, so it should run once you get all the steps in order. I have also updated some of the links in the docs, which had gone stale.

ngomandat234 commented 12 months ago

Hi @fadushin,

Thanks a lot for your information.

That is my fault when not compiling the atomvn_dht nif included. However, I try to include this nif and build again but it still failed

a1 image

I think it does not build with the atomvn_dht nif successfully.

Here is my step by step: copy the atomvm_dht.c to AtomVM/src/platforms/esp32/components/avm_buildtins/ copy the include/atomvm_dht/h to AtomVM/src/platforms/esp32/components/avm_buildtins/include/ Add line atomvm_dht.c in AtomVM/src/platforms/esp32/components/avm_buildtins/CMakeLists.txt Then AtomVM/src/platforms/esp32/build/mkimage.sh and AtomVM/src/platforms/esp32/build/flashimage.sh Use rebar flash the atomvm_dht repo to the esp32.

Could you help quick check for me?

Thanks a lot!

UncleGrumpy commented 12 months ago

What you actually need to do is clone this entire repository into the AtomVM/src/platforms/esp32/components directory. Then re-configure the project with idf.py menuconfig and just quit, saving the changes if promoted. To make sure you have it set up correctly you can look near the bottom of the components menu in menuconfig and you should see a new ATOMVM_DHT component which should be enabled by default if you open that submenu. Hope this helps.

ngomandat234 commented 12 months ago

Hi all,

It works for me. Many thanks @UncleGrumpy

UncleGrumpy commented 11 months ago

Hi all,

It works for me. Many thanks @UncleGrumpy

If you have no other problems would you mind closing the issue?

Unless you would like to make a suggestion about how we could make this more clear in our documentation, so we can help other users avoid this problem.