3) npm install rpi-gpio 4) npm link rpi-gpio 5) npm install ant-plus 6) npm link ant-plus 7) Finally, I run sudo node test.js My errors are this: $ sudo node test.js startup Max channels: 8 /home/pi/ant-cycling-power/power-meter.js:15 stick.write((channel, 'transmit')) ^ TypeError: Cannot read property 'assignChannel' of undefined at GarminStick2. Installed node.js 8.1.1 with these lines: sudo su - apt-get remove nodered -y apt-get remove nodejs nodejs-legacy -y apt-get remove npm -y # if you installed npm curl -sL | sudo bash - apt-get install nodejs -y node -v v7.10.1 npm -v 4.2.0 Then I copied the code to my raspberry pi 3: 1) Cloned ant-cycling-power 2) Copied SpeedMeter.js into that folder. I'm using a CYCPLUS U1 usb ant+ stick on a Raspberry Pi 3, and latest Raspbian version and updates. I hope you can guide me to the source of the issue, please. I have problems with the code and libraries. I'm still working on it, but will provide my code / schematics once it's finished. Any idea/suggestions if that would work? Hope someone more advanced can provide some feedback. I was also thinking I might be able to simply add the option to control the level switches from the Omega, by connecting a GPIO output to a transistor base the connects the level+/- to ground. The GPIOs are "pulled up" now by the home trainer voltage, not sure if that's good practice. Note that my home trainer operates at 4-5V so I added voltage dividers. It works, but I hope someone can provide feedback as if this is safe and good practice. Attached how I connected it all (newbie electronics drawing, but I hope you get the idea). With a bit of experimenting I got the resistor values to a level that the home trainer keeps working (reading RPM, responding to level+/- switch) and my Omega2 is able to read the RPM correctly and detect level switch +/. I got a bit further, managed to tap into the reed switch circuit of my Christopeit EM3 so didn't need to add one myself. If you have power freezes, because you have NaN values in console logout update the test.js to the latest version If you have still problems with radio, make sure that the both stick see each other to stable the signal. $ cat /etc/udev/rules.d/les SUBSYSTEM="usb", ATTRS="1"Īnd reload udev rules: $ sudo udevadm control -reload-rules We can fix this by changing udev settings, for Garmin v1 and v2 sticks: $ node test.js /home/pi/ant-plus/node_modules/usb/usb.js:33 this._open() ^Įrror: LIBUSB_ERROR_ACCESS at Error (native) at (/home/pi/ant-plus/node_modules/usb/usb.js:33:7) When you plug in a USB-m ANT+ stick, the default permissions are for only root to get access to it: Shutdown your PI and remove the power supply. Many Thanks for helping me with the code goes to tsseh from If the values are not yours open the SpeedMeter.js and correct the table for your needs. My table have 16 Level and example for 24 Levels is also included. When you seeing an output with power and cadence go on: Test it with "sudo node test.js" You need to see an output! If not you have an issue. If you have issues follow the instructions on: If you fail put a sudo before the installer command.
0 Comments
Leave a Reply. |