mysensors / NodeManager

Plugin for a rapid development of battery-powered sensors
130 stars 82 forks source link

Issues compiling for NRF5x #503

Closed user2684 closed 4 years ago

user2684 commented 4 years ago

Ref. https://forum.mysensors.org/topic/10315/nrf5x-on-nodemanager

spREGR commented 4 years ago

Hi, I changed the radio define line for the NRF5x. And normally, we are required to have two tabs containing MyBoardNRF5.cpp and MyBoardNRF5.h along with the .ino file when compiling for this board. Getting the following errors

error.txt

Template.zip

user2684 commented 4 years ago

Thanks, I was finally able to reproduce the problem. Looks like the issue is related to the newest version of the MySensors library. Give a try with 2.3.1 instead of 2.3.2, to me compiled just fine. If confirmed of course I urgently need to support 2.3.2 as well since looks like something has changed under the hood making it not fully compatible with NodeManager. Thanks!

spREGR commented 4 years ago

Hi, Yes, it compiles with 2.3.1...but there is no output on the serial monitor and nothing on the MQTT traffic as well. nodemanagertest_lib2.3.1.zip

user2684 commented 4 years ago

Ok, at least this is a step ahead, unfortunately fixing compilation issues is way easier than reproducing runtime issues :-) Let me try setting up a test board and see if I can get somewhere. Do you have any working code to share (just mysensors, without NodeManager) for this board so I can try to find the differences. Thx

user2684 commented 4 years ago

Nevermind, I was eventually able to reproduce it but unfortunately not fixing it. As you may have noticed, the problem is not in the serial output but looks like a runtime error is making the sketch crashing hence no output is returned. I spent long time trying to isolate the problem and the first candidate is NodeManager's debug() which is mapping directly MySensors HwDebugPrint(). The latter is used by MySensors core without issues but when I call it (actually whenever I use a Serial.print), there is apparently a crash. I couldn't find an explanation yet and debugging it could be time consuming. If I could only get some sort of stack trace from the board upon crash....

spREGR commented 4 years ago

If there is something that you need me to try or do ; let me know

user2684 commented 4 years ago

Just if you have a better way for testing rather than flashing with st-linkv2, disconnecting, connecting to a serial TTL and run it since it is very time consuming going through this process to verify a single line commented out is making it crashing or not. Is there a way to flash and connect to serial like a standard arduino board without using two different USB devices? Thanks

Unfortunately it is very manual and try-and-error the process with this since I have no clue what is making it crashing at runtime and need to debug line per line :-/

user2684 commented 4 years ago

This should be fixed by #512 :-) (issue related to #463)