wutu / pimatic-ultrasonic

Support for the HC-SR04 ultrasonic sensor.
GNU Affero General Public License v3.0
0 stars 2 forks source link

Error in Pimatic-Ultrasonic #6

Open mwittig opened 7 years ago

mwittig commented 7 years ago

@wutu Hi, can you pls have a look at following issue?

https://github.com/pimatic/pimatic/issues/1074 posted by @Ruba5913

error [pimatic]: please call usonic.init() first
09:55:46error [pimatic-ultrasonic,Ultrasonic]: Error restoring changed device ultrasonic: please call usonic.init() first

Thanks, Marcus

glumb commented 6 years ago

I'm still getting the same error. @Ruba5913 have you been able to work around the problem?

20:13:12.039 2018-07-30 Monday
20:13:21.371 [pimatic] Starting pimatic version 0.9.43
20:13:21.392 [pimatic] Node.js version 4.6.2
20:13:21.396 [pimatic] OpenSSL version 1.0.2j
20:13:21.708 [pimatic] settings.debug is true, showing debug output for pimatic core.
20:13:25.029 [pimatic, ppm] 2.15.12
20:13:25.109 [pimatic] Loading plugin: "pimatic-cron" (0.8.8)
20:13:25.890 [pimatic] Loading plugin: "pimatic-mobile-frontend" (0.9.12)
20:13:27.167 [pimatic] Loading plugin: "pimatic-ultrasonic" (0.9.0)
20:13:27.289 [pimatic-cron] the time is: Mon Jul 30 2018 20:13:27 GMT+0000 (UTC)
20:13:27.784 [pimatic-ultrasonic] Error init HC-SR04 ultrasonic sensor
20:13:27.834 [pimatic] Error loading device "ultrasonic": please call `usonic.init()` first
20:13:27.845 [pimatic] Error: please call `usonic.init()` first
20:13:27.845 [pimatic]>    at Object.createSensor (/home/pi/pimatic-app/node_modules/pimatic-ultrasonic/node_modules/mmm-usonic/lib/usonic.js:57:15)
20:13:27.845 [pimatic]>    at new Ultrasonic (/home/pi/pimatic-app/node_modules/pimatic-ultrasonic/ultrasonic.coffee:50:24)
20:13:27.845 [pimatic]>    at Object.framework.deviceManager.registerDeviceClass.createCallback (/home/pi/pimatic-app/node_modules/pimatic-ultrasonic/ultrasonic.coffee:16:20)
20:13:27.845 [pimatic]>    at DeviceManager._loadDevice (/home/pi/pimatic-app/node_modules/pimatic/lib/devices.coffee:1475:26)
20:13:27.845 [pimatic]>    at /home/pi/pimatic-app/node_modules/pimatic/lib/devices.coffee:1504:16
20:13:27.845 [pimatic]>    at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/util.js:16:23)
20:13:27.845 [pimatic]>    at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:512:31)
20:13:27.845 [pimatic]>    at Promise._settlePromise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:569:18)
20:13:27.845 [pimatic]>    at Promise._fulfillPromises (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:668:14)
20:13:27.845 [pimatic]>    at Promise._settlePromises (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:694:18)
20:13:27.845 [pimatic]>    at Async._drainQueue (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:133:16)
20:13:27.845 [pimatic]>    at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:143:10)
20:13:27.845 [pimatic]>    at Immediate.Async.drainQueues [as _onImmediate] (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:17:14)
20:13:27.845 [pimatic]>    at processImmediate [as _immediateCallback] (timers.js:383:17)
Ruba5913 commented 6 years ago

No, I haven’t been able to work around this problem.

I am still waiting that somebody can solve this problem.

Van: Maximilian Beck notifications@github.com Verzonden: maandag 30 juli 2018 22:08 Aan: wutu/pimatic-ultrasonic pimatic-ultrasonic@noreply.github.com CC: Ruba5913 rbaarslag@telfort.nl; Mention mention@noreply.github.com Onderwerp: Re: [wutu/pimatic-ultrasonic] Error in Pimatic-Ultrasonic (#6)

I'm still getting the same error. @Ruba5913 https://github.com/Ruba5913 have you been able to work around the problem?

20:01:52.573 2018-07-30 Monday 20:02:02.043 [pimatic] Starting pimatic version 0.9.43 20:02:02.064 [pimatic] Node.js version 4.6.2 20:02:02.067 [pimatic] OpenSSL version 1.0.2j 20:02:05.672 [pimatic, ppm] 2.15.12 20:02:05.752 [pimatic] Loading plugin: "pimatic-cron" (0.8.8) 20:02:06.561 [pimatic] Loading plugin: "pimatic-mobile-frontend" (0.9.12) 20:02:07.827 [pimatic] Loading plugin: "pimatic-ultrasonic" (0.9.0) 20:02:07.947 [pimatic-cron] the time is: Mon Jul 30 2018 20:02:07 GMT+0000 (UTC) 20:02:08.449 [pimatic-ultrasonic] Error init HC-SR04 ultrasonic sensor 20:02:08.501 [pimatic] Error loading device "ultrasonic": please call usonic.init() first

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wutu/pimatic-ultrasonic/issues/6#issuecomment-408993187 , or mute the thread https://github.com/notifications/unsubscribe-auth/AMruxmISzbbe8xYDIVTRJKvNWeE1bvyHks5uL2elgaJpZM4OdH0- . https://github.com/notifications/beacon/AMruxhgSm_OdfuFNBl9iDjxXZNMj7cTuks5uL2elgaJpZM4OdH0-.gif

glumb commented 6 years ago

I managed to get it to work. If your cat /proc/cpuinfo | grep Hardware shows BCM2835 like on a RPi 2, change the line 31 in the file nano /home/pi/pimatic-app/node_modules/pimatic-ultrasonic/node_modules/mmm-usonic/lib/usonic.js to } else if (hardware === 'BCM2709' || hardware === 'BCM2835') {.