Ver 4.4 new functionality plugin

This section covers the Meteobridge PRO units exclusively

Moderator: Mattk

Post Reply
Tman
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: Sun Aug 11, 2019 5:43 pm

Ver 4.4 new functionality plugin

Post by Tman »

I wonder what commands are supported by MB Pro firmware/bash.

I'm trying to download (with curl) json data and read it (with jq). Script works well with Linux. Any tutorial or alike available?

Gyvate
Junior Boarder
Junior Boarder
Posts: 20
Joined: Thu May 14, 2020 4:36 pm

Re: Ver 4.4 new functionality plugin

Post by Gyvate »

It's not bash here, it's ash :), sort of a "diet bash" :lol:
For commands, look (e.g.) https://www.lifewire.com/ash-linux-command-4095519
WH4000SE 1.5.3 / GW1000 (DP1500) 1.6.3 / HP1000SE Pro
/ Meteobridge 4.4 (Sep 17 2020, build 13754), FW 1.4
Ecowitt 5763, 5764; WU ISAARB3; Weathercloud 3011399141

Tman
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: Sun Aug 11, 2019 5:43 pm

Re: Ver 4.4 new functionality plugin

Post by Tman »

Thnx, will study.

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6247
Joined: Mon Oct 01, 2007 10:51 pm

Re: Ver 4.4 new functionality plugin

Post by admin »

ash is rather close to bash. So when you are familiar with bash you should find a way.
curl and jp are not there. You can work with wget and awk for grabbing data from the stream.

Please don't have the idea to install additional packages. This will fill your flash storage and operation will stop.
Just a warning as some user thought they can install stuff as on their regular PC and had a hard stop after that ;-)

Tman
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: Sun Aug 11, 2019 5:43 pm

Re: Ver 4.4 new functionality plugin

Post by Tman »

Acknowledged

Tman
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: Sun Aug 11, 2019 5:43 pm

Re: Ver 4.4 new functionality plugin

Post by Tman »

Thanks for pointing to right direction. Got it up and running :D

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6247
Joined: Mon Oct 01, 2007 10:51 pm

Re: Ver 4.4 new functionality plugin

Post by admin »

Would you like to share your plugin code? Might be helpful for other users...

Tman
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: Sun Aug 11, 2019 5:43 pm

Re: Ver 4.4 new functionality plugin

Post by Tman »

short and simple after some trial and error

Code: Select all

#!/bin/sh
#
#read solar and uv data from url file at json format
#download file from url
i=0
while true;
do
wget -q http://veikkola-saa.com/pws2/solardata.txt -O /tmp/mnt/data/scripts/solardata.txt
solar=$(awk -F, '{print $2}' /tmp/mnt/data/scripts/solardata.txt | cut -d':' -f 2)
uv=$(awk -F, '{print $3}' /tmp/mnt/data/scripts/solardata.txt | cut -d':' -f 2)
#awk -F tells to split with comma (,) take second/third dataset and then cut tells to take second part of string after :
#
  echo "uv0 $uv"
  sleep 2
  echo "sol0 $solar"
  sleep 180
done

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6247
Joined: Mon Oct 01, 2007 10:51 pm

Re: Ver 4.4 new functionality plugin

Post by admin »

Thanks for sharing!

Post Reply