ArchiveSW - Display & Data Archive Storage

Right. You need to call start.js which is in the archivesw folder.

Got it to work. Pretty much a kludge of stuff I found Googling but it runs at startup, which is what I wanted. :slight_smile:

NOTE: this only allows the archive/panel/upload features, which is what I currently am using. If you need the features for driving a small display, I don’t think this will work for you. You may as well be doing it on a RPi with the small screen, which makes this guide obsolete.

I should write up the steps more formally so someone else can try it. Don’t have time to do that right now but I’ll put it on my list.

EDIT: Ok, so I got carried away and wrote up most of the steps. I’m treating this as more of a guide to myself when I need to do it again. I can’t promise much support for what goes wrong if you try it! YMMV…

EDIT2: If there are any Ubuntu/Linux experts out there that see glaring flaws with this method or have any suggestions on edits, I’m all ears! I’m not a Linux guru by any stretch of the imagination. Still cutting my teeth. I added some details on the setup and made a few edits to the text.

The basics are as follows:

Load up a fresh version of Ubuntu 18.04. It obviously needs WAN access and also needs to be able to receive the UDP 50222 broadcast (destination 255.255.255.255) packets from the WF hub. Note that these packets are broadcast (not multicast) so packages like Avahi and mDNS don’t work. This was quite a challenge for me as I have the WF hub on an IoT subnet, segregated from the rest of my other networks using VLANs. Running pfSense as my router/firewall, I needed to add the “udp-broadcast-relay-redux” package to get this to work properly. There are a few dents in my forehead that resulted from all of resulting consternation during this setup. The key lesson was to “kill states” in the pfSense firewall, which allowed the broadcast packets to pass. Lest I digress…

This assumes you are logged in as root! It may not be necessary but that’s the way I did it.

  • Create user pi and give it sudo rights (the rights part might not be needed):

adduser pi
usermod -aG sudo pi

  • Create this directory: /home/pi/Desktop (I’m not currently using it and probably don’t need it)
  • Do all of the updates stuff shown at the start of the instructions for archiveSW:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

  • Need to install npm: (do this after the updates but before the npm and n stuff in the first few steps)

sudo apt-get install npm

  • Finish the initial prep steps:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

  • Run the install script:

