Comments (5)
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.
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()
43272This are the results:
require('bme280')
=type(bme280)
romtable
=bme280
romtable: 0x402764a0
=type(bme280.read)
nil
Do you have any idea?
from aqmon.
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.
Hi avaldebe,
thank you very much for your help. Renaming solved the problem!
from aqmon.
Great! Closing the issue now. Just re-open it if you need more help.
from aqmon.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aqmon.