alexryd / fody-tempus-pro-logger

Logs sensor readings from Fody Tempus Pro weather stations
3 stars 2 forks source link

Problems to get it running #2

Open sjo00 opened 4 years ago

sjo00 commented 4 years ago

Hello Alex,

i hope you can help me with getting Data from the Weahter Station and send it to influxdb. I am using a raspberry 3b+ (raspbian buster) and the fody tempus pro weather station.

Perhaps and if your project is outdated, you know a similar project. Possible that you know other manufacturer or productnames for the weather station. So far i know are Alecto WS-4500 and Bresser Weather Center similar.

My try from your Repo is below.

ttn@loragateway:~ $ uname -a

Linux loragateway 4.19.93-v7+ #1290 SMP Fri Jan 10 16:39:50 GMT 2020 armv7l GNU/Linux

ttn@loragateway:~ $ cat /etc/debian_version

10.2

ttn@loragateway:~ $ nodejs --version

v12.14.1

ttn@loragateway:~ $ npm version

{ npm: '6.13.4', ares: '1.15.0', brotli: '1.0.7', cldr: '35.1', http_parser: '2.8.0', icu: '64.2', llhttp: '2.0.1', modules: '72', napi: '5', nghttp2: '1.40.0', node: '12.14.1', openssl: '1.1.1d', tz: '2019c', unicode: '12.1', uv: '1.33.1', v8: '7.7.299.13-node.16', zlib: '1.2.11' }

ttn@loragateway:~/iot/fody-tempus-pro-logger $ ./bin/fody-tempus-pro-logger

internal/modules/cjs/loader.js:796 throw err; ^

Error: Cannot find module 'bluetooth-hci-socket' Require stack:

  • /home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/hci-socket/hci.js
  • /home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/hci-socket/bindings.js
  • /home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/resolve-bindings.js
  • /home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/index.js
  • /home/ttn/iot/fody-tempus-pro-logger/src/weather-station.js
  • /home/ttn/iot/fody-tempus-pro-logger/src/main.js
  • /home/ttn/iot/fody-tempus-pro-logger/bin/fody-tempus-pro-logger at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17) at Function.Module._load (internal/modules/cjs/loader.js:686:27) at Module.require (internal/modules/cjs/loader.js:848:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/hci-socket/hci.js:6:26) at Module._compile (internal/modules/cjs/loader.js:955:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Module.require (internal/modules/cjs/loader.js:848:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/hci-socket/hci.js', '/home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/hci-socket/bindings.js', '/home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/resolve-bindings.js', '/home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/index.js', '/home/ttn/iot/fody-tempus-pro-logger/src/weather-station.js', '/home/ttn/iot/fody-tempus-pro-logger/src/main.js', '/home/ttn/iot/fody-tempus-pro-logger/bin/fody-tempus-pro-logger' ] }

ttn@loragateway:~/iot/fody-tempus-pro-logger/test $ nodejs test-main.js

internal/modules/cjs/loader.js:796 throw err; ^

Error: Cannot find module 'bluetooth-hci-socket' Require stack:

  • /home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/hci-socket/hci.js
  • /home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/hci-socket/bindings.js
  • /home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/resolve-bindings.js
  • /home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/index.js
  • /home/ttn/iot/fody-tempus-pro-logger/src/weather-station.js
  • /home/ttn/iot/fody-tempus-pro-logger/src/main.js
  • /home/ttn/iot/fody-tempus-pro-logger/test/test-main.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17) at Function.Module._load (internal/modules/cjs/loader.js:686:27) at Module.require (internal/modules/cjs/loader.js:848:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/hci-socket/hci.js:6:26) at Module._compile (internal/modules/cjs/loader.js:955:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Module.require (internal/modules/cjs/loader.js:848:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/hci-socket/hci.js', '/home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/hci-socket/bindings.js', '/home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/lib/resolve-bindings.js', '/home/ttn/iot/fody-tempus-pro-logger/node_modules/noble/index.js', '/home/ttn/iot/fody-tempus-pro-logger/src/weather-station.js', '/home/ttn/iot/fody-tempus-pro-logger/src/main.js', '/home/ttn/iot/fody-tempus-pro-logger/test/test-main.js' ] }

ttn@loragateway:~/iot/fody-tempus-pro-logger/test $ node test-config.js

/home/ttn/iot/fody-tempus-pro-logger/test/test-config.js:4

describe('config', function() { ^

ReferenceError: describe is not defined at Object. (/home/ttn/iot/fody-tempus-pro-logger/test/test-config.js:4:1) at Module._compile (internal/modules/cjs/loader.js:955:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10) at internal/main/run_main_module.js:17:11

So far so good. It seams that there are a few problems with installing node_modules. i tried deleting node_modules directory and removed package-lock.json and reinstall. setting prefix=/opt/nodejs/ in ~/.npmrc. testet some chaotic installation direct, like npm install bluetooth-hci-socket, all without luck.

I would be very happy to receive an answer best regards

sjo00 commented 4 years ago

Some more.

First i update npm sudo npm install npm -g

ttn@loragateway:~/iot/fody-tempus-pro-logger $ npm -v

6.13.7

then cleared cache and installed

npm cache clean -f
npm i -g npm-upgrade

and upgraded all with

npm-upgrade

then checked packages

npm audit

and fixed with

npm audit fix

than noble throws some error at running, so

npm uninstall -g noble

npm install @abandonware/noble

and

npm i -g @abandonware/bluetooth-hci-socket rebuild

in node_modules i createt two symlinks

ln -s @abandonware/noble
ln -s @abandonware/bluetooth-hci-socket

than, it seems to run

ttn@loragateway:~/iot/fody-tempus-pro-logger $ ./bin/fody-tempus-pro-logger

Fody Tempus Pro logger started

but

ttn@loragateway:~/iot/fody-tempus-pro-logger $ nodejs ./test/test-main.js

/home/ttn/iot/fody-tempus-pro-logger/test/test-main.js:11 describe('run()', function() { ^

ReferenceError: describe is not defined at Object. (/home/ttn/iot/fody-tempus-pro-logger/test/test-main.js:11:1) at Module._compile (internal/modules/cjs/loader.js:955:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10) at internal/main/run_main_module.js:17:11

ttn@loragateway:~/iot/fody-tempus-pro-logger $ nodejs ./test/test-config.js

/home/ttn/iot/fody-tempus-pro-logger/test/test-config.js:4 describe('config', function() { ^

ReferenceError: describe is not defined at Object. (/home/ttn/iot/fody-tempus-pro-logger/test/test-config.js:4:1) at Module._compile (internal/modules/cjs/loader.js:955:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10) at internal/main/run_main_module.js:17:11

Is there a tutorial or docu to use it? How to pair bluetooth or station?