bash -e <(wget -qO - http://fsoft.com/archivesw/script/install.sh)

  • The script will stop with a message about crontab. First select 1 (use nano as editor) then do what the script says (Ctrl+O, Enter, Crtl+X) and restart the script. Then run through the script prompts. Keep pi as the username. Don’t install the GPIO or one-wire stuff towards the end of the script. My Ubuntu container doesn’t have that stuff and this isn’t a Raspberry Pi!!

  • create a file /usr/bin/archivestart.sh
    (Note that there are some little single accent (looks like French “accent grave”) marks that show up in my file text but don’t show up here. Not sure how necessary they are. I based some of this on samples from this link. It’s worth a look: Use systemd to Start a Linux Service at Boot

DATE1=date '+%Y-%m-%d %H:%M:%S'
echo “ArchiveSW service started at ${DATE1}” | systemd-cat -p info
sleep 10 && cd /home/pi/archivesw && pm2 start;

while :
do
DATE2=date '+%Y-%m-%d %H:%M:%S'
echo “Running… at ${DATE2}”;
sleep 60;
done

  • …and make it executable:

sudo chmod +x archivestart.sh

  • Create a file /etc/systemd/system/archivestart.service

[Unit]
Description=Example systemd service.
After=syslog.target

[Service]
Type=simple
ExecStart=/bin/bash /usr/bin/archivestart.sh
ExecStop=/bin/kill -s QUIT $MAINPID

[Install]
WantedBy=multi-user.target

  • …and make it executable

sudo chmod +x archivestart.service

  • OPTIONAL: test out your new service without actually enabling it. These commands functions should be pretty self-explanatory by noting the differences in “status/start/stop/restart”

sudo systemctl start archivestart.service
sudo systemctl stop archivestart.service
sudo systemctl restart archivestart.service
sudo systemctl status archivestart.service

  • enable the service:

sudo systemctl enable archivestart.service

  • reboot and see if it works
2 Likes

I need to make the installation more generic.

1 Like

Backfill works for SKY but not for AIR
I installed archivesw on a PI4 with debian buster and the storage and the Panel are working. When I want to save historical-data with
node backfill.js -device nnnn -date m
this works for the SKY-device

2020-05-07 20:18:12 Starting Backfill v1.7.15.013
2020-05-07 20:18:12 Requesting data
2020-05-07 20:18:13 obs_sky
2020-05-07 20:18:13 Records: 1438

but for the AIR I get
node backfill.js -device 7648 -date 1

2020-05-07 20:18:51 Starting Backfill v1.7.15.013
2020-05-07 20:18:51 Requesting data
2020-05-07 20:18:52 undefined skipping

I have made 2 clean installs but it´s always the same. Works with SKY not with AIR.
Can someone help?

I’ll have a look at why it’s not working for you.

What is your Station ID?

My Station ID is 2242.

1 Like

Do you have more than 1 Air device? The Air I see at your station is 4190.

You don’t have an Air device of 7648.

This is the data I used

Station id: 2242
      Name: Wasserturm
  Latitude: xx
 Longitude: yy
 Elevation: 71.4639892578
  Timezone: Europe/Berlin
    Device: HB-00003392
       AGL: 0
    Device: AR-00007648
       AGL: 1.52400001884
    Device: SK-00015882
       AGL: 4
I have 1 Air and 1 Sky now.
In April I had 2 Sky for 3 weeks, because the first didn't work properly and I got a new one (ID 15882). Then I took the old device offline and the weatherflow staff merged the old Sky-data to the new Sky-device.
But is was Sky not Air.

1 Like

7648 is the serial number. The device number is 4190.

Sorry, my mistake. That works. Thanks.

1 Like

So the question now, Are you sure you used the correct device number for your Sky?

The Sky Device ID is 10323.

Both backfill commands are working now with the device-IDs.
But I’m getting a bit confused. First I took the serial numbers of both
devices and got no results from the Air device, what is correct, but
from the Sky I got results.
Then I took the ID of Air device -> works.
But I get results with the serial-number of the Sky device too!
node backfill.js -device 4190 -date 1 Air ID works
node backfill.js -device 10323 -date 1 Sky ID works
node backfill.js -device 15882 -date 1 Sky serial_number works too
These are the results in the tables:

1 Like

When you use the Sky serial number you are getting data that belongs to a different station. That is not your data.

1 Like

So I will begin my sql-experience with deleting wrong data. Thanks again.

1 Like

For those that are receiving the Tempest, I will have an update soon.

4 Likes

Good to hear because my Archive.log file grows quite large with these lines repeating.

2020-05-16 14:48:44 obs_st skipping
{“serial_number”:“ST-00000076”,“type”:“obs_st”,“hub_sn”:“HB-00010251”,“obs”:[[1589665722,0.00,0.56,1.12,144,3,990.54,15.17,84.77,80304,5.13,669,0.000000,0,0,0,2.542,1]],“firmware_revision”:129}
2020-05-16 14:49:05 obs_st skipping
{“serial_number”:“ST-00001173”,“type”:“obs_st”,“hub_sn”:“HB-00010251”,“obs”:[[1589665743,0.00,0.61,1.25,125,3,990.86,16.18,83.15,77231,4.42,644,0.000000,0,0,0,2.630,1]],“firmware_revision”:129}

1 Like

Gary - I must miss it, but I keep looking for screenshots. Does your software just sniff+save data, or is there some dashboard etc. that it cooks up? The website and discussions seem to be centered around how to install it. Once that’s done, then what ?

(if you want to move this to the thread for your software, that’s of course your call).

1 Like

It consists of several modules. The first is data collection and storage. The others are alerts, display, access point, configuration and custom modules.

This is a photo of a complete system. It is battery powered and fully self-contained.

3 Likes

Thanks for the screenshot. Got my 10" pi display last night and installed your software this morning without tremendous pain, but the instructions might warrant a bit of tweaking…

  • what is ‘config’ and what is it used for ? It doesn’t seem to autofill the panel tab’s values.
  • do we put in HB-000001234 or 1234 for the device identifiers ?
  • it wasn’t clear that I had to enable the panel ‘and’ reenter all the values in it in order to get the display part to work. When I put in the long-form ids the data appeared (cool!)

One question - my time+date bottom middle are blinking. I looked at the logs and see the sky/air seem to have gone offline/online but they’re back and the data is being displayed. What starts/clears the blinking ?

Ok - two questions - I have a different form factor screen, so in fullscreen I have room for at least one more row of stuff. If I go fiddling around to add more things, is there a way to have those changes not overwritten by a future upgrade ?

(cool display - awaiting Tempest support to switch to that - thanks!)

1 Like

Hi, in folder BAK I have around 1GB of .json files. Are they used anymore, can I delete all of them in order to save space?

1 Like