wget https://fsoft.com/archivesw/altertables.js
Here is a new file that should correct that.
wget https://fsoft.com/archivesw/altertables.js
Here is a new file that should correct that.
That didnāt work. Still getting the same error.
Check the log and make sure it is 1.8.16.033
It is .033
2019-12-04 16:28:34 Starting UpdateFiles v1.6.16.030
2019-12-04 16:28:34 Getting files for update 1.8.16.033
2019-12-04 16:28:34 Checking for new Script files
2019-12-04 16:28:35 Checking for new JavaScript files
2019-12-04 16:28:36 Received new file ==>: /altertables.js
2019-12-04 16:28:44 Checking for new Config files
2019-12-04 16:28:48 Checking for new Panel files
2019-12-04 16:28:49 Checking for new Views files
2019-12-04 16:29:04 Checking for new Desktop files
Version 1.6.16.033 same error
Download the file again. I made a change but did not change the version number.
back to the original error
I donāt know if it makes a difference, but iām running archiveSw on a pi v4 FYI.
I hadnāt tried the latest file yet but I had been messing around with the HubStatus line in the altertables.js file.
I found that if I changed two things, it works. And even the Devices tab of the web interface now works too!
Status": "CREATE TABLE `HubStatus`.....`fs` varchar(30) ...`mqtt_stats` varchar(20) ...
Seems to work. I am completely hacking this without any real knowledge of whatās going on with the database stuff. Just seemed like the āfsā needed to be longer and the āmqtt_statsā started throwing the error after I changed the āfsā varchar value. I figured varchar(20) was long enough for the mqtt_stats.
Iām assuming youāll figure out something more elegant than my hacks but hopefully, this points you in the right direction.
Thatās exactly what to do. There is something weird going on. My mqtt_stats are an integer value where yours are an array. I have no idea how they can be different.
You should also change radio_stats to 30
That is weird that yours is different than mine. My hub is on v114 firmware.
From the WF UDP API on the latest version changelog:
Change Log Since 105
And mine does indeed have an array for fs, radio_stats and mqtt_stats:
"fs":[1,0,15675411,524288],"radio_stats":[2,2,26,3],"mqtt_stats":[483,102]
Crap. now that I changed mine I am seeing that data. I just wasnāt getting any errors. Now thatās the weird part. I need to look at the code I am running.
I put up a new file. Please get it and run it. and let me know what it does.
Now I get this error:
pi@archivesw:~/archivesw $ node altertables.js
/home/pi/archivesw/altertables.js:48
CHANGE mqtt_stats
mqtt_stats
VARCHAR(30) NULL;
^^^^^^^^^^^^
SyntaxError: Unexpected template string
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
I just fixed that. Get it again, please.
That one works. No errors. Devices tab displaying correctly.
ALL GOOD!!
Thank you for your assistance.
No problem. Glad we worked it out. I hate seeing errors in log files.
Working Great for me too. Thanks Guys!
Hi Gary, after updating files, I run altertable. Result is with error, is there a script for recreation of SkyObservation table?
AlterTables.log [Delete](http://192.168.88.202:8080/logs/delete/AlterTables.log)
2019-12-12 18:13:09 Starting AlterTables v1.8.16.033 2019-12-12 18:13:11 Dropping table index: DailySky 2019-12-12 18:13:11 Dropping table index: PrecipEvent 2019-12-12 18:13:11 Dropping table index: SkyObservation 2019-12-12 18:13:11 Error dropTableIndex: SkyObservation HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Dropping table index: StrikeEvent 2019-12-12 18:13:11 Checking table index: AirBackfill
2019-12-12 18:13:11 Checking table index: AirObservation
2019-12-12 18:13:11 Checking table index: DailyAir
2019-12-12 18:13:11 Checking table index: DailySensor
2019-12-12 18:13:11 Checking table index: DailySky
2019-12-12 18:13:11 Checking table index: DeviceEvents
2019-12-12 18:13:11 Checking table index: DeviceStatus 2
019-12-12 18:13:11 Checking table index: FWUpdate
2019-12-12 18:13:11 Checking table index: HubEvents
2019-12-12 18:13:11 Checking table index: HubStatus
2019-12-12 18:13:11 Checking table index: PrecipEvent
2019-12-12 18:13:11 Checking table index: RapidWind
2019-12-12 18:13:11 Checking table index: SkyBackfill
2019-12-12 18:13:11 Checking table index: SkyObservation
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation serial_number_timestamp_hub_sn HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation serial_number_timestamp HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation serial_number HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation hub_sn HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation timestamp HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation datestamp HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation illuminance HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation uv HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation rain_accumulated HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation wind_lull HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation wind_avg HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation wind_gust HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation wind_direction HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation solar_radiation HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation daily_rain_accumulation HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation precip_type HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Error alterTableIndex (create index): SkyObservation battery HA_ERR_CRASHED_ON_REPAIR
2019-12-12 18:13:11 Checking table index: StrikeEvent
2019-12-12 18:13:11 Checking table index: Xrain
2019-12-12 18:13:11 Checking table index: Yds18b20
2019-12-12 18:13:11 Checking table index: Yuthing 2019-12-12 18:13:11 Checking table index: Z_version 2019-12-12 18:13:11 Process changes complete
2019-12-12 18:13:11 Update Version complete
See this postā¦