Any ideas on why rpio may not be working in this case?
BTW have checked and the user is a member of the gpio group and I have made the recommended change to /boot/config.txt
Node version 12.18.0
Pi 3
node-gyp rebuild during npm i does show a number of warnings:
make: Entering directory '/home/pi/projects/blinkt-kit/node_modules/rpio/build'
CXX(target) Release/obj.target/rpio/src/rpio.o
In file included from ../src/rpio.cc:17:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
, reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
^
In file included from ../../nan/nan.h:56,
from ../src/rpio.cc:17:
../src/rpio.cc: At global scope:
/home/pi/.cache/node-gyp/12.18.0/include/node/node.h:608:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
(node::addon_register_func) (regfunc), \
^
/home/pi/.cache/node-gyp/12.18.0/include/node/node.h:642:3: note: in expansion of macro ‘NODE_MODULE_X’
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/rpio.cc:495:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(rpio, setup)
^~~~~~~~~~~
CC(target) Release/obj.target/rpio/src/bcm2835.o
../src/bcm2835.c: In function ‘bcm2835_gpio_pad’:
../src/bcm2835.c:487:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (bcm2835_pads == MAP_FAILED)
^~
../src/bcm2835.c:490:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
volatile uint32_t* paddr = bcm2835_pads + BCM2835_PADS_GPIO_0_27/4 + group;
^~~~~~~~
../src/bcm2835.c: In function ‘bcm2835_gpio_set_pad’:
../src/bcm2835.c:500:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (bcm2835_pads == MAP_FAILED)
^~
../src/bcm2835.c:503:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
volatile uint32_t* paddr = bcm2835_pads + BCM2835_PADS_GPIO_0_27/4 + group;
^~~~~~~~
SOLINK_MODULE(target) Release/obj.target/rpio.node
COPY Release/rpio.node
make: Leaving directory '/home/pi/projects/blinkt-kit/node_modules/rpio/build'
I have found all of the existing blinkt libraries rely upon wiring-pi which appears broken in Node >=12.
Trying to fork and get one of the existing libraries blinkt-kit working using node-rpio instead.
Looks like a straightforward changeover however I can't seem to get any response from the blinkt LEDs.
The protocol appears to be that they put a bit on GPIO 23 and then move GPIO 24 high and then low to trigger a clock cycle.
I am wondering if with the increase in RPIO speed if my issue is perhaps that I need to leave the clock high longer?
In any case here is the short modified source:
Any ideas on why rpio may not be working in this case?
BTW have checked and the user is a member of the gpio group and I have made the recommended change to /boot/config.txt
Node version 12.18.0 Pi 3
node-gyp rebuild during npm i does show a number of warnings:
A simple program like this:
Completes but with a Segmentation Fault