Skip to content

Instantly share code, notes, and snippets.



Created Jan 19, 2020
What would you like to do?
Kohler DTV+ Proxy Disconnect Issue

Steps to reproduce:

  1. Install Python 3.x and pip3 install aiohttp and requests
  2. Run this command via python

Possible Core Issues:

  1. Incorrectly configured server side proxy that is terminating the request too soon.
  2. This is a malformed http response:

Requests Error

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/", line 600, in urlopen
  File "/usr/local/lib/python3.7/site-packages/urllib3/", line 384, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.7/site-packages/urllib3/", line 380, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/", line 1344, in getresponse
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/", line 306, in begin
    version, status, reason = self._read_status()
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/", line 288, in _read_status
    raise BadStatusLine(line)
http.client.BadStatusLine: {......json response...


Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/", line 847, in start
    message, payload = await  # type: ignore  # noqa
  File "/usr/local/lib/python3.7/site-packages/aiohttp/", line 591, in read
    await self._waiter
  File "/usr/local/lib/python3.7/site-packages/aiohttp/", line 201, in data_received
    messages, upgraded, tail = self._parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadHttpMessage: 400, message='invalid constant string'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 18, in <module>
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/", line 583, in run_until_complete
    return future.result()
  File "", line 12, in main
    async with session.get(url) as resp:
  File "/usr/local/lib/python3.7/site-packages/aiohttp/", line 1012, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.7/site-packages/aiohttp/", line 504, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/", line 852, in start
    message=exc.message, headers=exc.headers) from exc
aiohttp.client_exceptions.ClientResponseError: 400, message='invalid constant string', url=URL('http://IP_OF_SHOWER_CONTROLLER_HERE/values.cgi?_=1579384493390')
import aiohttp
import asyncio
import requests
async def main():
url = "http://IP_OF_SHOWER_CONTROLLER_HERE/values.cgi?_=1579384493390"
response = requests.get(url)
async with aiohttp.ClientSession() as session:
async with session.get(url) as resp:
print(await resp.json())
if __name__ == '__main__':
loop = asyncio.get_event_loop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment