diff --git a/html-templates/Overview.html b/html-templates/Overview.html
index e16b836..127ab74 100644
--- a/html-templates/Overview.html
+++ b/html-templates/Overview.html
@@ -159,28 +159,28 @@
-
- <%= channels["prostarsolar.t_amb"].timestamp %>
+
+ <%= channels["prostarsolar.t_amb_f"].timestamp %>
diff --git a/python-driver/config.txt b/python-driver/config.txt
index 3080177..0940714 100644
--- a/python-driver/config.txt
+++ b/python-driver/config.txt
@@ -3,11 +3,10 @@
"file3": "persistence.py",
"file2": "utilities.py",
"file1": "prostarsolar.py",
- "file5": "Maps.py",
- "file4": "Channel.py"
+ "file4": "modbusMap.p"
},
"deviceName": "prostarsolar",
"driverId": "0170",
- "releaseVersion": "1",
+ "releaseVersion": "2",
"driverFileName": "prostarsolar.py"
}
\ No newline at end of file
diff --git a/python-driver/driverConfig.json b/python-driver/driverConfig.json
index 5562fee..cae7c7f 100644
--- a/python-driver/driverConfig.json
+++ b/python-driver/driverConfig.json
@@ -1,12 +1,12 @@
{
- "name": "prostarsolar",
- "driverFilename": "prostarsolar.py",
- "driverId": "0000",
+ "name": "prostarsolar",
+ "driverFilename": "prostarsolar.py",
+ "driverId": "0000",
"additionalDriverFiles": [
"utilities.py",
- "persistence.py",
- "Channel.py"
- ],
- "version": 1,
+ "persistence.py",
+ "modbusMap.p"
+ ],
+ "version": 2,
"s3BucketName": "prostarsolar"
-}
+}
\ No newline at end of file
diff --git a/python-driver/modbusMap.p b/python-driver/modbusMap.p
new file mode 100644
index 0000000..a4b605a
--- /dev/null
+++ b/python-driver/modbusMap.p
@@ -0,0 +1,1414 @@
+(dp0
+S'1'
+p1
+(dp2
+S'c'
+p3
+VM1-485
+p4
+sS'b'
+p5
+V9600
+p6
+sS'addresses'
+p7
+(dp8
+V1
+p9
+(dp10
+V2-2
+p11
+(dp12
+Vah
+p13
+V
+p14
+sVbytary
+p15
+NsVal
+p16
+g14
+sVvn
+p17
+VRaw Battery Terminal Voltage
+p18
+sVct
+p19
+Vnumber
+p20
+sVle
+p21
+V16
+p22
+sVgrp
+p23
+V600
+p24
+sVla
+p25
+I19225
+sVchn
+p26
+Vadc_vbterm_raw
+p27
+sVun
+p28
+g9
+sVdn
+p29
+Vprostarsolar
+p30
+sVvm
+p31
+NsVlrt
+p32
+F1515515387.9155248
+sVda
+p33
+g9
+sVa
+p34
+V18
+p35
+sVc
+p36
+V0
+p37
+sVmisc_u
+p38
+g14
+sVf
+p39
+V3
+p40
+sVmrt
+p41
+V60
+p42
+sVm
+p43
+Vnone
+p44
+sVm1ch
+p45
+g11
+sVmv
+p46
+g37
+sVs
+p47
+VOn
+p48
+sVr
+p49
+V0-65535
+p50
+sVt
+p51
+Vint
+p52
+ssV2-3
+p53
+(dp54
+Val
+p55
+g14
+sVah
+p56
+g14
+sVbytary
+p57
+NsVvm
+p58
+NsVvn
+p59
+VRaw Array Voltage
+p60
+sVct
+p61
+Vnumber
+p62
+sVle
+p63
+V16
+p64
+sVgrp
+p65
+V600
+p66
+sVla
+p67
+I19467
+sVchn
+p68
+Vadc_va_raw
+p69
+sVun
+p70
+g9
+sVdn
+p71
+Vprostarsolar
+p72
+sVda
+p73
+g9
+sVlrt
+p74
+F1515515388.4029889
+sg49
+V0-65535
+p75
+sg34
+V19
+p76
+sg36
+g37
+sVmisc_u
+p77
+g14
+sg39
+g40
+sVmrt
+p78
+V60
+p79
+sg43
+Vnone
+p80
+sS'm1ch'
+p81
+g53
+sg47
+VOn
+p82
+sVmv
+p83
+g37
+sg51
+Vint
+p84
+ssV2-1
+p85
+(dp86
+Val
+p87
+g14
+sVah
+p88
+g14
+sVbytary
+p89
+NsVvm
+p90
+NsVvn
+p91
+VRaw Array Current
+p92
+sVct
+p93
+Vnumber
+p94
+sVle
+p95
+V16
+p96
+sVgrp
+p97
+V600
+p98
+sVla
+p99
+I14789
+sVchn
+p100
+Vadc_ia_raw
+p101
+sVun
+p102
+g9
+sVdn
+p103
+Vprostarsolar
+p104
+sVda
+p105
+g9
+sVlrt
+p106
+F1515515378.8921958
+sg49
+V0-65535
+p107
+sg34
+V17
+p108
+sg36
+g9
+sVmisc_u
+p109
+g14
+sg39
+g40
+sVmrt
+p110
+V60
+p111
+sg43
+Vnone
+p112
+sg81
+g85
+sg47
+VOn
+p113
+sVmv
+p114
+g37
+sg51
+Vint
+p115
+ssV2-6
+p116
+(dp117
+Val
+p118
+g14
+sVah
+p119
+g14
+sVbytary
+p120
+NsVvm
+p121
+NsVvn
+p122
+VRaw Ambient Temp
+p123
+sVct
+p124
+Vnumber
+p125
+sVle
+p126
+V16
+p127
+sVgrp
+p128
+V600
+p129
+sVla
+p130
+I19515
+sVchn
+p131
+Vt_amb_raw
+p132
+sVun
+p133
+g9
+sVdn
+p134
+Vprostarsolar
+p135
+sVda
+p136
+g9
+sVlrt
+p137
+F1515515379.419792
+sg49
+V0-65535
+p138
+sg34
+V28
+p139
+sg36
+g37
+sVmisc_u
+p140
+g14
+sg39
+g40
+sVmrt
+p141
+V60
+p142
+sg43
+Vnone
+p143
+sg81
+g116
+sg47
+VOn
+p144
+sVmv
+p145
+g37
+sg51
+Vint
+p146
+ssV2-7
+p147
+(dp148
+Val
+p149
+g14
+sVah
+p150
+g14
+sVbytary
+p151
+NsVvm
+p152
+NsVvn
+p153
+VRaw Min Daily Battery Voltage
+p154
+sVct
+p155
+Vnumber
+p156
+sVle
+p157
+V16
+p158
+sVgrp
+p159
+V600
+p160
+sVla
+p161
+I19058
+sVchn
+p162
+Vvb_min_daily_raw
+p163
+sVun
+p164
+g9
+sVdn
+p165
+Vprostarsolar
+p166
+sVda
+p167
+g9
+sVlrt
+p168
+F1515514883.7010118
+sg49
+V0-65535
+p169
+sg34
+V65
+p170
+sg36
+g37
+sVmisc_u
+p171
+g14
+sg39
+g40
+sVmrt
+p172
+V60
+p173
+sg43
+Vnone
+p174
+sg81
+g147
+sg47
+VOn
+p175
+sVmv
+p176
+g37
+sg51
+Vint
+p177
+ssV2-4
+p178
+(dp179
+Val
+p180
+g14
+sVah
+p181
+g14
+sVbytary
+p182
+NsVvm
+p183
+NsVvn
+p184
+VRaw Load Voltage
+p185
+sVct
+p186
+Vnumber
+p187
+sVle
+p188
+V16
+p189
+sVgrp
+p190
+V600
+p191
+sVla
+p192
+I19232
+sVchn
+p193
+Vadc_vl_raw
+p194
+sVun
+p195
+g9
+sVdn
+p196
+Vprostarsolar
+p197
+sVda
+p198
+g9
+sVlrt
+p199
+F1515515370.4007909
+sg49
+V0-65535
+p200
+sg34
+V20
+p201
+sg36
+g37
+sVmisc_u
+p202
+g14
+sg39
+g40
+sVmrt
+p203
+V60
+p204
+sg43
+Vnone
+p205
+sg81
+g178
+sg47
+VOn
+p206
+sVmv
+p207
+g37
+sg51
+Vint
+p208
+ssV2-5
+p209
+(dp210
+Val
+p211
+g14
+sVah
+p212
+g14
+sVbytary
+p213
+NsVvm
+p214
+NsVvn
+p215
+VRaw Load Current
+p216
+sVct
+p217
+Vnumber
+p218
+sVle
+p219
+V16
+p220
+sVgrp
+p221
+V600
+p222
+sVla
+p223
+I12849
+sVchn
+p224
+Vadc_il_raw
+p225
+sVun
+p226
+g9
+sVdn
+p227
+Vprostarsolar
+p228
+sVda
+p229
+g9
+sVlrt
+p230
+F1515515370.884296
+sg49
+V0-65535
+p231
+sg34
+V22
+p232
+sg36
+g37
+sVmisc_u
+p233
+g14
+sg39
+g40
+sVmrt
+p234
+V60
+p235
+sg43
+Vnone
+p236
+sg81
+g209
+sg47
+VOn
+p237
+sVmv
+p238
+g37
+sg51
+Vint
+p239
+ssV2-8
+p240
+(dp241
+Val
+p242
+g14
+sVah
+p243
+g14
+sVbytary
+p244
+NsVvm
+p245
+NsVvn
+p246
+VRaw Max Daily Battery Voltage
+p247
+sVct
+p248
+Vnumber
+p249
+sVle
+p250
+V16
+p251
+sVgrp
+p252
+V600
+p253
+sVla
+p254
+I19280
+sVchn
+p255
+Vvb_max_daily_raw
+p256
+sVun
+p257
+g9
+sVdn
+p258
+Vprostarsolar
+p259
+sVda
+p260
+g9
+sVlrt
+p261
+F1515514885.1708192
+sg49
+V0-65535
+p262
+sg34
+V66
+p263
+sg36
+g37
+sVmisc_u
+p264
+g14
+sg39
+g40
+sVmrt
+p265
+V60
+p266
+sg43
+Vnone
+p267
+sg81
+g240
+sg47
+VOn
+p268
+sVmv
+p269
+g37
+sg51
+Vint
+p270
+ssV2-9
+p271
+(dp272
+Val
+p273
+g14
+sVah
+p274
+g14
+sVbytary
+p275
+NsVvm
+p276
+(dp277
+g9
+VNight Check
+p278
+sg37
+VStart
+p279
+sg40
+VNight
+p280
+sV2
+p281
+VDisconnect
+p282
+sV5
+p283
+VBulk
+p284
+sV4
+p285
+VFault
+p286
+sV7
+p287
+VFloat
+p288
+sV6
+p289
+VAbsorption
+p290
+sV8
+p291
+VEqualize
+p292
+ssVvn
+p293
+VCharge State
+p294
+sVct
+p295
+Vnumber
+p296
+sVle
+p297
+V16
+p298
+sVgrp
+p299
+V600
+p300
+sVla
+p301
+I6
+sVchn
+p302
+Vcharge_state
+p303
+sVun
+p304
+g9
+sVdn
+p305
+Vprostarsolar
+p306
+sVda
+p307
+g9
+sVlrt
+p308
+F1515514905.7810062
+sg49
+V0-65535
+p309
+sg34
+V33
+p310
+sg36
+g37
+sVmisc_u
+p311
+g14
+sg39
+g40
+sVmrt
+p312
+V60
+p313
+sg43
+Vnone
+p314
+sg81
+g271
+sg47
+VOn
+p315
+sVmv
+p316
+g37
+sg51
+Vint
+p317
+ssV2-10
+p318
+(dp319
+Val
+p320
+g14
+sVah
+p321
+g14
+sVbytary
+p322
+NsVvm
+p323
+(dp324
+V11
+p325
+VProcessor Supply Fault
+p326
+sV10
+p327
+VDip Switch Changed (Excl. DIP 8)
+p328
+sg9
+VFETs Shorted
+p329
+sg37
+VOvercurrent Phase 1
+p330
+sg40
+VBattery HVD (High Voltage Disconnect)
+p331
+sg281
+VSoftware Bug
+p332
+sg283
+VEEPROM Setting Edit (Reset required)
+p333
+sg285
+VArray HVD (High Voltage Disconnect)
+p334
+sg287
+VRTS was valid now disconnected
+p335
+sg289
+VRTS Shorted
+p336
+sV9
+p337
+VBattery LVD (Low Voltage Disconnect)
+p338
+sg291
+VLocal temp. sensor failed
+p339
+ssVvn
+p340
+VArray Fault
+p341
+sVct
+p342
+Vnumber
+p343
+sVle
+p344
+V16
+p345
+sVgrp
+p346
+V600
+p347
+sVla
+p348
+I0
+sVchn
+p349
+Varray_fault
+p350
+sVun
+p351
+g9
+sVdn
+p352
+Vprostarsolar
+p353
+sVda
+p354
+g9
+sVlrt
+p355
+F1515514886.1563522
+sg49
+V0-65535
+p356
+sg34
+V34
+p357
+sg36
+g37
+sVmisc_u
+p358
+g14
+sg39
+g40
+sVmrt
+p359
+V60
+p360
+sg43
+Vnone
+p361
+sg81
+g318
+sg47
+VOn
+p362
+sVmv
+p363
+g37
+sg51
+Vint
+p364
+ssssS'f'
+p365
+VOff
+p366
+sS'p'
+p367
+g14
+sS's'
+p368
+g281
+ssS'2'
+p369
+(dp370
+g3
+VM1-485
+p371
+sg5
+V9600
+p372
+sg7
+(dp373
+g281
+(dp374
+V4-1
+p375
+(dp376
+Val
+p377
+g14
+sVah
+p378
+g14
+sVbytary
+p379
+NsVvm
+p380
+NsVvn
+p381
+VVolume Flow
+p382
+sVct
+p383
+Vnumber
+p384
+sVle
+p385
+V32
+p386
+sVgrp
+p387
+V600
+p388
+sVla
+p389
+NsVchn
+p390
+Vvolume_flow
+p391
+sVun
+p392
+g9
+sVdn
+p393
+Vpromagmbs
+p394
+sVda
+p395
+g281
+sVlrt
+p396
+g37
+sg49
+V0-10000
+p397
+sg34
+V2008
+p398
+sg36
+g283
+sVmisc_u
+p399
+g14
+sg39
+g40
+sVmrt
+p400
+V60
+p401
+sg43
+Vnone
+p402
+sg81
+g375
+sg47
+VOn
+p403
+sVmv
+p404
+g37
+sg51
+Vfloat
+p405
+ssV4-2
+p406
+(dp407
+Val
+p408
+g14
+sVah
+p409
+g14
+sVbytary
+p410
+NsVvm
+p411
+NsVvn
+p412
+VMass Flow
+p413
+sVct
+p414
+Vnumber
+p415
+sVle
+p416
+V32
+p417
+sVgrp
+p418
+V600
+p419
+sVla
+p420
+NsVchn
+p421
+Vmass_flow
+p422
+sVun
+p423
+g9
+sVdn
+p424
+Vpromagmbs
+p425
+sVda
+p426
+g281
+sVlrt
+p427
+g37
+sg49
+V0-10000
+p428
+sg34
+V2010
+p429
+sg36
+g283
+sVmisc_u
+p430
+g14
+sg39
+g40
+sVmrt
+p431
+V60
+p432
+sg43
+Vnone
+p433
+sg81
+g406
+sg47
+VOn
+p434
+sVmv
+p435
+g37
+sg51
+Vfloat
+p436
+ssV4-3
+p437
+(dp438
+Val
+p439
+g14
+sVah
+p440
+g14
+sVbytary
+p441
+NsVvm
+p442
+NsVvn
+p443
+VConductivity
+p444
+sVct
+p445
+Vnumber
+p446
+sVle
+p447
+V32
+p448
+sVgrp
+p449
+V600
+p450
+sVla
+p451
+NsVchn
+p452
+Vconductivity
+p453
+sVun
+p454
+g9
+sVdn
+p455
+Vpromagmbs
+p456
+sVda
+p457
+g281
+sVlrt
+p458
+g37
+sg49
+V0-10000
+p459
+sg34
+V2014
+p460
+sg36
+V0.5
+p461
+sVmisc_u
+p462
+g14
+sg39
+g40
+sVmrt
+p463
+V60
+p464
+sg43
+Vnone
+p465
+sg81
+g437
+sg47
+VOn
+p466
+sVmv
+p467
+g37
+sg51
+Vfloat
+p468
+ssV4-4
+p469
+(dp470
+Val
+p471
+g14
+sVah
+p472
+g14
+sVbytary
+p473
+NsVvm
+p474
+NsVvn
+p475
+VTotalizer 1
+p476
+sVct
+p477
+Vnumber
+p478
+sVle
+p479
+V32
+p480
+sVgrp
+p481
+V600
+p482
+sVla
+p483
+NsVchn
+p484
+Vtotalizer_1
+p485
+sVun
+p486
+g9
+sVdn
+p487
+Vpromagmbs
+p488
+sVda
+p489
+g281
+sVlrt
+p490
+g37
+sg49
+V0-10000000
+p491
+sg34
+V2611
+p492
+sg36
+V50.0
+p493
+sVmisc_u
+p494
+g14
+sg39
+g40
+sVmrt
+p495
+V60
+p496
+sg43
+Vnone
+p497
+sg81
+g469
+sg47
+VOn
+p498
+sVmv
+p499
+g37
+sg51
+Vfloat
+p500
+ssV4-5
+p501
+(dp502
+Val
+p503
+g14
+sVah
+p504
+g14
+sVbytary
+p505
+NsVvm
+p506
+NsVvn
+p507
+VTotalizer 2
+p508
+sVct
+p509
+Vnumber
+p510
+sVle
+p511
+V32
+p512
+sVgrp
+p513
+V600
+p514
+sVla
+p515
+NsVchn
+p516
+Vtotalizer_2
+p517
+sVun
+p518
+g9
+sVdn
+p519
+Vpromagmbs
+p520
+sVda
+p521
+g281
+sVlrt
+p522
+g37
+sg49
+V0-10000000
+p523
+sg34
+V2811
+p524
+sg36
+V50
+p525
+sVmisc_u
+p526
+g14
+sg39
+g40
+sVmrt
+p527
+V60
+p528
+sg43
+Vnone
+p529
+sg81
+g501
+sg47
+VOn
+p530
+sVmv
+p531
+g37
+sg51
+Vfloat
+p532
+ssV4-6
+p533
+(dp534
+Val
+p535
+g14
+sVah
+p536
+g14
+sVbytary
+p537
+NsVvm
+p538
+NsVvn
+p539
+VTotalizer 3
+p540
+sVct
+p541
+Vnumber
+p542
+sVle
+p543
+V32
+p544
+sVgrp
+p545
+V600
+p546
+sVla
+p547
+NsVchn
+p548
+Vtotalizer_3
+p549
+sVun
+p550
+g9
+sVdn
+p551
+Vpromagmbs
+p552
+sVda
+p553
+g281
+sVlrt
+p554
+g37
+sg49
+V0-10000000
+p555
+sg34
+V3011
+p556
+sg36
+V50
+p557
+sVmisc_u
+p558
+g14
+sg39
+g40
+sVmrt
+p559
+V60
+p560
+sg43
+Vnone
+p561
+sg81
+g533
+sg47
+VOn
+p562
+sVmv
+p563
+g37
+sg51
+Vfloat
+p564
+ssssg365
+VOff
+p565
+sg367
+VNone
+p566
+sg368
+g9
+ss.
\ No newline at end of file
diff --git a/python-driver/prostarsolar.py b/python-driver/prostarsolar.py
index 7ea3a11..1b0e4cd 100644
--- a/python-driver/prostarsolar.py
+++ b/python-driver/prostarsolar.py
@@ -4,13 +4,8 @@ import threading
from device_base import deviceBase
import persistence
from utilities import get_public_ip_address
-import prostarsolar_utils
import time
-import minimalmodbus
-import minimalmodbusM1
-minimalmodbusM1.CLOSE_PORT_AFTER_EACH_CALL = True
-minimalmodbusM1.STOPBITS = 2
_ = None
@@ -18,7 +13,6 @@ _ = None
# GLOBAL VARIABLES
WATCHDOG_SEND_PERIOD = 3600 # Seconds, the longest amount of time before sending the watchdog status
PLC_IP_ADDRESS = "192.168.1.10"
-CHANNELS = prostarsolar_utils.CHANNELS # Load the channels from the utils program
# PERSISTENCE FILE
persist = persistence.load()
@@ -58,8 +52,6 @@ class start(threading.Thread, deviceBase):
public_ip_address = get_public_ip_address()
self.sendtodbDev(1, 'public_ip_address', public_ip_address, 0, 'prostarsolar')
- instrument_485 = self.connect_to_485(prostarsolar_utils.BAUDRATE, prostarsolar_utils.NODEADDRESS)
-
send_loops = 0
watchdog_loops = 0
watchdog_check_after = 5000
@@ -67,19 +59,6 @@ class start(threading.Thread, deviceBase):
if self.forceSend:
print "FORCE SEND: TRUE"
- for chan in CHANNELS:
- try:
- val = chan.read(instrument_485.read_registers(chan.register_number, chan.channel_size, functioncode=4))
- if chan.check(val, self.forceSend):
- self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'prostarsolar')
- time.sleep(0.1)
- except IOError as e:
- print("prostarsolar IO Error: {}".format(e))
- print("Attempting to reconnect to rs485 device")
- instrument_485 = self.connect_to_485(prostarsolar_utils.BAUDRATE, prostarsolar_utils.NODEADDRESS)
- except Exception as e:
- print("prostarsolar Non-IO Error: {}".format(e))
-
print("prostarsolar driver still alive...")
if self.forceSend:
if send_loops > 2:
@@ -98,17 +77,6 @@ class start(threading.Thread, deviceBase):
watchdog_loops = 0
time.sleep(10)
- def connect_to_485(self, baudrate, nodeaddress):
- """Connect to the RS485 device."""
- connected_to_485 = False
- while connected_to_485 is False:
- connected_to_485 = self.mcu.set485Baud(baudrate)
-
- serial_485 = self.mcu.rs485
- instrument_485 = minimalmodbusM1.Instrument(nodeaddress, serial_485)
- instrument_485.address = nodeaddress
- return instrument_485
-
def prostarsolar_sync(self, name, value):
"""Sync all data from the driver."""
self.forceSend = True