Open junh-ki opened 3 years ago
$ curl -G 'http://localhost:8086/query?db=mydb' --data-urlencode 'q=SELECT * FROM "mymeas"'
{"results":[{"statement_id":0,"series":[{"name":"mymeas","columns":["time","myfield","mytag1","mytag2"],"values":[["2017-03-01T00:16:18Z",33.1,null,null],["2017-03-01T00:17:18Z",12.4,"12","14"]]}]}]}
If there are so many empty bins in the evaluated bin map, it is due to the pre-evaluation that filters out bins with too low cumulative work stored (do not use bins with work < 0.5 kWh)
cloudfeeder.py
-u
: pc01@t20babfe7fb2840119f69e692f184127d
-P
: kuksatutisfun01
.env
HONO_TENANTID=t20babfe7fb2840119f69e692f184127d
HONO_MESSAGINGPW=s9VrzSsOQMzlSKFDgHrj
cloudfeeder.py
-u
: pc01@td7c1ab7cba824bdabb6266c6feaf212f
-P
: kuksatutisfun01
.env
HONO_TENANTID=td7c1ab7cba824bdabb6266c6feaf212f
HONO_MESSAGINGPW=zswIlmVYwzvFO1sxPInr
at least for sampling time (total sampling time, individual bin sampling time), it is better to be cloud based?
or implementing buffer? queue. (21/01/2021)
if queue is empty:
# send the current telemetry
else:
# send the current telemetry to pop queue
# send the first-in telemetry
If timeout:
go to queue
Implementing a buffer is probably the better solution. Buffer could be reused for other applications as well.
Implementing a buffer is probably the better solution. Buffer could be reused for other applications as well.
@Schmandreas I agree. Buffer part in cloudfeeder.py
is implemented here: c621457c396f33990bb77cd705bfb77b1f6ca995.
I tested it on my desk and it works well so far. We will run some tests in the truck this afternoon :)
(22/01/2021) (c540f0e)socket.timeout: timed out
> https://www.kite.com/python/answers/how-to-catch-a-socket-timeout-exception-in-python
SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0xb538f130>
transport: <_SelectorSocketTransport fd=10 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
File "/usr/lib/python3.7/asyncio/sslproto.py", line 526, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File "/usr/lib/python3.7/asyncio/sslproto.py", line 207, in feed_ssldata
self._sslobj.unwrap()
File "/usr/lib/python3.7/ssl.py", line 767, in unwrap
return self._sslobj.shutdown()
ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2609)
Exception in thread Thread-2:
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/websockets/protocol.py", line 827, in transfer_data
message = await self.read_message()
File "/home/pi/.local/lib/python3.7/site-packages/websockets/protocol.py", line 895, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
File "/home/pi/.local/lib/python3.7/site-packages/websockets/protocol.py", line 971, in read_data_frame
frame = await self.read_frame(max_size)
File "/home/pi/.local/lib/python3.7/site-packages/websockets/protocol.py", line 1051, in read_frame
extensions=self.extensions,
File "/home/pi/.local/lib/python3.7/site-packages/websockets/framing.py", line 105, in read
data = await reader(2)
File "/usr/lib/python3.7/asyncio/streams.py", line 679, in readexactly
await self._wait_for_data('readexactly')
File "/usr/lib/python3.7/asyncio/streams.py", line 473, in _wait_for_data
await self._waiter
concurrent.futures._base.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/home/pi/kuksa.val/clients/vss-testclient/../common/clientComm.py", line 144, in run
self.loop.run_until_complete(self.mainLoop())
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/home/pi/kuksa.val/clients/vss-testclient/../common/clientComm.py", line 126, in mainLoop
await self.msgHandler(ws)
File "/home/pi/kuksa.val/clients/vss-testclient/../common/clientComm.py", line 112, in msgHandler
resp = await webSocket.recv()
File "/home/pi/.local/lib/python3.7/site-packages/websockets/protocol.py", line 509, in recv
await self.ensure_open()
File "/home/pi/.local/lib/python3.7/site-packages/websockets/protocol.py", line 812, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason