WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: SignalK on picore 13,1  (Read 3179 times)

Offline stelian

  • Newbie
  • *
  • Posts: 13
Re: SignalK on picore 13,1
« Reply #15 on: April 04, 2023, 10:58:22 AM »
Putting the .signalk (configuration files) on the persistent partition makes sense. Putting all the modules does not. Neither loading all into RAM.

What needs to be done is package individual signalk modules into individual .tcz files, each of them putting its files into /usr/local/lib/node_modules... something. Same as it is done with python site-packages modules for example.

But, as I said, dependency search is node.js is broken by the usage of symbolic links. This is the thing that needs to be addressed, by modifying node.js code. As I never touched node.js I don't know if this is obvious, or hard.

As a quick solution, I would have gone the same path as kagouraki: "I will make a tcz with node.js AND the all the modules required for signalk."

Offline kagouraki

  • Newbie
  • *
  • Posts: 20
Re: SignalK on picore 13,1
« Reply #16 on: April 04, 2023, 01:21:04 PM »
Progress made ! I have the node.js and signalK up and running as a single tcz. I dont have GUI right now because i dont need it. I have barebones piCore 13.1 plus wifi firmware, network manager, nano, htop, openssh and 88mb of ram usage on boot. When i

tce-load -i NodePlusSignalK.tcz

I get 200 mb ram usage and 230 mb free. Total ram on pizero2 is 430 mb.
Here is to be noted that signalK is on defaults. Nothing further installed.

Why is my tcz taking 120 mb of ram ?

As i have understand from the tinycorebook the tcz procedure is like mounting an .iso with daemon tools.
You see the files but you wont "load" then until sou execute them. Am i wrong ?

I am trying to have as small footprint as i can get...

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11157
Re: SignalK on picore 13,1
« Reply #17 on: April 04, 2023, 01:55:53 PM »
Hi kagouraki
Do you have any  copy2fs  files in your  tce  directory?

Offline kagouraki

  • Newbie
  • *
  • Posts: 20
Re: SignalK on picore 13,1
« Reply #18 on: April 04, 2023, 02:05:29 PM »
No, i am not.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10947
Re: SignalK on picore 13,1
« Reply #19 on: April 04, 2023, 11:19:16 PM »
It may be just cache. For accurate measurements do "sudo cache-clear; free -m". (the +-cache column counts both droppable caches and tmpfs files, so it's not the same).

That said, running huge & bloated stuff like node.js on limited hardware is not ideal.
The only barriers that can stop you are the ones you create yourself.

Offline kagouraki

  • Newbie
  • *
  • Posts: 20
Re: SignalK on picore 13,1
« Reply #20 on: April 04, 2023, 11:56:06 PM »
I will test and report back in the afternoon. I am at work now. Goodmornig to everyone !

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14501
Re: SignalK on picore 13,1
« Reply #21 on: April 05, 2023, 12:16:11 AM »
You could also use wpa_supplicant rather than networkmanager for wifi.

Offline kagouraki

  • Newbie
  • *
  • Posts: 20
Re: SignalK on picore 13,1
« Reply #22 on: April 05, 2023, 12:40:14 AM »
In my next project which is the continue of this one i want to build an MFD like the raymarine i70 or garmin gmi20. I want to use kip from signalk but i want from kip to manage the wifi through a custom settings page. Nmcli is very straight forword and i have already made the scripts for wifi requesting, managing etc. Is wpa_suplicant also doable and straightforward as nmcli ? I want static and dhcp configurations

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14501
Re: SignalK on picore 13,1
« Reply #23 on: April 05, 2023, 12:56:42 AM »
I suggested wpa_supplicant because it has fewer dependencies than networkmanager.

Offline kagouraki

  • Newbie
  • *
  • Posts: 20
Re: SignalK on picore 13,1
« Reply #24 on: April 05, 2023, 01:05:32 AM »
Yes, i understand why are you sugesting this and this is what i tried at first but then i could figure out how to setup everything(station or hotspot, dhcp or static etc) so i gave up and used networkmanager which is WAY more userfriendly

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1059
Re: SignalK on picore 13,1
« Reply #25 on: April 05, 2023, 07:29:38 AM »
zram is enabled by default, which turns some memory into a compressed swap space.   A standard swap partition is not enabled by default, but can help if you are pushing the memory limits.

which is WAY more userfriendly

This normally means resource heavy bloated software.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 653
Re: SignalK on picore 13,1
« Reply #26 on: April 06, 2023, 05:10:20 AM »
The tinycorebook is AWESOME by the way. Very good and clear writing!

Yes you are correct, and you may also go to the great wiki for more great stuff to read, as a newbie or nerd.
Here the link:
https://wiki.tinycorelinux.net/doku.php?id=welcome

Happy Hacking

Offline kagouraki

  • Newbie
  • *
  • Posts: 20
Re: SignalK on picore 13,1
« Reply #27 on: April 07, 2023, 07:22:19 AM »
Hello i am back !

1)
So i sorted the thing with the RAM. I have in my sdCard a 2GB linux swap partition and i will use this partition as swap. So i used the bootcode nozswap.
The pizero 2 is advertised to have 512mb ram but in htop only 428mb are available when i boot piCore. Is there a way to use the full 512mb ?

2)
Here you can find the tcz i made with node.js and signalK https://drive.google.com/file/d/1Y6fTLX_1fDAXSk1UBbeAzUPf2-zhNzzV/view?usp=sharing
If i boot without loading my tcz, i have a 60mb Ram usage (all my required tcz for wifi, networkmanager, nano, openssh, htop are loaded on boot)
Now if i tce-load -i NodePlusSignalK.tcz after everything loads i have 183mb or RAM usage.
Is this normal ? The loop mounted tcz takes actually space in my system? Aren't tcz's the way to go if you dont want the size intensive stuff on your RAM?


Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1059
Re: SignalK on picore 13,1
« Reply #28 on: April 07, 2023, 07:40:43 AM »
The kernel, rpi firmware, and the system ram disk (initrd) take space.  loop mounted tcz do use some space for symlinks from the ram disk to the loop mounted extension and the mount itself uses memory, even though the contents of the mount are sill in the tcz.

You are loading extremely bloated packages with extra dependencies.   type mount at the command prompt, and look at all of the extensions that are loop mounted.

Why do you need htop.  busybox provides top.   Why do you need nano, busybox provides "vi".   I assume you are doing that because it is "easy" for you, but that comes with a sacrifice of memory usage.