Code Monkey home page Code Monkey logo

Comments (5)

avaldebe avatar avaldebe commented on September 25, 2024

Hi @pr-boh,

To me, it seems that the module is not loading correctly.
Can you try the following?

require('bme280')
=type(bme280)
=bme280
=type(bme280.read)
=bme280.read

If any of the output is nil the module did not loaded correctly.

from aqmon.

pr-boh avatar pr-boh commented on September 25, 2024

Hi avaldebe,
Thank you for your help!

I tried your suggestion on a clean (formatted) nodemcu with firmware from http://nodemcu-build.com/ . Only two modules are loaded: bme280.lua and setup.lua for testing (code see above).
I use esplorer.jar for loading and testing.

FS Info:

bme280.lua : 11625 bytes

bme280_aqmon-setup.lua : 404 bytes

Total file(s) : 2
Total size : 12029 bytes

Total : 3351101 bytes
Used : 12801 bytes
Remain: 3338300 bytes

=node.info()
1 5 1 7054 1458400 4096 2 40000000
=node.heap()
43272

This are the results:
require('bme280')
=type(bme280)
romtable
=bme280
romtable: 0x402764a0
=type(bme280.read)
nil
Do you have any idea?

from aqmon.

avaldebe avatar avaldebe commented on September 25, 2024

Are you by any case using a deb build with a native bme280 module?
That would explain why type(bme280) returns romtable and why type(bme280.read) returns nil,
as require will load the native module before attempting to load bme280.lc and bme280.lua.
If that is the case, you need to rename bme280.lua so require does not get confused...

from aqmon.

pr-boh avatar pr-boh commented on September 25, 2024

Hi avaldebe,

thank you very much for your help. Renaming solved the problem!

from aqmon.

avaldebe avatar avaldebe commented on September 25, 2024

Great! Closing the issue now. Just re-open it if you need more help.

from aqmon.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.