You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I successfully managed to set up the connection, connect to the devices
I am interested to, send commands, see points, plot historical values,
etc., and also to save devices' data to a database with the command
dev_S10_AS01.save(), as explained in section 4.7 of the documentation
(dev_S10_AS01 is the name I gave to one of the controllers): the files
S10'AS01.db and S10'AS01.bin are correctly created (S10'AS01 is the
"actual" name of the controller in our system).
Then, I try to retrieve off-line the data I saved with the following
steps (in Spyder):
In [1]: import BAC0
In [2]: bacnet=BAC0.connect(ip='172.16.1.220')
Starting BAC0 version 0.99.921 (Complete)
Registered as Simple BACnet/IP App
Server started : http://172.16.1.220:8111
Bokeh server already running There is no current event loop in thread
'Thread-7'.
Flask server already running not writable
In [3]: dev_S10_AS01=BAC0.device('172.16.1.201',2107393,bacnet)
2018-08-29 11:43:09,386 - WARNING | Offline: provide database name to
load stored data.
WARNING:BAC0:Offline: provide database name to load stored data.
2018-08-29 11:43:09,389 - WARNING | Ex. controller.connect(db = 'backup')
WARNING:BAC0:Ex. controller.connect(db = 'backup')
In [4]: cd test_seb_2018_08_24
C:\Users\Administrator\test_seb_2018_08_24
In [5]: dev_S10_AS01.connect(db="S10'AS01")
Device restored from db
Till now, everything works just fine; but now, if I try to see the
history of a point (a temperature sensor), just as I would do when on-line:
In [6]: dev_S10_AS01["HC'HC06'Sen'TRt"].history
Traceback (most recent call last):
File "<ipython-input-6-5f5e1e19bfc2>", line 1, in <module>
dev_S10_AS01["HC'HC06'Sen'TRt"].history
File
"C:\ProgramData\Anaconda3\lib\site-packages\BAC0\core\devices\Device.py",
line 410, in __getitem__
return self._findPoint(point_name)
File
"C:\ProgramData\Anaconda3\lib\site-packages\BAC0\core\devices\Device.py",
line 505, in _findPoint
point.value
File
"C:\ProgramData\Anaconda3\lib\site-packages\BAC0\core\devices\Points.py",
line 645, in value
value = self.lastValue
File
"C:\ProgramData\Anaconda3\lib\site-packages\BAC0\core\devices\Points.py",
line 131, in lastValue
return self.history.dropna().iloc[-1]
File
"C:\ProgramData\Anaconda3\lib\site-packages\BAC0\core\devices\Points.py",
line 635, in history
'history', self.properties.device.db))
TypeError: read_sql() missing 1 required positional argument: 'con'
The problem seems to lie in lines 634-635 of Points.py (here I copy from
631 to 637):
class NumericPointOffline(NumericPoint):
@property
def history(self):
his = sql.read_sql('select * from "{}"'.format(
'history', self.properties.device.db))
his.index = his['index'].apply(Timestamp)
return his.set_index('index')[self.properties.name]
If I got it correctly, read_sql(sql,con) needs at least two arguments:
the query (sql) and the connectable database (con), but it seems that
the lines:
his = sql.read_sql('select * from "{}"'.format(
'history', self.properties.device.db))
are not "interpreted" that way.
What am I missing? Unfortunately, my knowledge of python is very limited
and I am not able to see it.
The text was updated successfully, but these errors were encountered:
[bug received by email]
I successfully managed to set up the connection, connect to the devices
I am interested to, send commands, see points, plot historical values,
etc., and also to save devices' data to a database with the command
dev_S10_AS01.save(), as explained in section 4.7 of the documentation
(dev_S10_AS01 is the name I gave to one of the controllers): the files
S10'AS01.db and S10'AS01.bin are correctly created (S10'AS01 is the
"actual" name of the controller in our system).
Then, I try to retrieve off-line the data I saved with the following
steps (in Spyder):
If I got it correctly, read_sql(sql,con) needs at least two arguments:
the query (sql) and the connectable database (con), but it seems that
the lines:
are not "interpreted" that way.
What am I missing? Unfortunately, my knowledge of python is very limited
and I am not able to see it.
The text was updated successfully, but these errors were encountered: