ArchiveSW - Display & Data Archive Storage

Which Raspberry Pi are you using?

Raspberry Pi 3B+ Itā€™s the latest incarnation and requires a distribution dated March 2018 or later. The GUI installation does an automatic apt update && apt upgrade at first boot.

$ cat /etc/os-release
PRETTY_NAME=ā€œRaspbian GNU/Linux 9 (stretch)ā€
NAME=ā€œRaspbian GNU/Linuxā€
VERSION_ID=ā€œ9ā€
VERSION=ā€œ9 (stretch)ā€
ID=raspbian
ID_LIKE=debian
HOME_URL=ā€œhttp://www.raspbian.org/ā€
SUPPORT_URL=ā€œhttp://www.raspbian.org/RaspbianForumsā€
BUG_REPORT_URL=ā€œhttp://www.raspbian.org/RaspbianBugsā€

and

$ uname -a
Linux raspberrypi 4.14.70-v7+ #1144 SMP Tue Sep 18 17:34:46 BST 2018 armv7l GNU/Linux

1 Like

I donā€™t have a clue. Itā€™s failing on the nodejs Installation.

Iā€™ll run through it on the latest files and see what I can find.

Many thanks Gary - it saves me writing something in Python!

1 Like

Good thing I have this bad data to test with. Iā€™ve worked through a few more cases where things are out of range so Iā€™m getting closer.

Iā€™d say the biggest issue is that the current error messages donā€™t really provide any info to track down the actual problem. Better logging will make a big difference. Iā€™ve been adding logging of each SQL command just so that when it hits one of these, I know what it was trying to do.

So maybe having a verbose or debug flag that can enable really verbose logging.

Also, is it possible to output a better error message? For example, when I run the SQL on the table with the out of range values I get:

ERROR 1264 (22003): Out of range value for column ā€˜report_intervalā€™ at row 35941

That gives me enough info to track down the bad value, look at it and change it.

1 Like

That comes from the SQL server and is as good as it gets. It means that the value of row 35941 is larger than 117. What you can do is simply set all rows to 1, since that is the only viable value.

Face it Bob, you and I really screw up data like no others.

Iā€™m now getting a failure with this SQL:
var SQL = ā€œSELECT column_name FROM information_schema.columns WHERE table_schema=ā€™ā€ + db + "ā€™ AND table_name = wftest AND ordinal_position = " + newPosition;

I think itā€™s because table_name = wftest needs to have wftest in quotes.

With that fixed, alternodes then crashes because the results of that query are empty. Iā€™m not sure what this is trying to do so Iā€™m a bit stuck debugging any farther.

1 Like

Each time you run it starts over so the first entry in Z_diff is what it is working on. I wish I had your table schema.

I have a suggestion.

Wipe the SDCard and start fresh with a new OS install, then manually install Nodejs before you do anything else.

MariaDB [weatherflow]> SELECT column_name FROM information_schema.columns WHERE table_schema=ā€˜weatherflowā€™ and table_name=ā€˜wftestā€™;
Empty set (0.00 sec)

MariaDB [wftest]> select * from ZZ_diff;
Ā±-------------Ā±-----------Ā±------------Ā±-----------------Ā±---------------Ā±----------Ā±------------Ā±--------+
| table_schema | table_name | column_name | ordinal_position | column_default | data_type | column_type | changed |
Ā±-------------Ā±-----------Ā±------------Ā±-----------------Ā±---------------Ā±----------Ā±------------Ā±--------+
| wftest | Xpiio | marked | 6 | ā€˜Nā€™ | char | char(1) | |
Ā±-------------Ā±-----------Ā±------------Ā±-----------------Ā±---------------Ā±----------Ā±------------Ā±--------+
MariaDB [weatherflow]> show tables;
Ā±----------------------+
| Tables_in_weatherflow |
Ā±----------------------+
| AirBackfill |
| AirObservation |
| DailyAir |
| DailySensor |
| DailySky |
| DeviceEvents |
| DeviceStatus |
| DySensor |
| FWUpdate |
| HubEvents |
| HubStatus |
| PrecipEvent |
| RapidWind |
| SkyBackfill |
| SkyObservation |
| StrikeEvent |
| Xpiio |
| Xrain |
| Z_debug |
| Zdupe |
| Zudp |
Ā±----------------------+

Thereā€™s no table called wftest in either the weatherflow database or the wftest database and my knowledge of SQL is pretty basic, so Iā€™m confused by the ā€˜table_name = wftestā€™ in the select statement.

1 Like

Each time you run altertables it creates the database, creates the tables, then drops the database on exit.

OHHHHHHH. Crap. Thatā€™s WRONG. Hang on.

should be table_name = ā€˜" + table + "ā€™ maybe?

1 Like

ā€œSELECT column_name FROM information_schema.columns WHERE table_schema = wftest AND table_name = 'ā€ + table + "ā€™ AND ordinal_position = " + newPosition;

I meant to hard code the schema variable. Itā€™s part of being able to rename columns that I am working on.

So table_schema is hard coded as wftest?

Ok, I think it got to the end but does throw a ER_PARSE_ERROR after dropping database wftest.

1 Like

Yes, on line 267 it should be.

1 Like

Iā€™ll give that a try later today.

1 Like

Gary, Managed to load everything following your suggestions but I ended up doing a manual installation in the end.

Server starts up but when I try to enter the station details I but when I press ā€˜OKā€™, I get this:-

TypeError: Assignment to constant variable.
at /home/pi/wfarchive/server.js:216:9
at Layer.handle [as handle_request] (/home/pi/wfarchive/node_modules/express/lib/router/layer.js:95:5)
at next (/home/pi/wfarchive/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/pi/wfarchive/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/pi/wfarchive/node_modules/express/lib/router/layer.js:95:5)
at /home/pi/wfarchive/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/pi/wfarchive/node_modules/express/lib/router/index.js:335:12)
at next (/home/pi/wfarchive/node_modules/express/lib/router/index.js:275:10)
at /home/pi/wfarchive/node_modules/body-parser/lib/read.js:130:5
at invokeCallback (/home/pi/wfarchive/node_modules/raw-body/index.js:224:16)

I am just doing a cut and paste to transfer the station details from the info page

Phil

1 Like

The plot thickens!
In spite of the error above it seems to have worked. I started up the archive process and data appears in the database - so it seems to be running - at present. Shall leave it for an overnight catchup

Phil

1 Like

Ok Final couple of issues for tonight!

1: getting errors in log files that look as if some table field names are wrong.
e.g. in Archive.log
2018-10-07 17:59:36 Starting Archive v1.6.12.034
2018-10-07 17:59:37 Broadcasting UDP on: :50225
2018-10-07 17:59:37 MariaDB connected
2018-10-07 17:59:37 appRestart : :
2018-10-07 17:59:37 Listening to Hub on: 0.0.0.0:50222
2018-10-07 17:59:37 Listening to Panel on: 0.0.0.0:50226
2018-10-07 18:00:00 Archive is running
2018-10-07 18:00:01 Error(a2): ER_BAD_FIELD_ERROR: Unknown column ā€˜presHā€™ in ā€˜field listā€™
2018-10-07 18:00:23 Error(s2): ER_BAD_FIELD_ERROR: Unknown column ā€˜illuHā€™ in ā€˜field listā€™
2018-10-07 18:01:01 Error(a2): ER_BAD_FIELD_ERROR: Unknown column ā€˜presLā€™ in ā€˜field listā€™
2018-10-07 18:01:23 Error(s2): ER_BAD_FIELD_ERROR: Unknown column ā€˜illuLā€™ in ā€˜field listā€™
2018-10-07 18:02:23 Error(s2): ER_BAD_FIELD_ERROR: Unknown column ā€˜illuLā€™ in ā€˜field listā€™
2018-10-07 18:03:01 Error(a2): ER_BAD_FIELD_ERROR: Unknown column ā€˜presLā€™ in ā€˜field listā€™
2018-10-07 18:03:23 Error(s2): ER_BAD_FIELD_ERROR: Unknown column ā€˜illuLā€™ in ā€˜field listā€™
2018-10-07 18:04:01 Error(a2): ER_BAD_FIELD_ERROR: Unknown column ā€˜tempLā€™ in ā€˜field listā€™

etc

and
2/ Starting Panel process
get connection error in browser

192.168.1.163 refused to connect.
I am using the correct port to attempt connection also no Panel log created

Phil

1 Like