I have a simple Django app running on Raspberry Pi and I am using Apache Web Server with Daphne (pi is the web server, too).
The Django app shares readings of a heat/temp sensor that is connected to the pi. It cycles every 1 minute and using websockets updates the browser of the connected device.
I can successfully connect using the raspberry pi IP with my other devices on the network including Windows desktop with Chrome, Macbook with Safari and the pi itself with Chromium. I can’t reliably connect with my iPhone running Chrome mobile. For the iPhone the best it can do is connect the first time but then Daphne shows this error; WARNING Application instance <Task pending name=‘Task-1’ coro=<ProtocolTypeRouter.call() running at /home/pi/.local/lib/python3.9/site-packages/channels/routing.py:62> wait_for=<Future pending cb=[_chain_future.._call_check_cancel() at /usr/lib/python3.9/asyncio/futures.py:384, <TaskWakeupMethWrapper object at 0x747b2c10>()]>> for connection <WebSocketProtocol client=[‘127.0.0.1’, 38802] path=b’/ws/showConditions/'> took too long to shut down and was killed.
I am happy to share code but could someone help me on where to focus the root cause analysis?
I read on one post that iPhone requires SSL. Tried that but could not get it to work.
I also am not actually using channels - should I add Redis to the app and that would fix it? At present I can only have one device connected at a time, which is fine. I assume using channels would allow multiple devices to connect?
Lastly, is it just a question of a timeout error and I just need to adjust a setting somewhere? I’ve seen other posts like this where NGINX was being used and they adjusted a NGINX timeout setting and it fixed it. Not sure if Apache might have a similar setting that needs to be tweaked.