So I’ve fixed it myself I guess, I put RPi.init(500000);
as the first thing in my hMain function. Now the initializing code in hMain looks like:
RPi.init(500000);
platform.begin(&RPi);
nh.getHardware()->initWithDevice(&platform.LocalSerial);
nh.initNode();