victronenergy / venus

Victron Energy Unix/Linux OS
https://github.com/victronenergy/venus/wiki
569 stars 70 forks source link

add node-red aka the main Venus OS Large tracking issue #378

Closed mpvader closed 2 years ago

mpvader commented 5 years ago

Todo

Repo for the node-red pallette is here: https://github.com/victronenergy/node-red-contrib-victron

Node-red discussion on Community is here: https://community.victronenergy.com/questions/549/feature-request-scheduled-virtual-switch-for-venus.html.

Download information + user manual for beta version of all this is here: https://www.victronenergy.com/live/venus-os:large

Initial -possible outdated- story:

What problem does this solve?

The value in this is that it enables capable installers that want to automatically control available outputs such as relays, or software set-points such as the ESS Grid set-point, or Max Charge Current.

How to handle support?

The risk is that it creates endless possibilities, and its impossible to support by Victron: our support staff does not contain software developers; nor PLC experts, and also we don't want to start employing them for the support team. This risk is mitigated by declaring that there is no official support for this; only community support on https://community.victronenergy.com.

Details

Only runs on Venus GX and newer devices

More information about available disk space is here.

Concept drawing

image

mpvader commented 4 years ago

Oops, that little adventure halted quickly :o). I can think of two ways to get out:

  1. Connect with a serial console cable, as explained here: https://github.com/victronenergy/venus/wiki/bbb-user-instructions#connecting-to-the-console-developer-feature. You do need to have such cable in order to do that. And then I'm expecting it will work well enough for you to simply be presented a prompt. Use that to make space on the rootfs, either by running resize2fs.sh or by deleting what you've installed. Also make sure that there is space on the data partition.

  2. By running the installer as documented here: https://github.com/SignalK/signalk-server-node/issues/517, chapter IV. And afterwards you'll then have to recreate the first three of the there listed files yourself. Simply put in a password in the wpa-psk one, put in the serial number in the serial number one, etc.

mpvader commented 4 years ago

Hi, no I cant share that. There is no password; its public/private keys.

Is the system on Internet& vrm? And is remote support enabled? Maybe that works. I’d then need the vrm url.

Otherwise you could perhaps make a port forward on your router and expose the venus gx ssh port on a public ip: I can then login (most likely still only if you’ve enabled remote support).

You didnt set a root password or installed a public key of yourself?

mpvader commented 4 years ago

Just to make sure: no email arrived yet.

Rafl53 commented 4 years ago

Sorry to ask again. I didn’t find jet a solution to get the power in W of the solar charger into node red. Maybe somebody has a solution and can help me.

mpvader commented 4 years ago

Hi @Rafl53 we'll look at that. In the mean time, you can simply multiply voltage & current. No?

Rafl53 commented 4 years ago

Yes that would be a possibility but how can I do it automatically node red?

mpvader commented 4 years ago

with a multiplication node. or something. that must be quite simple in node-red?

Rafl53 commented 4 years ago

OK I will have a look later at the moment I am driving I hope I can find a solution

thomas-pfeifer commented 4 years ago

@Rafl53 The function node in Node-Red is quite easy and powerful. Once you got the basics, you'll manage to calculate Watts or Watt-Hours or whatever else from the inputs provided by Victron's nodes. A good entry point might be: http://www.steves-internet-guide.com/node-red-functions/

aaronsb commented 4 years ago

I had to create a subflow to get watts.

[image: image.png]

On Tue, May 12, 2020 at 1:53 AM thomas-pfeifer notifications@github.com wrote:

@Rafl53 https://github.com/Rafl53 The function node in Node-Red is quite easy and powerful. Once you got the basics, you'll manage to calculate Watts or Watt-Hours or whatever else from the inputs provided by Victron's nodes. A good entry point might be: http://www.steves-internet-guide.com/node-red-functions/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/victronenergy/venus/issues/378#issuecomment-627206954, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU4SJY3UNU32VG4KDYR67DRREFBNANCNFSM4GGXANCQ .

