# ArchiveSW - Display & Data Archive Storage

**URL:** <https://community.tempest.earth/t/archivesw-display-data-archive-storage/790>\
**Category:** Third-Party Integrations\
**Tags:** udp, nodejs, wfarchive, archivesw\
**Created:** [April 11, 2018, 3:07am UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790 "2018-04-11T03:07:41Z")\
**Posts on this page:** 20\
**Page:** 81

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [April 20, 2020, 3:51am UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1603 "2020-04-20T03:51:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![todd.lorey](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@todd.lorey](https://community.tempest.earth/u/todd.lorey)\
**Post date:** [April 20, 2020, 5:20am UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1604 "2020-04-20T05:20:03Z")

</div>

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

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](https://github.com/sonicsnes/udp-broadcast-relay-redux/tree/master/usage-notes/pfsense-config)” 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](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](https://www.linode.com/docs/quick-answers/linux/start-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

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [April 20, 2020, 10:39am UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1605 "2020-04-20T10:39:57Z")

</div>

I need to make the installation more generic.

---

<div class="post-metadata">

**Author:** ![w.kallweit](https://avatars.discourse-cdn.com/v4/letter/w/c67d28/32.png) [@w.kallweit](https://community.tempest.earth/u/w.kallweit)\
**Post date:** [May 10, 2020, 2:10pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1606 "2020-05-10T14:10:41Z")

</div>

# 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?

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [May 10, 2020, 3:18pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1607 "2020-05-10T15:18:54Z")

</div>

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

What is your Station ID?

---

<div class="post-metadata">

**Author:** ![w.kallweit](https://avatars.discourse-cdn.com/v4/letter/w/c67d28/32.png) [@w.kallweit](https://community.tempest.earth/u/w.kallweit)\
**Post date:** [May 11, 2020, 8:02am UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1608 "2020-05-11T08:02:58Z")

</div>

My Station ID is 2242.

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [May 11, 2020, 9:59am UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1609 "2020-05-11T09:59:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![w.kallweit](https://avatars.discourse-cdn.com/v4/letter/w/c67d28/32.png) [@w.kallweit](https://community.tempest.earth/u/w.kallweit)\
**Post date:** [May 11, 2020, 12:12pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1610 "2020-05-11T12:12:39Z")

</div>

This is the data I used

```auto
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.

```

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [May 11, 2020, 5:55pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1611 "2020-05-11T17:55:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![w.kallweit](https://avatars.discourse-cdn.com/v4/letter/w/c67d28/32.png) [@w.kallweit](https://community.tempest.earth/u/w.kallweit)\
**Post date:** [May 12, 2020, 7:43am UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1612 "2020-05-12T07:43:16Z")

</div>

Sorry, my mistake. That works. Thanks.

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [May 12, 2020, 1:40pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1613 "2020-05-12T13:40:45Z")

</div>

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

The Sky Device ID is 10323.

---

<div class="post-metadata">

**Author:** ![w.kallweit](https://avatars.discourse-cdn.com/v4/letter/w/c67d28/32.png) [@w.kallweit](https://community.tempest.earth/u/w.kallweit)\
**Post date:** [May 12, 2020, 4:03pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1614 "2020-05-12T16:03:17Z")

</div>

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:

 ![kihjcajepnibbpbk.png](https://us1.discourse-cdn.com/flex020/uploads/sws/original/2X/2/25411973d51e4eb5d66fece9d5180903e1ee59c8.png)

 ![ekejdffilegobolh.png](https://us1.discourse-cdn.com/flex020/uploads/sws/original/2X/5/5262dd6b184a72e728c1f66d72d678db999c1f23.png)

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [May 12, 2020, 4:15pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1615 "2020-05-12T16:15:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![w.kallweit](https://avatars.discourse-cdn.com/v4/letter/w/c67d28/32.png) [@w.kallweit](https://community.tempest.earth/u/w.kallweit)\
**Post date:** [May 13, 2020, 12:18pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1616 "2020-05-13T12:18:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [May 16, 2020, 10:15pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1617 "2020-05-16T22:15:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gizmoev](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/gizmoev/32/941_2.png) [@gizmoev](https://community.tempest.earth/u/gizmoev)\
**Post date:** [May 16, 2020, 10:29pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1618 "2020-05-16T22:29:20Z")

</div>

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}

---

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [May 24, 2020, 6:53pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1619 "2020-05-24T18:53:39Z")

</div>

> [@Meteobridge device](https://community.tempest.earth/t/meteobridge-device/2581/32):
>
> ArchiveSW does exactly what I need and it interfaces with my home automation.

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).

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [May 24, 2020, 7:10pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1620 "2020-05-24T19:10:04Z")

</div>

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.

 ![15903471078287672257876292707486](https://us1.discourse-cdn.com/flex020/uploads/sws/original/2X/d/d62b7e238a8d3b3b99a775a9d933e6ee277bbd95.jpeg)

---

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [May 25, 2020, 5:20pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1621 "2020-05-25T17:20:16Z")

</div>

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!)

---

<div class="post-metadata">

**Author:** ![aavram76](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@aavram76](https://community.tempest.earth/u/aavram76)\
**Post date:** [May 26, 2020, 8:15pm UTC](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790/1622 "2020-05-26T20:15:18Z")

</div>

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?

[Previous page](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790.md?page=80)

[Next page](https://community.tempest.earth/t/archivesw-display-data-archive-storage/790.md?page=82)
