Hello everyone,
I'm working on a garden automation project and it was going rather well. I designed a modest weather station using pieces from my Arduino starter kit that uses Serial.print()
for sending data. On the Arduino I can see data on the serial monitor and the data is in CSV format for simplicity.
On my Pi 3B+ running Buster and an older Node-RED installation, I had several gauges and graphs running from the CSV data from serial. Worked nicely (if a little non-performant). The Pi crashed and I found that the microSD card was bad so I replaced it and installed the latest RPi OS Lite 64-bit from the RPi installer utility onto a new SD. Booted, did an apt update/upgrade, etc and then did an install of Node-RED using the script on the NR page for RPi.
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
Started up NR, connected to 1880 no problem. NR sees the Arduino on /dev/AMA0
but there is no data appearing in debug.
node-red-log shows:
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb712a4 node::Abort() [node-red]
2: 0xa93f08 [node-red]
3: 0xd3bb10 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node-red]
4: 0xd3bce0 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node-red]
5: 0xf1a26c [node-red]
6: 0xf1aed4 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node-red]
7: 0xf2b424 [node-red]
8: 0xf2bfe8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node-red]
9: 0xf2d1b4 v8::internal::Heap::FinalizeIncrementalMarkingIfComplete(v8::internal::GarbageCollectionReason) [node-red]
10: 0xf3078c v8::internal::IncrementalMarkingJob::Task::RunInternal() [node-red]
11: 0xe154b0 non-virtual thunk to v8::internal::CancelableTask::Run() [node-red]
12: 0xbd3ad4 [node-red]
13: 0xbd6f08 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [node-red]
14: 0x15e098c [node-red]
15: 0x15f2ac8 [node-red]
16: 0x15e13f4 uv_run [node-red]
17: 0xac1ad0 node::SpinEventLoop(node::Environment*) [node-red]
18: 0xbb0698 node::NodeMainInstance::Run() [node-red]
19: 0xb309e4 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResult const*) [node-red]
20: 0xb3414c node::Start(int, char**) [node-red]
21: 0x7f82615e18 __libc_start_main [/lib/aarch64-linux-gnu/libc.so.6]
22: 0xac0000 [node-red]
nodered.service: Main process exited, code=killed, status=6/ABRT
nodered.service: Failed with result 'signal'.
nodered.service: Consumed 6min 18.297s CPU time.
nodered.service: Scheduled restart job, restart counter is at 129.
Stopped Node-RED graphical event wiring tool.
nodered.service: Consumed 6min 18.297s CPU time.
Started Node-RED graphical event wiring tool.
14 Sep 12:04:52 - [info]
Welcome to Node-RED
===================
14 Sep 12:04:52 - [info] Node-RED version: v3.1.0
14 Sep 12:04:52 - [info] Node.js version: v18.17.1
14 Sep 12:04:52 - [info] Linux 6.1.21-v8+ arm64 LE
14 Sep 12:04:54 - [info] Loading palette nodes
14 Sep 12:04:58 - [info] Settings file : /home/sean/.node-red/settings.js
14 Sep 12:04:58 - [info] Context store : 'default' [module=memory]
14 Sep 12:04:58 - [info] User directory : /home/sean/.node-red
14 Sep 12:04:58 - [info] Projects directory: /home/sean/.node-red/projects
14 Sep 12:04:58 - [info] Server now running at http://127.0.0.1:1880/
14 Sep 12:04:59 - [info] Active project : Garduino
14 Sep 12:04:59 - [info] Flows file : /home/sean/.node-red/projects/Garduino/flows.json
14 Sep 12:04:59 - [info] Starting flows
14 Sep 12:04:59 - [info] Started flows
14 Sep 12:04:59 - [info] [serialconfig:8ff5956d95db737e] serial port /dev/ttyAMA0 opened at 9600 baud 8N1
14 Sep 12:08:22 - [info] Stopping flows
14 Sep 12:08:24 - [info] serial port /dev/ttyAMA0 closed
14 Sep 12:08:24 - [info] Stopped flows
14 Sep 12:08:24 - [info] Updated flows
14 Sep 12:08:24 - [info] Starting flows
14 Sep 12:08:24 - [info] Started flows
14 Sep 12:08:24 - [info] [serialconfig:8ff5956d95db737e] serial port /dev/ttyAMA0 opened at 9600 baud 8N1
Under Buster (before it got busted) things worked swell. But a fresh install on Bullseye is causing untold amounts of heartburn. I did notice that the systemd
process runs node-red
and not node-red-pi
. Behavior is the same, however, when I manually run node-red-pi --max-old-space-size=256
. A quick look at these NR scripts suggests that they are not RPi aware.
So that's the story and the problem. Could I trouble the forum for some thoughts?
-GG