MARKUS-001 commented 4 years ago

@Rafl53 I had this same problem a few weeks ago, after many hours of searching the internet for examples I managed to get a formula together, I have attach my flow as an example, Possibly there's a place where users could post flows that have been used so others new to node red can get to a library of user examples. Output 1 is Multiplus II battery watts Output 2 and 3 are two MPPT's, calculates watts for each one on separate output, output 4 adds the two MPPT watts together, output 5 is MultiPlus II battery watts (plus or minus) the two MPPT's together. MPPT_Watts_Battery_watts_Example_node_red.txt

mpvader commented 4 years ago

Venus OS v2.60~19-large-image-3 available for testing

Changes

Compared to the previous version, v2.60~16-large-image2:

Downloads:

https://www.dropbox.com/sh/nzqpuorguy65mku/AADDVg4lGoyWj6YRaTvR8R7oa?dl=0

houser42 commented 4 years ago

Hello,

So will have another go at resize2fs.sh and the latest beta. I see that the flash is 4GB and RAM 512mb on the Venus GX but found no clear recommendations on what the exact limits are for space for extra node code and what best practice and safe commands are for resize2fs.sh Would be grateful for some clarity before I give this another go. Also, will a resizing survive upgrades? Many thanks.

These are the sources I have used so far fwiw: https://www.victronenergy.com/live/ccgx:root_access https://github.com/victronenergy/venus/wiki/machines https://github.com/victronenergy/meta-victronenergy/commit/9110beead383c22523512da992e2572c176febef

mpvader commented 4 years ago

hi,

and:

houser42 commented 4 years ago

Ok, so you are basically saying don't do it then I guess ;)

I'll run my stuff on a RasPi on the side then. Will keep an eye on these developments regardless. The stuff I want to run has several up to date node.js dependencies so there's that.

fwiw, a new future gx unit (Cupid GX ? ;) that has maybe 2-4gb ram and 16-32gb flash and that allows you to run your own node stuff 'sandboxed' on the side without messing with the Venus OS would be of interest at least to me... I'll stay on the betas regardless also and see where it leads. Ah well, many thanks and keep up the good work!

mpvader commented 4 years ago

Hi, yes such Cupid GX would be nice, but I'm afraid the market will be so small that we can't justify the development & maintenance effort for it.

flomunz commented 4 years ago

Hi, can anybody give me some help with the resize procedure? I have a venus gx.

I completed this step and got a connection: https://www.victronenergy.com/live/ccgx:root_access

Then i got to this step: https://github.com/SignalK/signalk-server-node/issues/517#issue-315239812

