Node Red restart in debug mode option

I have a node Red function node that is behaving unexpectedly on the iHost so I’d like to look at the code and fix it. The Node.JS runtime allows inspection with Google Chrome Developer node or VA Code using an additional port. There is this node package I was going to try but it needs extra setup steps.
If Node Red is run as a docker an extra port needs to be opened: 9229 I think is the default one on order for the chrome debugger or VS code to communicate with the docker.
I’m assuming I can manually edit the settings file to add this new port/debug mode but it’d be massively easier to just have a Restart In Inspector Mode button.
This is an example palette I’d like to add:

According to that page you just need to run the command:

docker run -it -p 1880:1880 -p 9229:9229 -v node_red_data:/data --name mynodered nodered/node-red

And then their Inspector Node can turn on the Node.JS inspector.

Let us know if it works. I am intrigued to know how to run a docker CLI command on iHost.

I’ve tried many terminal docker images before and I’m not sure there is anyway to access the command line on an iHost but I’m thinking the port settings is probably in the settings file and I’ve accessed the setting file to password protect my NR and add file context storage so know where it is.

It’d be nice to be able to access the iHost CL but if they allowed that I’d bet it would create more headaches for their support team.

Exactly! I thought you had found it. :man_shrugging:
Well, as far as editing the settings file that’s easy but I’m very wary of touching it too much. Change context memory and palette display and that’s it. Is there a line for the startup?
At the worst if you could run > node-red --safe
then deploy flow by flow that could be a solution.

Clearly that’s true but if iHost becomes more mainstream and competes as a personal server it will be necessary. My opinion FWIW.

I normally save a backup of the settings file. Then if something goes wrong I can just move it back.

The other thing I’d like to figure out is how to get serial access to the USB port on the iHost and simulate Web Serial access (eg as exists in Chrome) for meshtastic. I’m currently getting several 16mile away zero hop nodes (there is a 33 mile one but I think they must have a really good aerial so I discount them). If you had serial access to the meshtastic it’d mean automations over tens of miles as it already has an MQTT server built in and the iHost can run the mosquito MQTT broker already, which would connects to NR on the iHost already for $35 (40-5 new customer discount).

And that’d be the expensive way. You can already run meshtasticd on a raspberry pi (running Linux) SPI hat for $20, the expensive way is just how I’d connect a current iHost. Even if anyone lived on a big farm I’d doubt you’d want home automations to run further away. Maybe if there was a mountain on your ranch but then you could just put a solar powered node on top of the mountain.

1 Like

A rather obvious way, I imagine you have used that, is to open another Node-red instance (PC?) and import the backup there in safe mode. Tedious though as all configuration nodes have to be modified, but it was the only way I could think of to debug when it wouldn’t even start on the iHost.

my only non-starts have been after installing old palettes and so I’ve just found them and deleted them. it whines a bit about not being able to find them but shuts up once you’ve removed all of the nodes.