mkdir my-temp cd mytemp mkdir conf mkdir venus scp 192.168.178.122:/data/venus/* ./venus/ scp 192.168.178.122:/data/conf/vrm_auth_token.txt ./conf/

In line 2 there is the "-" missed? As IP address i used the IP of my Venus GX, is this right? I used Putty with Win7. How works the downloading process of the files? The mkdir commands worked, but the scp commands leave me with question marks in my head.

My programming knowledge is not the best ;-(

Thanks Florian

kwindrem commented 4 years ago

I see a couple of problems with the scp lines

First, if you aren’t logged in as root on the local machine the scp will likely fail with a “permission denied” because it’s attempting to log into the venus computer with your local machines current user name.

Secondly, the * in the fist line will attempt to expand on the local machine. To cause the expansion to occur on the remote machine (the venus computer) you need to enclose the source path in “”

Third, of course the IP address specified on the scp line must be that of your venus computer.

so try these:

scp “root@192.168.178.122:/data/venus/*" ./venus/ scp root@192.168.178.122:/data/conf/vrm_auth_token.txt ./conf/

Kevin Windrem kwindrem@icloud.com

On May 15 2020, at 9:31 AM, flomunz notifications@github.com wrote:

Hi, can anybody give me some help with the resize procedure? I have a venus gx.

I completed this step and got a connection: https://www.victronenergy.com/live/ccgx:root_access https://www.victronenergy.com/live/ccgx:root_access Then i got to this step: SignalK/signalk-server-node#517 (comment) https://github.com/SignalK/signalk-server-node/issues/517#issue-315239812 mkdir my-temp cd mytemp mkdir conf mkdir venus scp 192.168.178.122:/data/venus/* ./venus/ scp 192.168.178.122:/data/conf/vrm_auth_token.txt ./conf/

In line 2 there is the "-" missed? As IP address i used the IP of my Venus GX, is this right? I used Putty with Win7. How works the downloading process of the files? The mkdir commands worked, but the scp commands leave me with question marks in my head.

My programming knowledge is not the best ;-(

Thanks Florian

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/victronenergy/venus/issues/378#issuecomment-629357137, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN6TTG2PTX4OZPRQREBGPLTRRVU47ANCNFSM4GGXANCQ.

mpvader commented 4 years ago

Hi @kwindrem, thanks! Good comments. They work for me, but I have a global config to assume root for certain ip ranges. I’ll update the instructions.

Hi @flomunz, if you’re using Putty on Windows, and not working with Linux, then that whole procedure can’t be applied. Not even the first line (even though it might seem to work to you). You could try with this software on windows: https://mobaxterm.mobatek.net/. I heard it works nice.

Basically, what you need to do is get those files off your Venus and onto your Windows computer. Then the sdcard procedure, and then finally you’ll need to use some tool (like mobaxterm) to copy the files back from your windows computer onto the Venus GX.

flomunz commented 4 years ago

Hi @kwindrem and @mpvader

thanks for your tips! I will try it the next days.

mpvader commented 4 years ago

Venus OS v2.60~22-large-image-4 available for testing

Changes

Compared to the previous version, v2.60~19-large-image3:

For raspberrypis, you'll need to reflash the image to an sdcard. Just installing the .swu file on your already installed image won't work, since the partitions are too small. Once having run that installer once, you can use the .swu variant on the next update again. Both the image as well as the .swu file are in below link.

Versions

Downloads

https://www.dropbox.com/sh/hf5a3j84t3saqhx/AAA8Aal6-NwBQSLTW9UTGArXa?dl=0

Manual

https://www.victronenergy.com/live/venus-os:extended

mpvader commented 4 years ago

fyi I added - [ ] Consider security implications - including to run node-red as root or not to above todo list

KidA001 commented 4 years ago

@mpvader I want to make sure I updated correctly here as I'm seeing some issues.

I re-flashed my rPi with v2.60~22-large-image-4

I now have VenusOS running on my rPi and can access the remote console on LAN (see below) image

I ran the HTML5 App on a separate machine and it would connect to my rPi to get data. I've enabled MQTT over LAN (Plaintext) on my rPi yet the app cannot connect to the MQTT Server (See error below).

image

Are there additional settings I need to enable on my rPi Venus device?

Edit For what it's worth I can connect to both Node-Red and SignalK on my rPi Venus device, but I cannot get the HTML5 App to work at venus.local/app, 192.168.1.200/app, or by pointing an instance of the HTML5 App running on my local machine to the rPi device @ 192.168.1.200 port 9001

All three options are asking me to enable MQTT over LAN (plaintext) which I already have

Update: Turns out my MQTT password changed when I re-flashed my rPi and that was the cause of the issue. I had to use the VRM Portal to reset the token and now it's working ¯\(ツ)

Also I had no Idea ya'll squeezed the HTML5 node app onto VenusOS at /app - That's rad. I was running the node app on a separate Pi and having it query the VenusOS Device. I'm continually blown away by the amount of open source development you're doing on victron. Keep up the amazing work. I'll keep testing and I'm glad to help with any of the new Node-Red/SignalK projects

Rafl53 commented 4 years ago

Venus OS v2.60~22-large-image-4 available for testing

Changes

Compared to the previous version, v2.60~19-large-image3:

  • updated the Venus OS version to v2.60~22. See v2.60~22 post on Community -> Modifications for details.
  • raspberrypi: increase the size of the rootfs-es in the image from 512MB to 1500MB
  • add raspberrypi image. For details on raspberrypi image & compatibility, see here. And keep reading below.

For raspberrypis, you'll need to reflash the image to an sdcard. Just installing the .swu file on your already installed image won't work, since the partitions are too small. Once having run that installer once, you can use the .swu variant on the next update again. Both the image as well as the .swu file are in below link.

Versions

  • Signal K v1.28
  • Node-RED v1.05
  • Nodejs 8.something (we’ll expect to be able to go to a newer nodejs version in a few months)

Downloads

https://www.dropbox.com/sh/hf5a3j84t3saqhx/AAA8Aal6-NwBQSLTW9UTGArXa?dl=0

Manual

https://www.victronenergy.com/live/venus-os:extended

hi,

i don't know what I am doing wrong. I try to update my BBB. I am loading down the swum file for BBB, than copy it to an USB stick, go to the menu update, choose update from USB, search for file, and I always get the message no update file found. where is the mistake??

thanks for your help in advance.

Rafl53 commented 4 years ago

now I named the swum file like the to the version before and it worked. strange.

MARKUS-001 commented 4 years ago

I had the same problem about 2 hours ago, I used v2.60~19 large image 3 instead, that one worked for me

mpvader commented 4 years ago

Hi @MARKUS-001: with regards to your last comment concerning dc-coupled pv feed in; that is not related to node-red; I'll hide it. Please make a note in the v2.60~22 thread on community - thank you.

mpvader commented 4 years ago

Hi @Rafl53 & @MARKUS-001 : sorry, my bad. I forgot to properly name those v2.60~22-large-image-4 images. I've done it just now. If you use the files now in the dropbox, they will work.

flomunz commented 4 years ago

@kwindrem and @mpvader I got Node-Red running! Thanks for your help!

houser42 commented 4 years ago

@mpvader wrote:

Versions

  • Nodejs 8.something (we’ll expect to be able to go to a newer nodejs version in a few months)

Just a short suggestion before I give this another go. If it is at all possible and of course also serves all your other purposes well, maybe discuss and consider going to the latest LTS release of node.js at some point? https://nodejs.org/en/blog/release/v12.13.0/

FWIW, that will apart from being generally current in terms of dependancies, also most likely enable the possibility to run at least a lean Homebridge instance in /data on the Venus GX which will in turn give the community the ability to see all Victron gear in Apple Homekit and do the kinds of basic "if/when/then" automations in Apple Homekit that I believe some users might find useful. (SOC @95% > switch outlet on. SOC@30%, switch multiplus off, etc..)

I have that up and running on a Raspi and it is of course childsplay compared to node-red but might be a pretty useful piece of functionality with very reasonable effort for some users. Many thanks for listening, as always.

mpvader commented 4 years ago

Hi, yes we’ll upgrade nodejs to a newer version (v10.x or hopefully v12.x) in the coming months.

houser42 commented 4 years ago

Cool, I'll give it another go then. Many thanks.

mpvader commented 4 years ago

Pls look into resize2fs.sh. Run that, and then look at free diskspace.

mpvader commented 4 years ago

All you need to do is run it: /opt/victronenergy/swupdate-scripts/resize2fs.sh

mpvader commented 4 years ago

And I've updated the documentation here a bit, perhaps that helps further: https://www.victronenergy.com/live/ccgx:root_access#available_disk_space

houser42 commented 4 years ago

Thanks. That worked, and I could now run my scripts ok, but as suspected, the stuff requires Node.js v10.13.0 or greater. Don't suppose it is any good trying to update that, as that will break other things? Many thanks.

mpvader commented 4 years ago

indeed, forget about that. We are working on a version with nodejs v10. And there is progress, but nothing to publicly share yet I'm afraid. I expect at least some more weeks.

houser42 commented 4 years ago

Alright. I will give it another go when that time comes then. Many thanks!

houser42 commented 4 years ago

Minor bug perhaps? Or just unpolished functionality? Or greatness I do not comprehend?

node red becomes password protected when remote console is password protected.

STR: enable password check for remote console node red also becomes locked, but with other user and password (which?) disabling password for remote console also makes node red password-free again FWIW

sbender9 commented 4 years ago

That's intentional. The username is "admin", the password is the remote console password.

houser42 commented 4 years ago

So greatness I now comprehend then ;) I tried the other obvious options but not that.. many thanks

ghost commented 4 years ago

Venus OS v2.60~22-large-image-4 available for testing

Maybe something wrong with the conversion of the field Altitude from GNSS position data? That's way above the international space station 😇

Maybe something you can look into, although not really important for a sailor.

Bildschirmfoto 2020-06-02 um 20 05 38
mpvader commented 4 years ago

Hi @MichelleWhy , what kind of gps is that & how is it connected?

ghost commented 4 years ago

Hi @mpvader

It's a Raymarine RS150 GPS Sensor. Connected to SeaTalkNG. There's a DeviceNet Cable from SeaTalkNG to NMEA2000 and from there it goes via Micro C/RJ45 into the Cerbo.

thomas-pfeifer commented 4 years ago

Hi @mpvader @sbender9

I have some troubles while trying to update a Venus GX (HQ1825Z4UG6) from FW version v2.32-node-red to v2.60~22-large-image-4: I put the swu on a SD card, it is shown in the Remote Console as new Firmware - but when I press to install, the dialog changes to "Installing..." for a short period of time, then switches back to "Press to install..." - and nothing changes (still v2.32-node-red). I tried it a couple of times (including a reboot), but cant find a reason.

I executed: /opt/victronenergy/swupdate-scripts/resize2fs.sh, which did some changes.

Now, df shows: /$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 1261501 313893 886573 26% / devtmpfs 247184 4 247180 0% /dev tmpfs 255888 212 255676 0% /run tmpfs 255888 464 255424 0% /var/volatile /dev/mmcblk1p5 499656 27892 435068 6% /data /dev/mmcblk1p6 633696 664 586800 0% /scratch /dev/mmcblk0p1 30907392 281184 30626208 1% /run/media/mmcblk0p1

Without understanding all that stuff, I assume that disk partitioning should not be the issue, here. Do you have any other ideas?

Thx in advance, Thomas

sbender9 commented 4 years ago

@mpvader I have the same issue with GPS. Also N2K source. Not running the large image, it’s v2.60~22.

thomas-pfeifer commented 4 years ago

Hi guys, thanks for listening. With respect to my comment above, I figured out that the SD card and/or swu-file was probably corrupted. I tried it again via USB, which worked fine. Need to check then, whether my „old“ flows in node-red survived the procedure - but I trust everything will be working. Thx, Thomas

thomas-pfeifer commented 4 years ago

Hi guys, now that I managed to get the OS v.260 with Node-Red running on my Venus GX, I was questioning, whether it would be possible to access the Node-Red UI via VRM portal - just like the remote console. This is probably off-topic, here, so a posted a question in the community. Would be a fantastic extension, to my opinion. Thx, Thomas

mpvader commented 4 years ago

Hi, to comment on few previous comments:

1) gps issue was fixed. In v2.60~something base images. We’ll have that fix in the extended images as soon as we have a new build. 2) remote access of node-red and signalk dashboards is something we’re looking at. 3) moving to a newer nodejs version is in progress too (v10 or v12).

And lastly, for anyone looking to install the latest extended aka large images, scroll up quite a few comments to find the last build as well as a link to the preliminary manual.

Have a good weekend, Matthijs

sbender9 commented 4 years ago

Venus OS v2.60~28-large-image-5 available for testing

Changes

Downloads

https://www.dropbox.com/sh/i8ru22o4ydws1rx/AADpa8lj5s2APZ2JS78OGPjKa?dl=0

Manual

https://www.victronenergy.com/live/venus-os:extended